Crash Ticking Entity et ArrayIndexOutOfBoundsException sur EntityBullet de Flan's Mod



  • Bonsoir,

    J'ai mon serveur qui crash beaucoup trop à cause de ceci :

    –-- Minecraft Crash Report ----
    // I blame Dinnerbone.

    Time: 20/11/15 22:56
    Description: Ticking entity

    java.lang.ArrayIndexOutOfBoundsException: -1228
    at com.flansmod.common.guns.EntityBullet.func_70071_h_(EntityBullet.java:285)
    at net.minecraft.world.World.func_72866_a(World.java:2629)
    at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:837)
    at net.minecraft.world.World.func_72870_g(World.java:2581)
    at net.minecraft.world.World.func_72939_s(World.java:2405)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:669)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:954)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669)
    at java.lang.Thread.run(Unknown Source)

    A detailed walkthrough of the error, its code path and all known details is as follows:

    -- Head --
    Stacktrace:
    at com.flansmod.common.guns.EntityBullet.func_70071_h_(EntityBullet.java:285)
    at net.minecraft.world.World.func_72866_a(World.java:2629)
    at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:837)
    at net.minecraft.world.World.func_72870_g(World.java:2581)

    -- Entity being ticked --
    Details:
    Entity Type: flansmod.Bullet (com.flansmod.common.guns.EntityBullet)
    Entity ID: 38023
    Entity Name: entity.flansmod.Bullet.name
    Entity's Exact location: -2678,43, 52,62, -3618,37
    Entity's Block location: World: (-2679,52,-3619), Chunk: (at 9,3,13 in -168,-227; contains blocks -2688,0,-3632 to -2673,255,-3617), Region: (-6,-8; contains chunks -192,-256 to -161,-225, blocks -3072,0,-4096 to -2561,255,-3585)
    Entity's Momentum: 4,48, -1,50, -8,88
    Stacktrace:
    at net.minecraft.world.World.func_72939_s(World.java:2405)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:669)

    -- Affected level --
    Details:
    Level name: AltisCraft
    All players: 27 total; [EntityPlayerMP['Benjamin_Loison'/74, l='AltisCraft', x=-1544,27, y=64,86, z=-8427,94](Benjamin_Loison at -1544.2698774607275,64.86449093919774,-8427.940574919805), EntityPlayerMP['Loulou29'/1908, l='AltisCraft', x=-8496,25, y=33,00, z=-3819,58](Loulou29 at -8496.245468006638,33.0,-3819.5769078835638), EntityPlayerMP['terksh97'/3850, l='AltisCraft', x=-3445,32, y=7,00, z=-2852,98](terksh97 at -3445.315130876787,7.0,-2852.982615350122), EntityPlayerMP['ManiackGoRed'/4358, l='AltisCraft', x=-8371,29, y=32,88, z=-3699,00](ManiackGoRed at -8371.294623014284,32.875,-3699.00204885751), EntityPlayerMP['BySweaTz_'/6173, l='AltisCraft', x=-8965,35, y=15,00, z=-4142,94](BySweaTz_ at -8965.348502591127,15.0,-4142.942597096487), EntityPlayerMP['TheFarXtrem'/6581, l='AltisCraft', x=-8636,27, y=22,00, z=-3166,39](TheFarXtrem at -8636.270743401748,22.0,-3166.394052650425), EntityPlayerMP['jojot31'/7875, l='AltisCraft', x=-6422,70, y=248,00, z=-7060,07](jojot31 at -6422.699999988079,248.0,-7060.071813715473), EntityPlayerMP['bomtigreu'/8247, l='AltisCraft', x=-8495,65, y=33,00, z=-3820,71](bomtigreu at -8495.645037845996,33.0,-3820.7106168154755), EntityPlayerMP['EtiMy'/9133, l='AltisCraft', x=-6422,40, y=250,00, z=-7061,47](EtiMy at -6422.404845858353,250.0,-7061.473539070133), EntityPlayerMP['ob1'/9574, l='AltisCraft', x=-8505,12, y=33,00, z=-3705,71](ob1 at -8505.124353035219,33.0,-3705.7067648575953), EntityPlayerMP['Lorde_ibrhaim'/14583, l='AltisCraft', x=-8630,85, y=19,02, z=-3175,01](Lorde_ibrhaim at -8630.845063330746,19.0155550727022,-3175.0071367124306), EntityPlayerMP['ByFrozeur'/19166, l='AltisCraft', x=-8334,88, y=33,00, z=-3650,10](ByFrozeur at -8334.881465457196,33.0,-3650.0950652681718), EntityPlayerMP['Micka31140'/19660, l='AltisCraft', x=-8600,15, y=16,00, z=-3264,94](Micka31140 at -8600.151489303735,16.0,-3264.943679337182), EntityPlayerMP['Corkito27'/20496, l='AltisCraft', x=-1075,09, y=41,18, z=-1786,72](Corkito27 at -1075.088627242114,41.184741041705074,-1786.719328980761), EntityPlayerMP['Darkmachine67'/21277, l='AltisCraft', x=-8460,45, y=33,00, z=-3758,19](Darkmachine67 at -8460.454419079068,33.0,-3758.187274076196), EntityPlayerMP['ilyas_2003'/24057, l='AltisCraft', x=-8762,29, y=17,00, z=-3103,09](ilyas_2003 at -8762.29249819089,17.0,-3103.0921169868047), EntityPlayerMP['kawwa59'/25402, l='AltisCraft', x=-8633,25, y=21,23, z=-3162,25](kawwa59 at -8633.253558797023,21.231523797587013,-3162.249940426519), EntityPlayerMP['math172'/25436, l='AltisCraft', x=-8633,92, y=22,00, z=-3163,20](math172 at -8633.915066654628,22.0,-3163.201465666777), EntityPlayerMP['BNlegateau'/27790, l='AltisCraft', x=-8383,62, y=33,10, z=-3654,18](BNlegateau at -8383.61868984547,33.104080378093045,-3654.1762354922193), EntityPlayerMP['theobrocard'/29371, l='AltisCraft', x=-8510,68, y=33,50, z=-3642,40](theobrocard at -8510.676298439324,33.50027123093605,-3642.404256107897), EntityPlayerMP['Furiouzino_-83'/31237, l='AltisCraft', x=-8504,57, y=33,00, z=-3701,79](Furiouzino_-83 at -8504.570657469558,33.0,-3701.7940043397016), EntityPlayerMP['coco02'/31723, l='AltisCraft', x=-8302,18, y=45,00, z=-4958,93](coco02 at -8302.177751743435,45.0,-4958.929638490932), EntityPlayerMP['Narsix72'/32712, l='AltisCraft', x=0,50, y=99,00, z=0,50](Narsix72 at 0.5,99.0,0.5), EntityPlayerMP['John_Escobar'/34711, l='AltisCraft', x=-2675,68, y=51,00, z=-3619,84](John_Escobar at -2675.67510281353,51.0,-3619.8351524908085), EntityPlayerMP['Misquinex'/34754, l='AltisCraft', x=-3445,22, y=7,00, z=-2847,53](Misquinex at -3445.21986720555,7.0,-2847.5295111103737), EntityPlayerMP['Hamza117'/35754, l='AltisCraft', x=-2678,43, y=51,00, z=-3618,37](Hamza117 at -2678.43190727318,51.0,-3618.368158506309), EntityPlayerMP['Karateje'/36481, l='AltisCraft', x=-2675,62, y=51,00, z=-3622,40](Karateje at -2675.621182444321,51.0,-3622.4002596900687)]
    Chunk stats: ServerChunkCache: 5313 Drop: 0
    Level seed: 27594263
    Level generator: ID 02 - largeBiomes, ver 0. Features enabled: false
    Level generator options: 
    Level spawn location: World: (0,99,0), Chunk: (at 0,6,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 327569597 game time, 340132215 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 130490 (now: false), thunder time: 69963 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
    Stacktrace:
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:954)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669)
    at java.lang.Thread.run(Unknown Source)

    – System Details --
    Details:
    Minecraft Version: 1.7.10
    KCauldron Version: pw.prok:KCauldron:1.7.10-1492.155
    Operating System: Windows Server 2012 R2 (amd64) version 6.3
    Java Version: 1.8.0_65, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 2121310328 bytes (2023 MB) / 3100639232 bytes (2957 MB) up to 4772593664 bytes (4551 MB)
    JVM Flags: 2 total; -Xms3G -Xmx5G
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 103
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1492 11 mods loaded, 11 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (OpenMod-Prov2.jar) 
    UCHIJAAAA Forge{10.13.4.1492} [Minecraft Forge] (OpenMod-Prov2.jar) 
    UCHIJAAAA kimagine{0.1} [KImagine] (minecraft.jar) 
    UCHIJAAAA CarpentersBlocks{0.0.1 Beta} [AltisCraft.fr] (AltisCraft.fr.jar) 
    UCHIJAAAA flansmod{@VERSION@} [Flan's Mod] (AltisCraft.fr.jar) 
    UCHIJAAAA thirstmod{1.8.14} [Thirst Mod] (AltisCraft.fr.jar) 
    UCHIJAAAA t4pro{1.0.1} [Project] (AltisCraft.fr.jar) 
    UCHIJAAAA altiscraft.MODID{1.0.0} [AltisCraft.fr] (AltisCraft.fr.jar) 
    UCHIJAAAA Backpack{2.0.1} [Backpack] (backpack-2.0.1-1.7.x.jar) 
    UCHIJAAAA gvc{0.6.1} [§aGliby's§f Voice Chat Mod] (GlibysVC-1.7.10-0.6.1.jar) 
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Player Count: 27 / 100; [EntityPlayerMP['Benjamin_Loison'/74, l='AltisCraft', x=-1544,27, y=64,86, z=-8427,94](Benjamin_Loison at -1544.2698774607275,64.86449093919774,-8427.940574919805), EntityPlayerMP['Loulou29'/1908, l='AltisCraft', x=-8496,25, y=33,00, z=-3819,58](Loulou29 at -8496.245468006638,33.0,-3819.5769078835638), EntityPlayerMP['terksh97'/3850, l='AltisCraft', x=-3445,32, y=7,00, z=-2852,98](terksh97 at -3445.315130876787,7.0,-2852.982615350122), EntityPlayerMP['ManiackGoRed'/4358, l='AltisCraft', x=-8371,29, y=32,88, z=-3699,00](ManiackGoRed at -8371.294623014284,32.875,-3699.00204885751), EntityPlayerMP['BySweaTz_'/6173, l='AltisCraft', x=-8965,35, y=15,00, z=-4142,94](BySweaTz_ at -8965.348502591127,15.0,-4142.942597096487), EntityPlayerMP['TheFarXtrem'/6581, l='AltisCraft', x=-8636,27, y=22,00, z=-3166,39](TheFarXtrem at -8636.270743401748,22.0,-3166.394052650425), EntityPlayerMP['jojot31'/7875, l='AltisCraft', x=-6422,70, y=248,00, z=-7060,07](jojot31 at -6422.699999988079,248.0,-7060.071813715473), EntityPlayerMP['bomtigreu'/8247, l='AltisCraft', x=-8495,65, y=33,00, z=-3820,71](bomtigreu at -8495.645037845996,33.0,-3820.7106168154755), EntityPlayerMP['EtiMy'/9133, l='AltisCraft', x=-6422,40, y=250,00, z=-7061,47](EtiMy at -6422.404845858353,250.0,-7061.473539070133), EntityPlayerMP['ob1'/9574, l='AltisCraft', x=-8505,12, y=33,00, z=-3705,71](ob1 at -8505.124353035219,33.0,-3705.7067648575953), EntityPlayerMP['Lorde_ibrhaim'/14583, l='AltisCraft', x=-8630,85, y=19,02, z=-3175,01](Lorde_ibrhaim at -8630.845063330746,19.0155550727022,-3175.0071367124306), EntityPlayerMP['ByFrozeur'/19166, l='AltisCraft', x=-8334,88, y=33,00, z=-3650,10](ByFrozeur at -8334.881465457196,33.0,-3650.0950652681718), EntityPlayerMP['Micka31140'/19660, l='AltisCraft', x=-8600,15, y=16,00, z=-3264,94](Micka31140 at -8600.151489303735,16.0,-3264.943679337182), EntityPlayerMP['Corkito27'/20496, l='AltisCraft', x=-1075,09, y=41,18, z=-1786,72](Corkito27 at -1075.088627242114,41.184741041705074,-1786.719328980761), EntityPlayerMP['Darkmachine67'/21277, l='AltisCraft', x=-8460,45, y=33,00, z=-3758,19](Darkmachine67 at -8460.454419079068,33.0,-3758.187274076196), EntityPlayerMP['ilyas_2003'/24057, l='AltisCraft', x=-8762,29, y=17,00, z=-3103,09](ilyas_2003 at -8762.29249819089,17.0,-3103.0921169868047), EntityPlayerMP['kawwa59'/25402, l='AltisCraft', x=-8633,25, y=21,23, z=-3162,25](kawwa59 at -8633.253558797023,21.231523797587013,-3162.249940426519), EntityPlayerMP['math172'/25436, l='AltisCraft', x=-8633,92, y=22,00, z=-3163,20](math172 at -8633.915066654628,22.0,-3163.201465666777), EntityPlayerMP['BNlegateau'/27790, l='AltisCraft', x=-8383,62, y=33,10, z=-3654,18](BNlegateau at -8383.61868984547,33.104080378093045,-3654.1762354922193), EntityPlayerMP['theobrocard'/29371, l='AltisCraft', x=-8510,68, y=33,50, z=-3642,40](theobrocard at -8510.676298439324,33.50027123093605,-3642.404256107897), EntityPlayerMP['Furiouzino_-83'/31237, l='AltisCraft', x=-8504,57, y=33,00, z=-3701,79](Furiouzino_-83 at -8504.570657469558,33.0,-3701.7940043397016), EntityPlayerMP['coco02'/31723, l='AltisCraft', x=-8302,18, y=45,00, z=-4958,93](coco02 at -8302.177751743435,45.0,-4958.929638490932), EntityPlayerMP['Narsix72'/32712, l='AltisCraft', x=0,50, y=99,00, z=0,50](Narsix72 at 0.5,99.0,0.5), EntityPlayerMP['John_Escobar'/34711, l='AltisCraft', x=-2675,68, y=51,00, z=-3619,84](John_Escobar at -2675.67510281353,51.0,-3619.8351524908085), EntityPlayerMP['Misquinex'/34754, l='AltisCraft', x=-3445,22, y=7,00, z=-2847,53](Misquinex at -3445.21986720555,7.0,-2847.5295111103737), EntityPlayerMP['Hamza117'/35754, l='AltisCraft', x=-2678,43, y=51,00, z=-3618,37](Hamza117 at -2678.43190727318,51.0,-3618.368158506309), EntityPlayerMP['Karateje'/36481, l='AltisCraft', x=-2675,62, y=51,00, z=-3622,40](Karateje at -2675.621182444321,51.0,-3622.4002596900687)]
    Is Modded: Definitely; Server brand changed to 'kcauldron,cauldron,craftbukkit,mcpc,fml,forge'
    Type: Dedicated Server (map_server.txt)

    La classe en question :

    package com.flansmod.common.guns;
    
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.List;
    import java.util.Random;
    
    import com.flansmod.client.FlansModClient;
    import com.flansmod.client.debug.EntityDebugDot;
    import com.flansmod.common.FlansMod;
    import com.flansmod.common.PlayerData;
    import com.flansmod.common.PlayerHandler;
    import com.flansmod.common.RotatedAxes;
    import com.flansmod.common.driveables.EntityDriveable;
    import com.flansmod.common.driveables.EntityPlane;
    import com.flansmod.common.driveables.EntitySeat;
    import com.flansmod.common.driveables.EntityVehicle;
    import com.flansmod.common.driveables.mechas.EntityMecha;
    import com.flansmod.common.guns.raytracing.BlockHit;
    import com.flansmod.common.guns.raytracing.BulletHit;
    import com.flansmod.common.guns.raytracing.DriveableHit;
    import com.flansmod.common.guns.raytracing.EntityHit;
    import com.flansmod.common.guns.raytracing.EnumHitboxType;
    import com.flansmod.common.guns.raytracing.PlayerBulletHit;
    import com.flansmod.common.guns.raytracing.PlayerHitbox;
    import com.flansmod.common.guns.raytracing.PlayerSnapshot;
    import com.flansmod.common.network.PacketFlak;
    import com.flansmod.common.teams.Team;
    import com.flansmod.common.teams.TeamsManager;
    import com.flansmod.common.types.InfoType;
    import com.flansmod.common.vector.Vector3f;
    
    import cpw.mods.fml.common.FMLCommonHandler;
    import cpw.mods.fml.common.network.ByteBufUtils;
    import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import io.netty.buffer.ByteBuf;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.particle.EntityFX;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.EntityPlayerMP;
    import net.minecraft.init.Blocks;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.util.DamageSource;
    import net.minecraft.util.EntityDamageSourceIndirect;
    import net.minecraft.util.MathHelper;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.util.Vec3;
    import net.minecraft.world.World;
    
    public class EntityBullet extends EntityShootable implements IEntityAdditionalSpawnData
    {
    private static int bulletLife = 600; //Kill bullets after 30 seconds
    public Entity owner;
    private int ticksInAir;
    public BulletType type;
    /** What type of weapon did this come from? For death messages */
    public InfoType firedFrom;
    /** The amount of damage the gun imparted upon the bullet. Multiplied by the bullet damage to get total damage */
    public float damage;
    public boolean shotgun = false;
    /** If this is non-zero, then the player raytrace code will look back in time to when the player thinks their bullet should have hit */
    public int pingOfShooter = 0;
    /** Avoids the fact that using the entity random to calculate spread direction always results in the same direction */
    public static Random bulletRandom = new Random();
    /** For homing missiles */
    public Entity lockedOnTo;
    
    public float penetratingPower;
    
    public EntityBullet(World world)
    {
    super(world);
    ticksInAir = 0;
    setSize(0.5F, 0.5F);
    }
    
    /** Private partial constructor to avoid repeated code. All constructors go through this one */
    private EntityBullet(World world, EntityLivingBase shooter, float gunDamage, BulletType bulletType, InfoType shotFrom)
    {
    this(world);
    owner = shooter;
    if(shooter instanceof EntityPlayerMP)
    pingOfShooter = ((EntityPlayerMP)shooter).ping;
    type = bulletType;
    firedFrom = shotFrom;
    damage = gunDamage;
    penetratingPower = type.penetratingPower;
    }
    
    /** Method called by ItemGun for creating bullets from a hand held weapon */
    public EntityBullet(World world, EntityLivingBase shooter, float spread, float gunDamage, BulletType type1, float speed, boolean shot, InfoType shotFrom)
    {
    this(world, Vec3.createVectorHelper(shooter.posX, shooter.posY + shooter.getEyeHeight(), shooter.posZ), shooter.rotationYaw, shooter.rotationPitch, shooter, spread, gunDamage, type1, speed, shotFrom);
    shotgun = shot;
    }
    
    /** Machinegun / AAGun bullet constructor */
    public EntityBullet(World world, Vec3 origin, float yaw, float pitch, EntityLivingBase shooter, float spread, float gunDamage, BulletType type1, InfoType shotFrom)
    {
    this(world, origin, yaw, pitch, shooter, spread, gunDamage, type1, 3.0F, shotFrom);
    }
    
    /** More generalised bullet constructor */
    public EntityBullet(World world, Vec3 origin, float yaw, float pitch, EntityLivingBase shooter, float spread, float gunDamage, BulletType type1, float speed, InfoType shotFrom)
    {
    this(world, shooter, gunDamage, type1, shotFrom);
    setLocationAndAngles(origin.xCoord, origin.yCoord, origin.zCoord, yaw, pitch);
    setPosition(posX, posY, posZ);
    yOffset = 0.0F;
    motionX = -MathHelper.sin((rotationYaw / 180F) * 3.14159265F) * MathHelper.cos((rotationPitch / 180F) * 3.14159265F);
    motionZ = MathHelper.cos((rotationYaw / 180F) * 3.14159265F) * MathHelper.cos((rotationPitch / 180F) * 3.14159265F);
    motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F);
    setArrowHeading(motionX, motionY, motionZ, spread / 2F, speed);
    }
    
    /**  */
    public EntityBullet(World world, Vector3f origin, Vector3f direction, EntityLivingBase shooter, float spread, float gunDamage, BulletType type1, float speed, InfoType shotFrom)
    {
    this(world, shooter, gunDamage, type1, shotFrom);
    damage = gunDamage;
    setPosition(origin.x, origin.y, origin.z);
    motionX = direction.x;
    motionY = direction.y;
    motionZ = direction.z;
    setArrowHeading(motionX, motionY, motionZ, spread, speed);
    }
    
    /** Bomb constructor. Inherits the motion and rotation of the plane */
    public EntityBullet(World world, Vec3 origin, float yaw, float pitch, double motX, double motY, double motZ, EntityLivingBase shooter, float gunDamage, BulletType type1, InfoType shotFrom)
    {
    this(world, shooter, gunDamage, type1, shotFrom);
    setLocationAndAngles(origin.xCoord, origin.yCoord, origin.zCoord, yaw, pitch);
    setPosition(posX, posY, posZ);
    yOffset = 0.0F;
    motionX = motX;
    motionY = motY;
    motionZ = motZ;
    }
    
    @Override
    protected void entityInit()
    {
    }
    
    public void setArrowHeading(double d, double d1, double d2, float spread, float speed)
    {
    float f2 = MathHelper.sqrt_double(d * d + d1 * d1 + d2 * d2);
    d /= f2;
    d1 /= f2;
    d2 /= f2;
    d *= speed;
    d1 *= speed;
    d2 *= speed;
    d += rand.nextGaussian() * 0.005D * spread * speed;
    d1 += rand.nextGaussian() * 0.005D * spread * speed;
    d2 += rand.nextGaussian() * 0.005D * spread * speed;
    motionX = d;
    motionY = d1;
    motionZ = d2;
    float f3 = MathHelper.sqrt_double(d * d + d2 * d2);
    prevRotationYaw = rotationYaw = (float) ((Math.atan2(d, d2) * 180D) / 3.1415927410125732D);
    prevRotationPitch = rotationPitch = (float) ((Math.atan2(d1, f3) * 180D) / 3.1415927410125732D);
    
    getLockOnTarget();
    }
    
    /** Find the entity nearest to the missile's trajectory, anglewise */
    private void getLockOnTarget() 
    {
    if(type.lockOnToPlanes || type.lockOnToVehicles || type.lockOnToMechas || type.lockOnToLivings || type.lockOnToPlayers)
    {
    Vector3f motionVec = new Vector3f(motionX, motionY, motionZ);
    Entity closestEntity = null;
    float closestAngle = type.maxLockOnAngle * 3.14159265F / 180F;
    
    for(Object obj : worldObj.loadedEntityList)
    {
    Entity entity = (Entity)obj;
    if((type.lockOnToMechas && entity instanceof EntityMecha) || (type.lockOnToVehicles && entity instanceof EntityVehicle) || (type.lockOnToPlanes && entity instanceof EntityPlane) || (type.lockOnToPlayers && entity instanceof EntityPlayer) || (type.lockOnToLivings && entity instanceof EntityLivingBase))
    {
    Vector3f relPosVec = new Vector3f(entity.posX - posX, entity.posY - posY, entity.posZ - posZ);
    float angle = Math.abs(Vector3f.angle(motionVec, relPosVec));
    if(angle < closestAngle)
    {
    closestEntity = entity;
    closestAngle = angle;
    }
    }
    }
    
    if(closestEntity != null)
    lockedOnTo = closestEntity;
    }
    }
    
    @Override
    public void setVelocity(double d, double d1, double d2)
    {
    motionX = d;
    motionY = d1;
    motionZ = d2;
    if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
    {
    float f = MathHelper.sqrt_double(d * d + d2 * d2);
    prevRotationYaw = rotationYaw = (float) ((Math.atan2(d, d2) * 180D) / 3.1415927410125732D);
    prevRotationPitch = rotationPitch = (float) ((Math.atan2(d1, f) * 180D) / 3.1415927410125732D);
    setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
    }
    }
    
    @Override
    public void onUpdate()
    {
    super.onUpdate();
    
    //Check the fuse to see if the bullet should explode
    ticksInAir++;
    if (ticksInAir > type.fuse && type.fuse > 0 && !isDead)
    {
    setDead();
    }
    
    if(ticksExisted > bulletLife)
    {
    setDead();
    }
    
    if(isDead)
    return;
    
    //Create a list for all bullet hits
    ArrayList <bullethit>hits = new ArrayList<bullethit>();
    
    Vector3f origin = new Vector3f(posX, posY, posZ);
    Vector3f motion = new Vector3f(motionX, motionY, motionZ);
    
    float speed = motion.length();
    
    //Iterate over all entities
    for(int i = 0; i < worldObj.loadedEntityList.size(); i++)
    {
    Object obj = worldObj.loadedEntityList.get(i);
    //Get driveables
    if(obj instanceof EntityDriveable)
    {
    EntityDriveable driveable = (EntityDriveable)obj;
    
    if(driveable.isDead() || driveable.isPartOfThis(owner))
    continue;
    
    //If this bullet is within the driveable's detection range
    if(getDistanceToEntity(driveable) <= driveable.getDriveableType().bulletDetectionRadius + speed)
    {
    //Raytrace the bullet
    ArrayList <bullethit>driveableHits = driveable.attackFromBullet(origin, motion);
    hits.addAll(driveableHits);
    }
    }
    //Get players
    else if(obj instanceof EntityPlayer)
    {
    EntityPlayer player = (EntityPlayer)obj;
    PlayerData data = PlayerHandler.getPlayerData(player);
    boolean shouldDoNormalHitDetect = false;
    if(data != null)
    {
    if(player.isDead || data.team == Team.spectators)
    {
    continue;
    }
    if(player == owner && ticksInAir < 20)
    continue;
    int snapshotToTry = pingOfShooter / 50;
    if(snapshotToTry >= data.snapshots.length)
    snapshotToTry = data.snapshots.length - 1;
    
    PlayerSnapshot snapshot = data.snapshots[snapshotToTry];
    if(snapshot == null)
    snapshot = data.snapshots[0];
    
    //DEBUG
    //snapshot = new PlayerSnapshot(player);
    
    //Check one last time for a null snapshot. If this is the case, fall back to normal hit detection
    if(snapshot == null)
    shouldDoNormalHitDetect = true;
    else
    {
    //Raytrace
    ArrayList <bullethit>playerHits = snapshot.raytrace(origin, motion);
    hits.addAll(playerHits);
    }
    }
    
    //If we couldn't get a snapshot, use normal entity hitbox calculations
    if(data == null || shouldDoNormalHitDetect)
    {
    MovingObjectPosition mop = player.boundingBox.calculateIntercept(origin.toVec3(), Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ));
    if(mop != null)
    {
    Vector3f hitPoint = new Vector3f(mop.hitVec.xCoord - posX, mop.hitVec.yCoord - posY, mop.hitVec.zCoord - posZ);
    float hitLambda = 1F;
    if(motion.x != 0F)
    hitLambda = hitPoint.x / motion.x;
    else if(motion.y != 0F)
    hitLambda = hitPoint.y / motion.y;
    else if(motion.z != 0F)
    hitLambda = hitPoint.z / motion.z;
    if(hitLambda < 0)
    hitLambda = -hitLambda;
    
    hits.add(new PlayerBulletHit(new PlayerHitbox(player, new RotatedAxes(), new Vector3f(), new Vector3f(), new Vector3f(), EnumHitboxType.BODY), hitLambda));
    }
    }
    }
    else
    {
    Entity entity = (Entity)obj;
    if(entity != this && entity != owner && !entity.isDead && (entity instanceof EntityLivingBase || entity instanceof EntityAAGun || entity instanceof EntityGrenade))
    {
    MovingObjectPosition mop = entity.boundingBox.calculateIntercept(origin.toVec3(), Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ));
    if(mop != null)
    {
    Vector3f hitPoint = new Vector3f(mop.hitVec.xCoord - posX, mop.hitVec.yCoord - posY, mop.hitVec.zCoord - posZ);
    float hitLambda = 1F;
    if(motion.x != 0F)
    hitLambda = hitPoint.x / motion.x;
    else if(motion.y != 0F)
    hitLambda = hitPoint.y / motion.y;
    else if(motion.z != 0F)
    hitLambda = hitPoint.z / motion.z;
    if(hitLambda < 0)
    hitLambda = -hitLambda;
    
    hits.add(new EntityHit(entity, hitLambda));
    }
    }
    }
    }
    
    //Ray trace the bullet by comparing its next position to its current position
    Vec3 posVec = Vec3.createVectorHelper(posX, posY, posZ);
    Vec3 nextPosVec = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
    MovingObjectPosition hit = worldObj.func_147447_a(posVec, nextPosVec, false, true, true);
    
    posVec = Vec3.createVectorHelper(posX, posY, posZ);
    
    if(hit != null)
    {
    //Calculate the lambda value of the intercept
    Vec3 hitVec = posVec.subtract(hit.hitVec);
    float lambda = 1;
    //Try each co-ordinate one at a time.
    if(motionX != 0)
    lambda = (float)(hitVec.xCoord / motionX);
    else if(motionY != 0)
    lambda = (float)(hitVec.yCoord / motionY);
    else if(motionZ != 0)
    lambda = (float)(hitVec.zCoord / motionZ);
    
    if(lambda < 0)
    lambda = -lambda;
    hits.add(new BlockHit(hit, lambda));
    }
    
    //We hit something
    if(!hits.isEmpty())
    {
    //Sort the hits according to the intercept position
    Collections.sort(hits);
    
    for(BulletHit bulletHit : hits)
    {
    if(bulletHit instanceof DriveableHit)
    {
    DriveableHit driveableHit = (DriveableHit)bulletHit;
    penetratingPower = driveableHit.driveable.bulletHit(this, driveableHit, penetratingPower);
    if(FlansMod.DEBUG)
    worldObj.spawnEntityInWorld(new EntityDebugDot(worldObj, new Vector3f(posX + motionX * driveableHit.intersectTime, posY + motionY * driveableHit.intersectTime, posZ + motionZ * driveableHit.intersectTime), 1000, 0F, 0F, 1F));
    
    }
    else if(bulletHit instanceof PlayerBulletHit)
    {
    PlayerBulletHit playerHit = (PlayerBulletHit)bulletHit;
    penetratingPower = playerHit.hitbox.hitByBullet(this, penetratingPower);
    if(FlansMod.DEBUG)
    worldObj.spawnEntityInWorld(new EntityDebugDot(worldObj, new Vector3f(posX + motionX * playerHit.intersectTime, posY + motionY * playerHit.intersectTime, posZ + motionZ * playerHit.intersectTime), 1000, 1F, 0F, 0F));
    }
    else if(bulletHit instanceof EntityHit)
    {
    EntityHit entityHit = (EntityHit)bulletHit;
    if(entityHit.entity.attackEntityFrom(getBulletDamage(false), damage * type.damageVsLiving) && entityHit.entity instanceof EntityLivingBase)
    {
    EntityLivingBase living = (EntityLivingBase)entityHit.entity;
    for(PotionEffect effect : type.hitEffects)
    {
    living.addPotionEffect(new PotionEffect(effect));
    }
    //If the attack was allowed, we should remove their immortality cooldown so we can shoot them again. Without this, any rapid fire gun become useless
    living.arrowHitTimer++;
    living.hurtResistantTime = living.maxHurtResistantTime / 2;
    }
    if(type.setEntitiesOnFire)
    entityHit.entity.setFire(20);
    penetratingPower -= 1F;
    if(FlansMod.DEBUG)
    worldObj.spawnEntityInWorld(new EntityDebugDot(worldObj, new Vector3f(posX + motionX * entityHit.intersectTime, posY + motionY * entityHit.intersectTime, posZ + motionZ * entityHit.intersectTime), 1000, 1F, 1F, 0F));
    }
    else if(bulletHit instanceof BlockHit)
    {
    BlockHit blockHit = (BlockHit)bulletHit;
    MovingObjectPosition raytraceResult = blockHit.raytraceResult;
    //If the hit wasn't an entity hit, then it must've been a block hit
    int xTile = raytraceResult.blockX;
    int yTile = raytraceResult.blockY;
    int zTile = raytraceResult.blockZ;
    if(FlansMod.DEBUG)
    worldObj.spawnEntityInWorld(new EntityDebugDot(worldObj, new Vector3f(raytraceResult.hitVec.xCoord, raytraceResult.hitVec.yCoord, raytraceResult.hitVec.zCoord), 1000, 0F, 1F, 0F));
    
    Block block = worldObj.getBlock(xTile, yTile, zTile);
    Material mat = block.getMaterial();
    //If the bullet breaks glass, and can do so according to FlansMod, do so.
    if(type.breaksGlass && mat == Material.glass)
    {
    if(TeamsManager.canBreakGlass)
                            {
                                worldObj.setBlockToAir(xTile, yTile, zTile);
                                FlansMod.proxy.playBlockBreakSound(xTile, yTile, zTile, block);
                            }
    }
    
    //penetratingPower -= block.getBlockHardness(worldObj, zTile, zTile, zTile);
    setPosition(hit.hitVec.xCoord, hit.hitVec.yCoord, hit.hitVec.zCoord);
    setDead();
    break;
    }
    if(penetratingPower <= 0F || (type.explodeOnImpact && ticksInAir > 1))
    {
    setPosition(posX + motionX * bulletHit.intersectTime, posY + motionY * bulletHit.intersectTime, posZ + motionZ * bulletHit.intersectTime);
    setDead();
    break;
    }
    
    }
    
    }
    //Otherwise, do a standard check for uninteresting entities
    
    else
    {
    //Iterate over entities close to the bullet to see if any of them have been hit and hit them
    List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(type.hitBoxSize, type.hitBoxSize, type.hitBoxSize));
    for (int l = 0; l < list.size(); l++)
    {
    Entity checkEntity = (Entity) list.get(l);
    //Driveable collisions are handled earlier
    if(checkEntity instanceof EntityDriveable)
    continue;
    
    if(checkEntity instanceof EntityPlayer)
    continue;
    
    //Stop the bullet hitting stuff that can't be collided with or the person shooting immediately after firing it
    if((!checkEntity.canBeCollidedWith() || isPartOfOwner(checkEntity)) && ticksInAir < 20)
    {
    continue;
    }
    
    //Calculate the hit damage
    float hitDamage = damage * type.damageVsLiving;
    //Create a damage source object
    DamageSource damagesource = owner == null ? DamageSource.generic : getBulletDamage(false);
    
    //When the damage is 0 (such as with Nerf guns) the entityHurt Forge hook is not called, so this hacky thing is here
    if(hitDamage == 0 && checkEntity instanceof EntityPlayerMP && TeamsManager.getInstance().currentRound != null)
    TeamsManager.getInstance().currentRound.gametype.playerAttacked((EntityPlayerMP)checkEntity, damagesource);
    
    //Attack the entity!
    if(checkEntity.attackEntityFrom(damagesource, hitDamage))
    {
    //If the attack was allowed and the entity is alive, we should remove their immortality cooldown so we can shoot them again. Without this, any rapid fire gun become useless
    if (checkEntity instanceof EntityLivingBase)
    {
    ((EntityLivingBase) checkEntity).arrowHitTimer++;
    ((EntityLivingBase) checkEntity).hurtResistantTime = ((EntityLivingBase) checkEntity).maxHurtResistantTime / 2;
    }
    //Yuck.
    //PacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 50, dimension, PacketPlaySound.buildSoundPacket(posX, posY, posZ, type.hitSound, true));
    }
    //Unless the bullet penetrates, kill it
    if(type.penetratingPower > 0)
    {
    setPosition(checkEntity.posX, checkEntity.posY, checkEntity.posZ);
    setDead();
    break;
    }
    }
    }
    
    //Movement dampening variables
    float drag = 0.99F;
    float gravity = 0.02F;
    //If the bullet is in water, spawn particles and increase the drag
    if (isInWater())
    {
    for(int i = 0; i < 4; i++)
    {
    float bubbleMotion = 0.25F;
    worldObj.spawnParticle("bubble", posX - motionX * bubbleMotion, posY - motionY * bubbleMotion, posZ - motionZ * bubbleMotion, motionX, motionY, motionZ);
    }
    drag = 0.8F;
    }
    motionX *= drag;
    motionY *= drag;
    motionZ *= drag;
    motionY -= gravity * type.fallSpeed;
    
    //Apply homing action
    if(lockedOnTo != null)
    {
    double dX = lockedOnTo.posX - posX;
    double dY = lockedOnTo.posY - posY;
    double dZ = lockedOnTo.posZ - posZ;
    double dXYZ = Math.sqrt(dX * dX + dY * dY + dZ * dZ);
    
    Vector3f relPosVec = new Vector3f(lockedOnTo.posX - posX, lockedOnTo.posY - posY, lockedOnTo.posZ - posZ);
    float angle = Math.abs(Vector3f.angle(motion, relPosVec));
    
    double lockOnPull = angle / 2F * type.lockOnForce;
    
    motionX += lockOnPull * dX / dXYZ;
    motionY += lockOnPull * dY / dXYZ;
    motionZ += lockOnPull * dZ / dXYZ;
    } 
    
    //Apply motion
    posX += motionX;
    posY += motionY;
    posZ += motionZ;
    setPosition(posX, posY, posZ);
    
    //Recalculate the angles from the new motion
    float motionXZ = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
    rotationYaw = (float) ((Math.atan2(motionX, motionZ) * 180D) / 3.1415927410125732D);
    rotationPitch = (float) ((Math.atan2(motionY, motionXZ) * 180D) / 3.1415927410125732D);
    //Reset the range of the angles
    for (; rotationPitch - prevRotationPitch < -180F; prevRotationPitch -= 360F){}
    for (; rotationPitch - prevRotationPitch >= 180F; prevRotationPitch += 360F){}
    for (; rotationYaw - prevRotationYaw < -180F; prevRotationYaw -= 360F){}
    for (; rotationYaw - prevRotationYaw >= 180F; prevRotationYaw += 360F){}
    rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F;
    rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F;
    
    //Particles 
    if (type.trailParticles && worldObj.isRemote && ticksInAir > 1)
    {
    spawnParticles();
    }
    
    //Temporary fire glitch fix
    if(worldObj.isRemote)
    extinguish();
    }
    
    @SideOnly(Side.CLIENT)
    private void spawnParticles()
    {
    double dX = (posX - prevPosX) / 10;
    double dY = (posY - prevPosY) / 10;
    double dZ = (posZ - prevPosZ) / 10;
    
    float spread = 0.1F;
    for (int i = 0; i < 10; i++)
    {
    EntityFX particle = FlansModClient.getParticle(type.trailParticleType, worldObj, prevPosX + dX * i + rand.nextGaussian() * spread, prevPosY + dY * i + rand.nextGaussian() * spread, prevPosZ + dZ * i + rand.nextGaussian() * spread);
    if(particle != null && Minecraft.getMinecraft().gameSettings.fancyGraphics)
    particle.renderDistanceWeight = 100D;
    //worldObj.spawnEntityInWorld(particle);
    }
    }
    
    public DamageSource getBulletDamage(boolean headshot)
    {
    if(owner instanceof EntityPlayer)
    return (new EntityDamageSourceGun(type.shortName, this, (EntityPlayer)owner, firedFrom, headshot)).setProjectile();
    else return (new EntityDamageSourceIndirect(type.shortName, this, owner)).setProjectile();
    }
    
    private boolean isPartOfOwner(Entity entity) {
    if (owner == null)
    return false;
    if (entity == owner || entity == owner.riddenByEntity || entity == owner.ridingEntity)
    return true;
    if (owner instanceof EntityPlayer) {
    if (PlayerHandler.getPlayerData((EntityPlayer) owner, worldObj.isRemote ? Side.CLIENT : Side.SERVER) == null)
    return false;
    EntityMG mg = PlayerHandler.getPlayerData((EntityPlayer) owner, worldObj.isRemote ? Side.CLIENT : Side.SERVER).mountingGun;
    if (mg != null && mg == entity) {
    return true;
    }
    }
    return owner.ridingEntity instanceof EntitySeat && (((EntitySeat) owner.ridingEntity).driveable == null || ((EntitySeat) owner.ridingEntity).driveable.isPartOfThis(entity));
    }
    
    @Override
    public void setDead()
    {
    if (isDead)
    return;
    super.setDead();
    if(worldObj.isRemote)
    return;
    if(type.explosionRadius > 0)
    {
           if(owner instanceof EntityPlayer)
            new FlansModExplosion(worldObj, this, (EntityPlayer)owner, firedFrom, posX, posY, posZ, type.explosionRadius, TeamsManager.explosions);
           else worldObj.createExplosion(this, posX, posY, posZ, type.explosionRadius, TeamsManager.explosions);
    }
    if(type.fireRadius > 0)
    {
    for(float i = -type.fireRadius; i < type.fireRadius; i++)
    {
    for(float k = -type.fireRadius; k < type.fireRadius; k++)
    {
    for(int j = -1; j < 1; j++)
    {
    if (worldObj.getBlock((int)(posX + i), (int)(posY + j), (int)(posZ + k)).getMaterial() == Material.air)
    {
    worldObj.setBlock((int)(posX + i), (int)(posY + j), (int)(posZ + k), Blocks.fire);
    }
    }
    }
    }
    }
    //Send flak packet
    if(type.flak > 0)
    FlansMod.getPacketHandler().sendToAllAround(new PacketFlak(posX, posY, posZ, type.flak, type.flakParticles), posX, posY, posZ, 200, dimension);
    // Drop item on hitting if bullet requires it
    if (type.dropItemOnHit != null)
    {
    String itemName = type.dropItemOnHit;
    int damage = 0;
    if (itemName.contains("."))
    {
    damage = Integer.parseInt(itemName.split("\\.")[1]);
    itemName = itemName.split("\\.")[0];
    }
    ItemStack dropStack = InfoType.getRecipeElement(itemName, damage);
    entityDropItem(dropStack, 1.0F);
    }
    }
    
    @Override
    public void writeEntityToNBT(NBTTagCompound tag)
    {
    tag.setString("type", type.shortName);
    if (owner == null)
    tag.setString("owner", "null");
    else
    tag.setString("owner", owner.getCommandSenderName());
    }
    
    @Override
    public void readEntityFromNBT(NBTTagCompound tag)
    {
    String typeString = tag.getString("type");
    String ownerName = tag.getString("owner");
    
    if (typeString != null)
    type = BulletType.getBullet(typeString);
    
    if (ownerName != null && !ownerName.equals("null"))
    owner = FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().func_152612_a(ownerName);
    }
    
    @Override
    public float getShadowSize()
    {
    return type.hitBoxSize;
    }
    
    public int getBrightnessForRender(float par1)
    {
    if(type.hasLight)
    {
    return 15728880;
    }
    else
    {
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.posZ);
    
    if (this.worldObj.blockExists(i, 0, j))
    {
    double d0 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
    int k = MathHelper.floor_double(this.posY - (double)this.yOffset + d0);
    return this.worldObj.getLightBrightnessForSkyBlocks(i, k, j, 0);
    }
    else
    {
    return 0;
    }
    }
    }
    
    @Override
    public void writeSpawnData(ByteBuf data) 
    {
    data.writeDouble(motionX);
    data.writeDouble(motionY);
    data.writeDouble(motionZ);
    data.writeInt(lockedOnTo == null ? -1 : lockedOnTo.getEntityId());
    ByteBufUtils.writeUTF8String(data, type.shortName);
    if (owner == null)
    ByteBufUtils.writeUTF8String(data, "null");
    else
    ByteBufUtils.writeUTF8String(data, owner.getCommandSenderName());
    }
    
    @Override
    public void readSpawnData(ByteBuf data) 
    {
    try
    {
    motionX = data.readDouble();
    motionY = data.readDouble();
    motionZ = data.readDouble();
    int lockedOnToID = data.readInt();
    if(lockedOnToID != -1)
    lockedOnTo = worldObj.getEntityByID(lockedOnToID);
    type = BulletType.getBullet(ByteBufUtils.readUTF8String(data));
    penetratingPower = type.penetratingPower;
    String name = ByteBufUtils.readUTF8String(data);
    for(Object obj : worldObj.loadedEntityList)
    {
    if(((Entity)obj).getCommandSenderName().equals(name))
    owner = (EntityPlayer)obj;
    }
    }
    catch(Exception e)
    {
    FlansMod.log("Failed to read bullet owner from server.");
    super.setDead();
    e.printStackTrace();
    }
    }
    
    @Override
        public boolean isBurning()
        {
        return false;
        }
    }
    
    

    Voilà voilà et je ne vois pas d'où ça vient 😕 merci de votre aide ! 🙂

    Bonne soirée</bullethit></bullethit></bullethit></bullethit>


  • Administrateurs

    PlayerSnapshot snapshot = data.snapshots[snapshotToTry];
    Le problème est ici
    Pourtant au dessus il y a déjà ce qu'il faut pour éviter un OOBE :
    int snapshotToTry = pingOfShooter / 50;
    if(snapshotToTry >= data.snapshots.length)
    snapshotToTry = data.snapshots.length - 1;

    étrange …



  • J'ai aussi ça comme crash 😕 ça pourrait venir d'où ?

    –-- Minecraft Crash Report ----
    // Oops.

    Time: 21/11/15 16:46
    Description: Exception in server tick loop

    java.lang.IllegalArgumentException: Don't know how to add class com.flansmod.common.driveables.EntityVehicle! Report this error to mod author.
    at net.minecraft.entity.EntityTrackerEntry.func_151260_c(EntityTrackerEntry.java:717)
    at net.minecraft.entity.EntityTrackerEntry.func_73117_b(EntityTrackerEntry.java:434)
    at net.minecraft.entity.EntityTrackerEntry.func_73125_b(EntityTrackerEntry.java:555)
    at net.minecraft.entity.EntityTrackerEntry.func_73122_a(EntityTrackerEntry.java:131)
    at net.minecraft.entity.EntityTracker.func_72788_a(EntityTracker.java:276)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:978)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669)
    at java.lang.Thread.run(Unknown Source)

    A detailed walkthrough of the error, its code path and all known details is as follows:

    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    KCauldron Version: pw.prok:KCauldron:1.7.10-1492.155
    Operating System: Windows Server 2012 R2 (amd64) version 6.3
    Java Version: 1.8.0_65, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 1651933472 bytes (1575 MB) / 3268935680 bytes (3117 MB) up to 4772593664 bytes (4551 MB)
    JVM Flags: 2 total; -Xms3G -Xmx5G
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 103
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1492 11 mods loaded, 11 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
    UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (OpenMod-Prov2.jar)
    UCHIJAAAA Forge{10.13.4.1492} [Minecraft Forge] (OpenMod-Prov2.jar)
    UCHIJAAAA kimagine{0.1} [KImagine] (minecraft.jar)
    UCHIJAAAA CarpentersBlocks{0.0.1 Beta} [AltisCraft.fr] (AltisCraft.fr.jar)
    UCHIJAAAA flansmod{@VERSION@} [Flan's Mod] (AltisCraft.fr.jar)
    UCHIJAAAA thirstmod{1.8.14} [Thirst Mod] (AltisCraft.fr.jar)
    UCHIJAAAA t4pro{1.0.1} [Project] (AltisCraft.fr.jar)
    UCHIJAAAA altiscraft.MODID{1.0.0} [AltisCraft.fr] (AltisCraft.fr.jar)
    UCHIJAAAA Backpack{2.0.1} [Backpack] (backpack-2.0.1-1.7.x.jar)
    UCHIJAAAA gvc{0.6.1} [§aGliby's§f Voice Chat Mod] (GlibysVC-1.7.10-0.6.1.jar)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Player Count: 35 / 100; [EntityPlayerMP['stevrow'/15064, l='AltisCraft', x=-8501,70, y=33,00, z=-3629,98](stevrow at -8501.697402850064,33.0,-3629.982429043685), EntityPlayerMP['Camille955'/26979, l='AltisCraft', x=-8381,62, y=52,00, z=-3649,42](Camille955 at -8381.624723366791,52.0,-3649.415023742573), EntityPlayerMP['Caenais14'/32674, l='AltisCraft', x=-8511,83, y=33,00, z=-3752,77](Caenais14 at -8511.827425401048,33.0,-3752.7672523847627), EntityPlayerMP['Carlos_Corleone'/35186, l='AltisCraft', x=-1076,15, y=36,20, z=-1792,89](Carlos_Corleone at -1076.1475669632446,36.19929223310326,-1792.8891046971848), EntityPlayerMP['creeper'/36535, l='AltisCraft', x=-8373,00, y=55,40, z=-3890,35](creeper at -8372.999822989106,55.39596635103226,-3890.352693967521), EntityPlayerMP['ZxZelKer'/39081, l='AltisCraft', x=-2472,09, y=82,00, z=-7877,03](ZxZelKer at -2472.0857054122016,82.0,-7877.030684004877), EntityPlayerMP['Leo_Gourichon'/40753, l='AltisCraft', x=-8511,54, y=33,31, z=-3775,23](Leo_Gourichon at -8511.540231718645,33.312515154480934,-3775.2334321422845), EntityPlayerMP['THE_KILLER_80'/40785, l='AltisCraft', x=-8322,49, y=33,00, z=-3678,94](THE_KILLER_80 at -8322.485289489947,33.0,-3678.939235236907), EntityPlayerMP['darcklegend'/45850, l='AltisCraft', x=-8538,30, y=32,88, z=-3707,84](darcklegend at -8538.304259274528,32.880603298544884,-3707.8398011352865), EntityPlayerMP['FranceTVT'/45882, l='AltisCraft', x=-8591,91, y=16,48, z=-3335,45](FranceTVT at -8591.909029230477,16.480710876331692,-3335.4470198959166), EntityPlayerMP['Garflid'/45885, l='AltisCraft', x=-8304,16, y=56,00, z=-3873,89](Garflid at -8304.158717601325,56.0,-3873.892873190474), EntityPlayerMP['MyFuriax87'/45887, l='AltisCraft', x=-8552,38, y=33,00, z=-3754,77](MyFuriax87 at -8552.379875185456,33.0,-3754.7678463125994), EntityPlayerMP['Gvrvnce'/46343, l='AltisCraft', x=-8492,91, y=33,00, z=-3660,93](Gvrvnce at -8492.905272755108,33.0,-3660.9326935943664), EntityPlayerMP['Doggimaul78'/46364, l='AltisCraft', x=-8541,46, y=33,00, z=-3749,80](Doggimaul78 at -8541.463975524479,33.0,-3749.7971111456013), EntityPlayerMP['Chris065'/46365, l='AltisCraft', x=-8501,24, y=33,00, z=-3780,36](Chris065 at -8501.235591617398,33.0,-3780.3585970626805), EntityPlayerMP['Joe_Leroi'/46378, l='AltisCraft', x=-8515,70, y=39,00, z=-3759,07](Joe_Leroi at -8515.699999988079,39.0,-3759.0734599960856), EntityPlayerMP['Skraye'/46370, l='AltisCraft', x=-8336,70, y=34,00, z=-3653,21](Skraye at -8336.699999988079,34.0,-3653.2090889550855), EntityPlayerMP['corentin'/46379, l='AltisCraft', x=-8439,98, y=33,00, z=-3946,74](corentin at -8439.97589492195,33.0,-3946.7358071506405), EntityPlayerMP['Jordan1409'/47239, l='AltisCraft', x=-8336,03, y=36,88, z=-3917,28](Jordan1409 at -8336.031051814556,36.875,-3917.27635923028), EntityPlayerMP['Corkito27'/47248, l='AltisCraft', x=-1032,11, y=34,50, z=-1825,83](Corkito27 at -1032.1059029638031,34.5,-1825.8299387130915), EntityPlayerMP['Sleepy'/48963, l='AltisCraft', x=-1027,50, y=30,00, z=-1816,44](Sleepy at -1027.5038971294296,30.0,-1816.4365596221892), EntityPlayerMP['ManiackGoRed'/49342, l='AltisCraft', x=-8508,64, y=33,00, z=-3738,11](ManiackGoRed at -8508.642666912707,33.0,-3738.107536352774), EntityPlayerMP['FaTaL BreeZy'/49849, l='AltisCraft', x=-8503,19, y=33,00, z=-3631,28](FaTaL BreeZy at -8503.186840637747,33.0,-3631.2815268039126), EntityPlayerMP['zoliooxx'/50743, l='AltisCraft', x=-8322,79, y=33,00, z=-3678,39](zoliooxx at -8322.79093688498,33.0,-3678.3946542010817), EntityPlayerMP['CroWsY'/51320, l='AltisCraft', x=-8495,10, y=33,00, z=-3788,70](CroWsY at -8495.099005151038,33.0,-3788.7044657592173), EntityPlayerMP['LytrOx'/51352, l='AltisCraft', x=-1545,05, y=61,00, z=-8440,32](LytrOx at -1545.0470575721627,61.0,-8440.323262494458), EntityPlayerMP['ilann62'/51926, l='AltisCraft', x=-8306,17, y=56,12, z=-3877,49](ilann62 at -8306.167365925721,56.12464341963641,-3877.493072407194), EntityPlayerMP['Qyulox'/53356, l='AltisCraft', x=-8508,97, y=33,00, z=-3756,91](Qyulox at -8508.968092471963,33.0,-3756.905418620542), EntityPlayerMP['Misquinex'/53851, l='AltisCraft', x=-3446,01, y=21,30, z=-2789,17](Misquinex at -3446.0082653053964,21.299045507692206,-2789.1671450560925), EntityPlayerMP['Nathan33230'/54360, l='AltisCraft', x=-2671,36, y=51,50, z=-3628,05](Nathan33230 at -2671.3623325875524,51.5,-3628.05439945763), EntityPlayerMP['Theo_Brocard'/54368, l='AltisCraft', x=-8447,96, y=33,75, z=-3949,17](Theo_Brocard at -8447.96182977477,33.7531999805212,-3949.168594837368), EntityPlayerMP['minibuz77'/54971, l='AltisCraft', x=-2485,91, y=89,00, z=-7860,70](minibuz77 at -2485.9131078180744,89.0,-7860.699999988079), EntityPlayerMP['mckevin22'/55453, l='AltisCraft', x=-8496,28, y=33,00, z=-3787,29](mckevin22 at -8496.281171474919,33.0,-3787.294560100931), EntityPlayerMP['docquoy'/55455, l='AltisCraft', x=-8530,35, y=33,00, z=-3763,18](docquoy at -8530.351611174594,33.0,-3763.1847106942746), EntityPlayerMP['Jean_Vien'/46871, l='AltisCraft', x=0,50, y=99,02, z=0,50](Jean_Vien at 0.5,99.01999998092649,0.5)]
    Is Modded: Definitely; Server brand changed to 'kcauldron,cauldron,craftbukkit,mcpc,fml,forge'
    Type: Dedicated Server (map_server.txt)


  • Administrateurs



  • Comment je peux le patch alors ? 😕 ps: merci beaucoup ! 🙂


  • Administrateurs

    Il faudrait une version modifié de Kcauldron qui ne contient pas cette partie du patch.
    (ou alors comprendre l'entité de flan's mod se retrouve dans cette condition).



  • Je vois, j'ai le code de Flan's Mod, serait-il possible de le modifier pour résoudre le problème ?


  • Administrateurs

    Le problème semble venir du fait que l'entité n'est pas enregistré.
    Donc il faudrait juste ajouter un EntityRegistry.registerModEntity



  • Juste y a une erreur à la ligne 128 où je l'ai mis dans le clientProxy, voici la classe:

    (l'erreur est registerModEntity cannot be resolved or is not a field) 😕

    package com.flansmod.client;
    
    import java.io.File;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    
    import org.lwjgl.input.Keyboard;
    import org.lwjgl.input.Mouse;
    
    import com.flansmod.client.debug.EntityDebugAABB;
    import com.flansmod.client.debug.EntityDebugDot;
    import com.flansmod.client.debug.EntityDebugVector;
    import com.flansmod.client.debug.RenderDebugAABB;
    import com.flansmod.client.debug.RenderDebugDot;
    import com.flansmod.client.debug.RenderDebugVector;
    import com.flansmod.client.gui.GuiArmourBox;
    import com.flansmod.client.gui.GuiDriveableCrafting;
    import com.flansmod.client.gui.GuiDriveableFuel;
    import com.flansmod.client.gui.GuiDriveableInventory;
    import com.flansmod.client.gui.GuiDriveableMenu;
    import com.flansmod.client.gui.GuiDriveableRepair;
    import com.flansmod.client.gui.GuiGunBox;
    import com.flansmod.client.gui.GuiGunModTable;
    import com.flansmod.client.gui.GuiMechaInventory;
    import com.flansmod.client.model.RenderAAGun;
    import com.flansmod.client.model.RenderBullet;
    import com.flansmod.client.model.RenderFlag;
    import com.flansmod.client.model.RenderFlagpole;
    import com.flansmod.client.model.RenderGrenade;
    import com.flansmod.client.model.RenderGun;
    import com.flansmod.client.model.RenderMG;
    import com.flansmod.client.model.RenderMecha;
    import com.flansmod.client.model.RenderNull;
    import com.flansmod.client.model.RenderParachute;
    import com.flansmod.client.model.RenderPlane;
    import com.flansmod.client.model.RenderVehicle;
    import com.flansmod.common.CommonProxy;
    import com.flansmod.common.FlansMod;
    import com.flansmod.common.driveables.DriveablePart;
    import com.flansmod.common.driveables.DriveableType;
    import com.flansmod.common.driveables.EntityDriveable;
    import com.flansmod.common.driveables.EntityPlane;
    import com.flansmod.common.driveables.EntitySeat;
    import com.flansmod.common.driveables.EntityVehicle;
    import com.flansmod.common.driveables.EntityWheel;
    import com.flansmod.common.driveables.PlaneType;
    import com.flansmod.common.driveables.VehicleType;
    import com.flansmod.common.driveables.mechas.EntityMecha;
    import com.flansmod.common.driveables.mechas.MechaType;
    import com.flansmod.common.guns.EntityAAGun;
    import com.flansmod.common.guns.EntityBullet;
    import com.flansmod.common.guns.EntityGrenade;
    import com.flansmod.common.guns.EntityMG;
    import com.flansmod.common.guns.GrenadeType;
    import com.flansmod.common.guns.GunType;
    import com.flansmod.common.guns.boxes.BlockGunBox;
    import com.flansmod.common.guns.boxes.GunBoxType;
    import com.flansmod.common.network.PacketBuyArmour;
    import com.flansmod.common.network.PacketBuyWeapon;
    import com.flansmod.common.network.PacketCraftDriveable;
    import com.flansmod.common.network.PacketRepairDriveable;
    import com.flansmod.common.teams.ArmourBoxType;
    import com.flansmod.common.teams.BlockArmourBox;
    import com.flansmod.common.teams.EntityFlag;
    import com.flansmod.common.teams.EntityFlagpole;
    import com.flansmod.common.teams.TileEntitySpawner;
    import com.flansmod.common.tools.EntityParachute;
    
    import cpw.mods.fml.client.FMLClientHandler;
    import cpw.mods.fml.client.registry.ClientRegistry;
    import cpw.mods.fml.client.registry.RenderingRegistry;
    import cpw.mods.fml.common.FMLCommonHandler;
    import cpw.mods.fml.common.FMLModContainer;
    import cpw.mods.fml.common.MetadataCollection;
    import cpw.mods.fml.common.discovery.ContainerType;
    import cpw.mods.fml.common.discovery.ModCandidate;
    import cpw.mods.fml.common.registry.EntityRegistry;
    import net.minecraft.client.Minecraft;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.util.ChatComponentText;
    import net.minecraft.world.World;
    import net.minecraftforge.client.MinecraftForgeClient;
    
    public class ClientProxy extends CommonProxy
    {
    public static String modelDir = "com.flansmod.client.model.";
    
    /* These renderers handle rendering in hand items */
    public static RenderGun gunRenderer;
    public static RenderGrenade grenadeRenderer;
    public static RenderPlane planeRenderer;
    public static RenderVehicle vehicleRenderer;
    public static RenderMecha mechaRenderer;
    
    /** The file locations of the content packs, used for loading */
    public List <file>contentPacks;
    
    @Override
    public void load()
    {
    new FlansModClient().load();
    gunRenderer = new RenderGun();
    grenadeRenderer = new RenderGrenade();
    planeRenderer = new RenderPlane();
    vehicleRenderer = new RenderVehicle();
    mechaRenderer = new RenderMecha();
    
    //Register custom item renderers
    for(GunType gunType : GunType.guns.values())
    MinecraftForgeClient.registerItemRenderer(gunType.item, gunRenderer);
    
    for(GrenadeType grenadeType : GrenadeType.grenades)
    MinecraftForgeClient.registerItemRenderer(grenadeType.item, grenadeRenderer);
    
    for(PlaneType planeType : PlaneType.types)
    MinecraftForgeClient.registerItemRenderer(planeType.item, planeRenderer);
    
    for(VehicleType vehicleType : VehicleType.types)
    MinecraftForgeClient.registerItemRenderer(vehicleType.item, vehicleRenderer);
    
    for(MechaType mechaType : MechaType.types)
    MinecraftForgeClient.registerItemRenderer(mechaType.item, mechaRenderer);
    
    FMLCommonHandler.instance().bus().register(new KeyInputHandler());
    new TickHandlerClient();
    EntityRegistry.registerModEntity;
    }
    
    /** This method reloads all textures from all mods and resource packs. It forces Minecraft to read images from the content packs added after mod init */
    @Override
    public void forceReload()
    {
    Minecraft.getMinecraft().refreshResources();
    }
    
    /** This method grabs all the content packs and puts them in a list. The client side part registers them as FMLModContainers which adds their resources to the game after a refresh */
    @Override
    public List <file>getContentList(Method method, ClassLoader classloader)
    {
    contentPacks = new ArrayList<file>();
    for (File file : FlansMod.flanDir.listFiles())
    {
    if (file.isDirectory() || zipJar.matcher(file.getName()).matches())
    {
    try
    {
    method.invoke(classloader, file.toURI().toURL());
    
    HashMap <string, object="">map = new HashMap<string, object="">();
    map.put("modid", "AC");
    map.put("name", "AltisCraft : " + file.getName());
    map.put("version", "1");
    FMLModContainer container = new FMLModContainer("com.flansmod.common.FlansMod", new ModCandidate(file, file, file.isDirectory() ? ContainerType.DIR : ContainerType.JAR), map);
    container.bindMetadata(MetadataCollection.from(null, ""));
    FMLClientHandler.instance().addModAsResource(container);
    
    } catch (Exception e)
    {
    FlansMod.log("Failed to load images for content pack : " + file.getName());
    e.printStackTrace();
    }
    // Add the directory to the content pack list
    FlansMod.log("Loaded content pack : " + file.getName());
    contentPacks.add(file);
    }
    }
    
    FlansMod.log("Loaded textures and models.");
    return contentPacks;
    }
    
    /** Register entity renderers */
    @Override
    public void registerRenderers()
    {
    RenderingRegistry.registerEntityRenderingHandler(EntityBullet.class, new RenderBullet());
    RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade());
    RenderingRegistry.registerEntityRenderingHandler(EntityPlane.class, new RenderPlane());
    RenderingRegistry.registerEntityRenderingHandler(EntityVehicle.class, new RenderVehicle());
    RenderingRegistry.registerEntityRenderingHandler(EntityAAGun.class, new RenderAAGun());
    RenderingRegistry.registerEntityRenderingHandler(EntityFlagpole.class, new RenderFlagpole());
    RenderingRegistry.registerEntityRenderingHandler(EntityFlag.class, new RenderFlag());
    RenderingRegistry.registerEntityRenderingHandler(EntitySeat.class, new RenderNull());
    RenderingRegistry.registerEntityRenderingHandler(EntityWheel.class, new RenderNull());
    RenderingRegistry.registerEntityRenderingHandler(EntityMG.class, new RenderMG());
    RenderingRegistry.registerEntityRenderingHandler(EntityParachute.class, new RenderParachute());
    RenderingRegistry.registerEntityRenderingHandler(EntityDebugDot.class, new RenderDebugDot());
    RenderingRegistry.registerEntityRenderingHandler(EntityDebugVector.class, new RenderDebugVector());
    RenderingRegistry.registerEntityRenderingHandler(EntityDebugAABB.class, new RenderDebugAABB());
    RenderingRegistry.registerEntityRenderingHandler(EntityMecha.class, new RenderMecha());
    
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySpawner.class, new TileEntitySpawnerRenderer());
    }
    
    /** Adds the client side text message regarding mouse control mode switching */
    @Override
    public void changeControlMode(EntityPlayer player)
    {
    if(FlansModClient.flipControlMode())
    player.addChatComponentMessage(new ChatComponentText("Le mode de contrôle est maintenant " + FlansModClient.controlModeMouse));
    }
    
    /** Whether the player is in mouse control mode for planes. Now the default setting for planes, but it can be deactivated to look around while flying */
    @Override
    public boolean mouseControlEnabled()
    {
    return FlansModClient.controlModeMouse;
    }
    
    /** Client GUI object getter */
    @Override
    public Object getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
    //Null riding entity, don't open GUI in this case
    if(((ID >= 6 && ID <= 10) || ID == 12) && player.ridingEntity == null) return null;
    
    switch(ID) 
    {
    case 0: return new GuiDriveableCrafting(player.inventory, world, x, y, z);
    case 1: return new GuiDriveableRepair(player);
    case 2: return new GuiGunModTable(player.inventory, world);
    case 5: return new GuiGunBox(player.inventory, ((BlockGunBox)world.getBlock(x, y, z)).type);
    case 6: return new GuiDriveableInventory(player.inventory, world, ((EntitySeat)player.ridingEntity).driveable, 0);
    case 7: return new GuiDriveableInventory(player.inventory, world, ((EntitySeat)player.ridingEntity).driveable, 1);
    case 8: return new GuiDriveableFuel (player.inventory, world, ((EntitySeat)player.ridingEntity).driveable);
    case 9: return new GuiDriveableInventory(player.inventory, world, ((EntitySeat)player.ridingEntity).driveable, 2);
    case 10: return new GuiMechaInventory (player.inventory, world, (EntityMecha)((EntitySeat)player.ridingEntity).driveable);
    case 11: return new GuiArmourBox(player.inventory, ((BlockArmourBox)world.getBlock(x, y, z)).type);
    case 12: return new GuiDriveableInventory(player.inventory, world, ((EntitySeat)player.ridingEntity).driveable, 3);
    }
    return null;
    }
    
    /** Called when the player presses the plane inventory key. Opens menu client side */
    @Override
    public void openDriveableMenu(EntityPlayer player, World world, EntityDriveable driveable)
    {
    FMLClientHandler.instance().getClient().displayGuiScreen(new GuiDriveableMenu(player.inventory, world, driveable));
    }
    
    /** Helper method that sorts out packages with model name input
    * For example, the model class "com.flansmod.client.model.mw.ModelMP5"
    * is referenced in the type file by the string "mw.MP5" */
    private String getModelName(String in)
    {
    //Split about dots
    String[] split = in.split("\\.");
    //If there is no dot, our model class is in the default model package
    if(split.length == 1)
    return "Model" + in;
    //Otherwise, we need to slightly rearrange the wording of the string for it to make sense
    else if(split.length > 1)
    {
    String out = "Model" + split[split.length - 1];
    for(int i = split.length - 2; i >= 0; i–)
    {
    out = split* + "." + out;
    }
    return out;
    }
    return in;
    }
    
    /** Generic model loader method for getting model classes and casting them to the required class type */
    @Override
    public <t>T loadModel(String s, String shortName, Class <t>typeClass)
    {
    if(s == null || shortName == null)
    return null;
    try 
    {
    return typeClass.cast(Class.forName(modelDir + getModelName(s)).getConstructor().newInstance());
    }
    catch(Exception e)
    {
    FlansMod.log("Failed to load model : " + shortName + " (" + s + ")");
    e.printStackTrace();
    }
    return null;
    }
    
    /** Sound loading method. Defers to FlansModResourceHandler */
    @Override
    public void loadSound(String contentPack, String type, String sound)
    {
    FlansModResourceHandler.getSound(sound);
    //FMLClientHandler.instance().getClient().installResource("sound3/" + type + "/" + sound + ".ogg", new File(FMLClientHandler.instance().getClient().mcDataDir, "/Flan/" + contentPack + "/sounds/" + sound + ".ogg"));
    }
    
    /** Checks whether "player" is the current player. Always false on server, since there is no current player */
    @Override
    public boolean isThePlayer(EntityPlayer player)
    {
    return player == FMLClientHandler.instance().getClient().thePlayer;
    }
    
    /* Gun and armour box crafting methods */
    @Override
    public void buyGun(GunBoxType type, int gun)
    {
    FlansMod.getPacketHandler().sendToServer(new PacketBuyWeapon(type, 0, gun));
    FlansModClient.shootTimeLeft = FlansModClient.shootTimeRight = 10;
    }
    
    @Override
    public void buyAmmo(GunBoxType box, int ammo, int type)
    {
    FlansMod.getPacketHandler().sendToServer(new PacketBuyWeapon(box, type, ammo));
    FlansModClient.shootTimeLeft = FlansModClient.shootTimeRight = 10;
    }
    
    @Override
    public void buyArmour(String shortName, int piece, ArmourBoxType box)
    {
    FlansMod.getPacketHandler().sendToServer(new PacketBuyArmour(box.shortName, shortName, piece));
    FlansModClient.shootTimeLeft = FlansModClient.shootTimeRight = 10;
    }
    
    @Override
    public void craftDriveable(EntityPlayer player, DriveableType type)
    {
    //Craft it this side (so the inventory updates immediately) and then send a packet to the server so that it is crafted that side too
    super.craftDriveable(player, type);
    if(player.worldObj.isRemote)
    FlansMod.getPacketHandler().sendToServer(new PacketCraftDriveable(type.shortName));
    }
    
    @Override
    public void repairDriveable(EntityPlayer driver, EntityDriveable driving, DriveablePart part)
    {
    //Repair it this side (so the inventory updates immediately) and then send a packet to the server so that it is repaired that side too
    super.repairDriveable(driver, driving, part);
    if(driver.worldObj.isRemote)
    FlansMod.getPacketHandler().sendToServer(new PacketRepairDriveable(part.type));
    }
    
    /** Helper method that returns whether there is a GUI open */
    @Override
    public boolean isScreenOpen()
    {
    return Minecraft.getMinecraft().currentScreen != null;
    }
    
    /** Mecha input getters */
    @Override
    public boolean isKeyDown(int key)
    {
    switch(key)
    {
    case 0 : //Press Forwards
    return keyDown(Minecraft.getMinecraft().gameSettings.keyBindForward.getKeyCode());
    
    case 1 : //Press Backwards
    return keyDown(Minecraft.getMinecraft().gameSettings.keyBindBack.getKeyCode()); 
    
    case 2 : //Press Left
    return keyDown(Minecraft.getMinecraft().gameSettings.keyBindLeft.getKeyCode());
    
    case 3 : //Press Right
    return keyDown(Minecraft.getMinecraft().gameSettings.keyBindRight.getKeyCode()); 
    
    case 4 : //Press Jump
    return keyDown(Minecraft.getMinecraft().gameSettings.keyBindJump.getKeyCode());
    }
    return false;
    }
    
    /** Helper method that deals with the way Minecraft handles binding keys to the mouse */
    @Override
    public boolean keyDown(int keyCode)
    {
      boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
        return state;
    }
    }
    
    ```</t></t></string,></string,></file></file></file>

  • Administrateurs

    C'est une blague ?

    1. Pourquoi tu mets ça dans le client proxy ?
    2. TU CROIS VRAIMENT QUE ÇA VA FONCTIONNER SANS PRÉCISER QUELLE ENTITÉ ENREGISTRER !?!?!

    https://openclassrooms.com/courses/apprenez-a-programmer-en-java
    https://openclassrooms.com/courses/apprenez-a-programmer-en-java
    https://openclassrooms.com/courses/apprenez-a-programmer-en-java
    https://openclassrooms.com/courses/apprenez-a-programmer-en-java
    https://openclassrooms.com/courses/apprenez-a-programmer-en-java
    https://openclassrooms.com/courses/apprenez-a-programmer-en-java

    La programmation c'est de la logique, pas des bouts de code copier/coller sans qu'on comprenne ce que ce code fait …



  • Bon le voilà dans le FlansMod.java (classe principale), j'avais oublié qu'on devait mettre ça là-dedans et du coup je me retrouve avec ça :

    EntityRegistry.registerModEntity(entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates);

    bon c'est censé ressemblez à quelque chose comme ça met je ne suis pas sur pour l'entityName, l'id doit bien y avoir une méthode pour trouver un de libre non ? et le updateFrequency c'est tout les ticks ou secondes ? et ça voudrait dire quoi sendsVelocityUpdates ?

    EntityRegistry.registerModEntity(EntityBullet.class, "bullet", 48552, FlansMod.INSTANCE, 300, 1, sendsVelocityUpdates);



  • entityName a peu d'importance
    pour l'id -> http://www.minecraftforgefrance.fr/showthread.php?tid=648#classe3
    updatefrequency est très certainement en ticks
    sendsVelocityUpdate indique si l'entité doit recevoir des mises à jours de vélocité (donc si l'entité est soumise à la gravité il faut mettre true)



  • Oké merci beaucoup je vais tester 🙂



  • Toujours le même problème avec code classe de FlansMod:

    package com.flansmod.common;
    
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    import java.util.zip.ZipInputStream;
    
    import com.flansmod.common.driveables.EntityPlane;
    import com.flansmod.common.driveables.EntitySeat;
    import com.flansmod.common.driveables.EntityVehicle;
    import com.flansmod.common.driveables.EntityWheel;
    import com.flansmod.common.driveables.ItemPlane;
    import com.flansmod.common.driveables.ItemVehicle;
    import com.flansmod.common.driveables.PlaneType;
    import com.flansmod.common.driveables.VehicleType;
    import com.flansmod.common.driveables.mechas.EntityMecha;
    import com.flansmod.common.driveables.mechas.ItemMecha;
    import com.flansmod.common.driveables.mechas.ItemMechaAddon;
    import com.flansmod.common.driveables.mechas.MechaItemType;
    import com.flansmod.common.driveables.mechas.MechaType;
    import com.flansmod.common.eventhandlers.PlayerDeathEventListener;
    import com.flansmod.common.guns.AAGunType;
    import com.flansmod.common.guns.AttachmentType;
    import com.flansmod.common.guns.BulletType;
    import com.flansmod.common.guns.EntityAAGun;
    import com.flansmod.common.guns.EntityBullet;
    import com.flansmod.common.guns.EntityGrenade;
    import com.flansmod.common.guns.EntityMG;
    import com.flansmod.common.guns.GrenadeType;
    import com.flansmod.common.guns.GunType;
    import com.flansmod.common.guns.ItemAAGun;
    import com.flansmod.common.guns.ItemAttachment;
    import com.flansmod.common.guns.ItemBullet;
    import com.flansmod.common.guns.ItemGrenade;
    import com.flansmod.common.guns.ItemGun;
    import com.flansmod.common.guns.boxes.BlockGunBox;
    import com.flansmod.common.guns.boxes.GunBoxType;
    import com.flansmod.common.network.PacketHandler;
    import com.flansmod.common.parts.ItemPart;
    import com.flansmod.common.parts.PartType;
    import com.flansmod.common.teams.ArmourBoxType;
    import com.flansmod.common.teams.ArmourType;
    import com.flansmod.common.teams.BlockArmourBox;
    import com.flansmod.common.teams.BlockSpawner;
    import com.flansmod.common.teams.ChunkLoadingHandler;
    import com.flansmod.common.teams.CommandTeams;
    import com.flansmod.common.teams.EntityFlag;
    import com.flansmod.common.teams.EntityFlagpole;
    import com.flansmod.common.teams.EntityGunItem;
    import com.flansmod.common.teams.EntityTeamItem;
    import com.flansmod.common.teams.ItemFlagpole;
    import com.flansmod.common.teams.ItemOpStick;
    import com.flansmod.common.teams.ItemTeamArmour;
    import com.flansmod.common.teams.Team;
    import com.flansmod.common.teams.TeamsManager;
    import com.flansmod.common.teams.TileEntitySpawner;
    import com.flansmod.common.tools.EntityParachute;
    import com.flansmod.common.tools.ItemTool;
    import com.flansmod.common.tools.ToolType;
    import com.flansmod.common.types.EnumType;
    import com.flansmod.common.types.InfoType;
    import com.flansmod.common.types.TypeFile;
    
    import cpw.mods.fml.client.event.ConfigChangedEvent;
    import cpw.mods.fml.common.FMLCommonHandler;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.event.FMLServerStartedEvent;
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    import cpw.mods.fml.common.network.NetworkRegistry;
    import cpw.mods.fml.common.registry.EntityRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.relauncher.Side;
    import fr.altiscraft.altiscraft.common.ModAltisCraft;
    import net.minecraft.block.material.Material;
    import net.minecraft.command.CommandHandler;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.monster.EntitySkeleton;
    import net.minecraft.entity.monster.EntityZombie;
    import net.minecraft.init.Items;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.common.ForgeChunkManager;
    import net.minecraftforge.common.config.Configuration;
    import net.minecraftforge.event.entity.item.ItemTossEvent;
    import net.minecraftforge.event.entity.living.LivingSpawnEvent;
    import net.minecraftforge.event.entity.player.PlayerDropsEvent;
    
    @Mod(modid = FlansMod.MODID, name = "Flan's Mod", version = FlansMod.VERSION, acceptableRemoteVersions = "@ALLOWEDVERSIONS@", guiFactory = "com.flansmod.client.gui.config.ModGuiFactory")
    public class FlansMod
    {
    //Core mod stuff
    public static boolean DEBUG = false;
    public static Configuration configFile;
    public static final String MODID = "flansmod";
    public static final String VERSION = "@VERSION@";
    @Instance(MODID)
    public static FlansMod INSTANCE;
    public static int generalConfigInteger = 32;
    public static String generalConfigString = "Hello!";
    public static boolean addGunpowderRecipe = true;
    public static int teamsConfigInteger = 32;
    public static String teamsConfigString = "Hello!";
    public static boolean teamsConfigBoolean = false;
    @SidedProxy(clientSide = "com.flansmod.client.ClientProxy", serverSide = "com.flansmod.common.CommonProxy")
    public static CommonProxy proxy;
    //A standardised ticker for all bits of the mod to call upon if they need one
    public static int ticker = 0;
    public static long lastTime;
    public static File flanDir;
    public static final float soundRange = 50F;
    public static final float driveableUpdateRange = 200F;
    public static final int numPlayerSnapshots = 20;
    
    public static float armourSpawnRate = 0.25F;
    
    /** The spectator team. Moved here to avoid a concurrent modification error */
    public static Team spectators = new Team("spectators", "Spectators", 0x404040, '7');
    
    //Handlers
    public static final PacketHandler packetHandler = new PacketHandler();
    public static final PlayerHandler playerHandler = new PlayerHandler();
    public static final TeamsManager teamsManager = new TeamsManager();
    public static final CommonTickHandler tickHandler = new CommonTickHandler();
    public static FlansHooks hooks = new FlansHooks();
    
    //Items and creative tabs
    public static BlockFlansWorkbench workbench;
    public static BlockSpawner spawner;
    public static ItemOpStick opStick;
    public static ItemFlagpole flag;
    public static ArrayList <blockgunbox>gunBoxBlocks = new ArrayList<blockgunbox>();
    public static ArrayList <itembullet>bulletItems = new ArrayList<itembullet>();
    public static ArrayList <itemgun>gunItems = new ArrayList<itemgun>();
    public static ArrayList <itemattachment>attachmentItems = new ArrayList<itemattachment>();
    public static ArrayList <itempart>partItems = new ArrayList<itempart>();
    public static ArrayList <itemplane>planeItems = new ArrayList<itemplane>();
    public static ArrayList <itemvehicle>vehicleItems = new ArrayList<itemvehicle>();
    public static ArrayList <itemmechaaddon>mechaToolItems = new ArrayList<itemmechaaddon>();
    public static ArrayList <itemmecha>mechaItems = new ArrayList<itemmecha>();
    public static ArrayList <itemaagun>aaGunItems = new ArrayList<itemaagun>();
    public static ArrayList <itemgrenade>grenadeItems = new ArrayList<itemgrenade>();
    public static ArrayList <itemtool>toolItems = new ArrayList<itemtool>();
    public static ArrayList <itemteamarmour>armourItems = new ArrayList<itemteamarmour>();
    public static ArrayList <blockarmourbox>armourBoxBlocks = new ArrayList<blockarmourbox>();
    
    /** The mod pre-initialiser method */
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    log("Pré-initialisation d'AltisCraft");
    configFile = new Configuration(event.getSuggestedConfigurationFile());
    syncConfig();
    
    //TODO : Load properties
    //configuration = new Configuration(event.getSuggestedConfigurationFile());
    //loadProperties();
    
    flanDir = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/AltisCraft.fr/");
    
    if (!flanDir.exists())
    {
    log("Flan folder not found. Creating empty folder.");
    log("You should get some content packs and put them in the Flan folder.");
    flanDir.mkdirs();
    flanDir.mkdir();
    }
    
    //Set up mod blocks and items
    workbench = (BlockFlansWorkbench)(new BlockFlansWorkbench(1, 0).setCreativeTab(ModAltisCraft.AltisCraft).setBlockName("flansWorkbench").setBlockTextureName("flansWorkbench").setCreativeTab(ModAltisCraft.AltisCraft));
    GameRegistry.registerBlock(workbench, ItemBlockManyNames.class, "flansWorkbench");
    opStick = new ItemOpStick();
    GameRegistry.registerItem(opStick, "opStick", MODID);
    flag = (ItemFlagpole)(new ItemFlagpole().setUnlocalizedName("flagpole").setCreativeTab(ModAltisCraft.AltisCraft));
    GameRegistry.registerItem(flag, "flagpole", MODID);
    spawner = (BlockSpawner)(new BlockSpawner(Material.iron).setBlockName("teamsSpawner").setBlockUnbreakable().setResistance(1000000F));
    GameRegistry.registerBlock(spawner, ItemBlockManyNames.class, "teamsSpawner");
    GameRegistry.registerTileEntity(TileEntitySpawner.class, "teamsSpawner");
    
    EntityRegistry.registerModEntity(EntityBullet.class, "bullet", EntityRegistry.findGlobalUniqueEntityId(), FlansMod.INSTANCE, 300, 1, true);
    
    proxy.registerRenderers();
    
    //Read content packs
    readContentPacks(event);
    
    //Do proxy loading
    proxy.load();
    //Force Minecraft to reload all resources in order to load content pack resources.
    proxy.forceReload();
    
    log("Preinitializing complete.");
    }
    
    /** The mod initialiser method */
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    log("Initialising Flan's Mod.");
    
    //Initialising handlers
    packetHandler.initialise();
    NetworkRegistry.INSTANCE.registerGuiHandler(this, new CommonGuiHandler());
    
    // Recipes
    for (InfoType type : InfoType.infoTypes)
    {
    type.addRecipe();
    }
    if(addGunpowderRecipe)
    {
    ItemStack charcoal = new ItemStack(Items.coal, 1, 1);
    GameRegistry.addShapelessRecipe(new ItemStack(Items.gunpowder), charcoal, charcoal, charcoal, new ItemStack(Items.glowstone_dust));
    }
    log("Loaded recipes.");
    
    //Register teams mod entities
    EntityRegistry.registerGlobalEntityID(EntityFlagpole.class, "Flagpole", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityFlagpole.class, "Flagpole", 93, this, 40, 5, true);
    EntityRegistry.registerGlobalEntityID(EntityFlag.class, "Flag", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityFlag.class, "Flag", 94, this, 40, 5, true);
    EntityRegistry.registerGlobalEntityID(EntityTeamItem.class, "TeamsItem", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityTeamItem.class, "TeamsItem", 97, this, 100, 10000, true);
    EntityRegistry.registerGlobalEntityID(EntityGunItem.class, "GunItem", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityGunItem.class, "GunItem", 98, this, 100, 20, true);
    
    //Register driveables
    EntityRegistry.registerGlobalEntityID(EntityPlane.class, "Plane", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityPlane.class, "Plane", 90, this, 250, 3, false);
    EntityRegistry.registerGlobalEntityID(EntityVehicle.class, "Vehicle", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityVehicle.class, "Vehicle", 95, this, 250, 10, false);
    EntityRegistry.registerGlobalEntityID(EntitySeat.class, "Seat", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntitySeat.class, "Seat", 99, this, 250, 20, false);
    EntityRegistry.registerGlobalEntityID(EntityWheel.class, "Wheel", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityWheel.class, "Wheel", 103, this, 250, 20, false);
    EntityRegistry.registerGlobalEntityID(EntityParachute.class, "Parachute", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityParachute.class, "Parachute", 101, this, 40, 20, false);
    EntityRegistry.registerGlobalEntityID(EntityMecha.class, "Mecha", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityMecha.class, "Mecha", 102, this, 250, 20, false);
    
    //Register bullets and grenades
    //EntityRegistry.registerGlobalEntityID(EntityBullet.class, "Bullet", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 96, this, 40, 100, false);
    EntityRegistry.registerGlobalEntityID(EntityGrenade.class, "Grenade", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityGrenade.class, "Grenade", 100, this, 40, 100, true);
    
    //Register MGs and AA guns
    EntityRegistry.registerGlobalEntityID(EntityMG.class, "MG", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityMG.class, "MG", 91, this, 40, 5, true);
    EntityRegistry.registerGlobalEntityID(EntityAAGun.class, "AAGun", EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(EntityAAGun.class, "AAGun", 92, this, 40, 500, false);
    
    //Register the chunk loader
    //TODO : Re-do chunk loading
    ForgeChunkManager.setForcedChunkLoadingCallback(this, new ChunkLoadingHandler());
    
    //Config
    FMLCommonHandler.instance().bus().register(INSTANCE);
    //Starting the EventListener
    new PlayerDeathEventListener();
    log("Loading complete.");
    }
    
    /** The mod post-initialisation method */
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    packetHandler.postInitialise();
    
    hooks.hook();
    
    /* TODO : ICBM
    isICBMSentryLoaded = Loader.instance().isModLoaded("ICBM|Sentry");
    
    log("ICBM hooking complete.");
    */
    }
    
    @SubscribeEvent
    public void playerDrops(PlayerDropsEvent event)
    {
    for(int i = event.drops.size() - 1; i >= 0; i–)
    {
    EntityItem ent = event.drops.get(i);
    InfoType type = InfoType.getType(ent.getEntityItem());
    if(type != null && !type.canDrop)
    event.drops.remove(i);
    }
    }
    
    @SubscribeEvent
    public void playerDrops(ItemTossEvent event)
    {
    InfoType type = InfoType.getType(event.entityItem.getEntityItem());
    if(type != null && !type.canDrop)
    event.setCanceled(true);
    }
    
    /** Teams command register method */
    @EventHandler
    public void registerCommand(FMLServerStartedEvent e)
    {
    CommandHandler handler = ((CommandHandler)FMLCommonHandler.instance().getSidedDelegate().getServer().getCommandManager());
    handler.registerCommand(new CommandTeams());
    }
    
    @SubscribeEvent
    public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
    if(eventArgs.modID.equals(MODID))
    syncConfig();
    }
    
    @SubscribeEvent
    public void onLivingSpecialSpawn(LivingSpawnEvent.CheckSpawn event)
    {
    double chance = event.world.rand.nextDouble();
    
    if(chance < armourSpawnRate && event.entityLiving instanceof EntityZombie || event.entityLiving instanceof EntitySkeleton)
    {
    if(event.world.rand.nextBoolean() && ArmourType.armours.size() > 0)
    {
    //Give a completely random piece of armour
    ArmourType armour = ArmourType.armours.get(event.world.rand.nextInt(ArmourType.armours.size()));
    if(armour != null && armour.type != 2)
    event.entityLiving.setCurrentItemOrArmor(armour.type + 1, new ItemStack(armour.item));
    }
    else if(Team.teams.size() > 0)
    {
    //Give a random set of armour
    Team team = Team.teams.get(event.world.rand.nextInt(Team.teams.size()));
    if(team.hat != null)
    event.entityLiving.setCurrentItemOrArmor(1, team.hat.copy());
    if(team.chest != null)
    event.entityLiving.setCurrentItemOrArmor(2, team.chest.copy());
    //if(team.legs != null)
    // event.entityLiving.setCurrentItemOrArmor(3, team.legs.copy());
    if(team.shoes != null)
    event.entityLiving.setCurrentItemOrArmor(4, team.shoes.copy());
    }
    }
    }
    
    /** Reads type files from all content packs */
    private void getTypeFiles(List <file>contentPacks)
    {
    for (File contentPack : contentPacks)
    {
    if(contentPack.isDirectory())
    {
    for(EnumType typeToCheckFor : EnumType.values())
    {
    File typesDir = new File(contentPack, "/" + typeToCheckFor.folderName + "/");
    if(!typesDir.exists())
    continue;
    for(File file : typesDir.listFiles())
    {
    try
    {
    BufferedReader reader = new BufferedReader(new FileReader(file));
    String[] splitName = file.getName().split("/");
    TypeFile typeFile = new TypeFile(typeToCheckFor, splitName[splitName.length - 1].split("\\.")[0]);
    for(;;)
    {
    String line = null;
    try
    {
    line = reader.readLine();
    }
    catch (Exception e)
    {
    break;
    }
    if (line == null)
    break;
    typeFile.lines.add(line);
    }
    reader.close();
    }
    catch(FileNotFoundException e)
    {
    e.printStackTrace();
    }
    catch(IOException e)
    {
    e.printStackTrace();
    }
    }
    }
    }
    else
    {
    try
    {
    ZipFile zip = new ZipFile(contentPack);
    ZipInputStream zipStream = new ZipInputStream(new FileInputStream(contentPack));
    BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream));
    ZipEntry zipEntry = zipStream.getNextEntry();
    do
    {
    zipEntry = zipStream.getNextEntry();
    if(zipEntry == null)
    continue;
    TypeFile typeFile = null;
    for(EnumType type : EnumType.values())
    {
    if(zipEntry.getName().startsWith(type.folderName + "/") && zipEntry.getName().split(type.folderName + "/").length > 1 && zipEntry.getName().split(type.folderName + "/")[1].length() > 0)
    {
    String[] splitName = zipEntry.getName().split("/");
    typeFile = new TypeFile(type, splitName[splitName.length - 1].split("\\.")[0]);
    }
    }
    if(typeFile == null)
    {
    continue;
    }
    for(;;)
    {
    String line = null;
    try
    {
    line = reader.readLine();
    }
    catch (Exception e)
    {
    break;
    }
    if (line == null)
    break;
    typeFile.lines.add(line);
    }
    }
    while(zipEntry != null);
    reader.close();
    zip.close();
    zipStream.close();
    }
    catch(IOException e)
    {
    e.printStackTrace();
    }
    }
    }
    }
    
    /** Content pack reader method */
    private void readContentPacks(FMLPreInitializationEvent event)
    {
    // Icons, Skins, Models
    // Get the classloader in order to load the images
    ClassLoader classloader = (net.minecraft.server.MinecraftServer.class).getClassLoader();
    Method method = null;
    try
    {
    method = (java.net.URLClassLoader.class).getDeclaredMethod("addURL", java.net.URL.class);
    method.setAccessible(true);
    } catch (Exception e)
    {
    log("Failed to get class loader. All content loading will now fail.");
    e.printStackTrace();
    }
    
    List <file>contentPacks = proxy.getContentList(method, classloader);
    
    if (!event.getSide().equals(Side.CLIENT))
    {
    //Gametypes (Server only)
    // TODO: gametype loader
    }
    
    getTypeFiles(contentPacks);
    
    for(EnumType type : EnumType.values())
    {
    Class typeClass = type.getTypeClass();
    for(TypeFile typeFile : TypeFile.files.get(type))
    {
    try
    {
    InfoType infoType = (typeClass.getConstructor(TypeFile.class).newInstance(typeFile));
    infoType.read(typeFile);
    switch(type)
    {
    case bullet : bulletItems.add((ItemBullet)new ItemBullet((BulletType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case attachment : attachmentItems.add((ItemAttachment)new ItemAttachment((AttachmentType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case gun : gunItems.add((ItemGun)new ItemGun((GunType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case grenade : grenadeItems.add((ItemGrenade)new ItemGrenade((GrenadeType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case part : partItems.add((ItemPart)new ItemPart((PartType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case plane : planeItems.add((ItemPlane)new ItemPlane((PlaneType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case vehicle : vehicleItems.add((ItemVehicle)new ItemVehicle((VehicleType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case aa : aaGunItems.add((ItemAAGun)new ItemAAGun((AAGunType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case mechaItem : mechaToolItems.add((ItemMechaAddon)new ItemMechaAddon((MechaItemType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case mecha : mechaItems.add((ItemMecha)new ItemMecha((MechaType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case tool : toolItems.add((ItemTool)new ItemTool((ToolType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case box : gunBoxBlocks.add((BlockGunBox)new BlockGunBox((GunBoxType)infoType).setBlockName(infoType.shortName).setCreativeTab(ModAltisCraft.AltisCraft)); break;
    case armour : armourItems.add((ItemTeamArmour)new ItemTeamArmour((ArmourType)infoType).setUnlocalizedName(infoType.shortName)); break;
    case armourBox : armourBoxBlocks.add((BlockArmourBox)new BlockArmourBox((ArmourBoxType)infoType).setBlockName(infoType.shortName)); break;
    case playerClass : break;
    case team : break;
    default : log("Unrecognised type for " + infoType.shortName); break;
    }
    }
    catch(Exception e)
    {
    log("Failed to add " + type.name() + " : " + typeFile.name);
    e.printStackTrace();
    }
    }
    log("Loaded " + type.name() + ".");
    }
    Team.spectators = spectators;
    }
    
    public static PacketHandler getPacketHandler()
    {
    return INSTANCE.packetHandler;
    }
    
    public static void syncConfig() {
    //generalConfigInteger = configFile.getInt("Config Integer", Configuration.CATEGORY_GENERAL, generalConfigInteger, 0, Integer.MAX_VALUE, "An Integer!");
    //generalConfigString = configFile.getString("Config String", Configuration.CATEGORY_GENERAL, generalConfigString, "A String!");
    addGunpowderRecipe = configFile.getBoolean("Gunpowder Recipe", Configuration.CATEGORY_GENERAL, addGunpowderRecipe, "Whether or not to add the extra gunpowder recipe (3 charcoal + 1 lightstone)");
    
    //teamsConfigInteger = configFile.getInt("Config Integer", Configuration.CATEGORY_GENERAL, teamsConfigInteger, 0, Integer.MAX_VALUE, "An Integer!");
    //teamsConfigString = configFile.getString("Config String", Configuration.CATEGORY_GENERAL, teamsConfigString, "A String!");
    //teamsConfigBoolean = configFile.getBoolean("Config Boolean", Configuration.CATEGORY_GENERAL, teamsConfigBoolean, "A Boolean!");
    
    if(configFile.hasChanged())
    configFile.save();
    }
    
    //TODO : Proper logger
    public static void log(String string)
    {
    System.out.println("[AltisCraft.fr] " + string);
    }
    }
    
    

    Et la classe bullet n'a pas bouger 😕 des idées ?</file></file></blockarmourbox></blockarmourbox></itemteamarmour></itemteamarmour></itemtool></itemtool></itemgrenade></itemgrenade></itemaagun></itemaagun></itemmecha></itemmecha></itemmechaaddon></itemmechaaddon></itemvehicle></itemvehicle></itemplane></itemplane></itempart></itempart></itemattachment></itemattachment></itemgun></itemgun></itembullet></itembullet></blockgunbox></blockgunbox>



  • Envoi le rapport d'erreur



  • Voilà :

    –-- Minecraft Crash Report ----
    // I just don't know what went wrong 😞

    Time: 25/11/15 19:16
    Description: Ticking entity

    java.lang.ArrayIndexOutOfBoundsException: -2023999
    at com.flansmod.common.guns.EntityBullet.func_70071_h_(EntityBullet.java:285)
    at net.minecraft.world.World.func_72866_a(World.java:2629)
    at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:837)
    at net.minecraft.world.World.func_72870_g(World.java:2581)
    at net.minecraft.world.World.func_72939_s(World.java:2405)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:669)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:954)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669)
    at java.lang.Thread.run(Unknown Source)

    A detailed walkthrough of the error, its code path and all known details is as follows:

    -- Head --
    Stacktrace:
    at com.flansmod.common.guns.EntityBullet.func_70071_h_(EntityBullet.java:285)
    at net.minecraft.world.World.func_72866_a(World.java:2629)
    at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:837)
    at net.minecraft.world.World.func_72870_g(World.java:2581)

    -- Entity being ticked --
    Details:
    Entity Type: flansmod.bullet (com.flansmod.common.guns.EntityBullet)
    Entity ID: 8421
    Entity Name: entity.flansmod.bullet.name
    Entity's Exact location: -2487,58, 90,79, -7888,66
    Entity's Block location: World: (-2488,90,-7889), Chunk: (at 8,5,15 in -156,-494; contains blocks -2496,0,-7904 to -2481,255,-7889), Region: (-5,-16; contains chunks -160,-512 to -129,-481, blocks -2560,0,-8192 to -2049,255,-7681)
    Entity's Momentum: -0,67, -0,12, 9,88
    Stacktrace:
    at net.minecraft.world.World.func_72939_s(World.java:2405)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:669)

    -- Affected level --
    Details:
    Level name: AltisCraft
    All players: 30 total; [EntityPlayerMP['WarzyXx'/60, l='AltisCraft', x=-8491,33, y=33,00, z=-3755,51](WarzyXx at -8491.333209989414,33.0,-3755.5119653420506), EntityPlayerMP['abys'/724, l='AltisCraft', x=-1102,53, y=34,00, z=-1818,31](abys at -1102.529346807387,34.0,-1818.3132175427775), EntityPlayerMP['FuNiMaX'/845, l='AltisCraft', x=-8530,77, y=33,00, z=-3762,05](FuNiMaX at -8530.766751679066,33.0,-3762.046462854882), EntityPlayerMP['corentin'/805, l='AltisCraft', x=-8507,95, y=33,36, z=-3768,31](corentin at -8507.945970883686,33.36075,-3768.3123765484024), EntityPlayerMP['geforce07'/883, l='AltisCraft', x=-9157,41, y=20,00, z=-2640,55](geforce07 at -9157.406910702693,20.0,-2640.547818395628), EntityPlayerMP['ItsEnergix_'/894, l='AltisCraft', x=-8507,30, y=33,00, z=-3737,89](ItsEnergix_ at -8507.295838167498,33.0,-3737.8861951226963), EntityPlayerMP['Angel_S'/1425, l='AltisCraft', x=-8573,22, y=33,00, z=-3619,97](Angel_S at -8573.223984596425,33.0,-3619.9689064286777), EntityPlayerMP['DEmoNiiAkOO'/1454, l='AltisCraft', x=-8486,12, y=37,00, z=-3720,41](DEmoNiiAkOO at -8486.11538581527,37.0,-3720.4147530430146), EntityPlayerMP['Eric_Adams'/1499, l='AltisCraft', x=-8482,24, y=53,73, z=-3756,07](Eric_Adams at -8482.23619693377,53.73079337471755,-3756.0682574714924), EntityPlayerMP['link64000'/2170, l='AltisCraft', x=-8485,03, y=33,79, z=-3776,78](link64000 at -8485.03432040487,33.78502770378924,-3776.7783353562595), EntityPlayerMP['Baptiste_Grein'/2424, l='AltisCraft', x=-3434,88, y=26,83, z=-2803,72](Baptiste_Grein at -3434.877399082775,26.834925920310987,-2803.720999135037), EntityPlayerMP['REX302002'/2434, l='AltisCraft', x=-8527,83, y=33,00, z=-3756,53](REX302002 at -8527.82734976698,33.0,-3756.5347219078417), EntityPlayerMP['Kenzi_iZi'/2757, l='AltisCraft', x=-8500,63, y=33,00, z=-3731,88](Kenzi_iZi at -8500.630356172425,33.0,-3731.8790848298377), EntityPlayerMP['kalipso1000'/2766, l='AltisCraft', x=0,00, y=99,00, z=0,00](kalipso1000 at 0.0,99.0,0.0), EntityPlayerMP['komi43'/2780, l='AltisCraft', x=-8513,95, y=34,25, z=-3758,27](komi43 at -8513.947210079801,34.24918707874468,-3758.2658365502325), EntityPlayerMP['ilyas_2003'/3182, l='AltisCraft', x=-2484,37, y=88,00, z=-7908,13](ilyas_2003 at -2484.3723565447067,88.0,-7908.132955163231), EntityPlayerMP['Theo_Toilette'/3518, l='AltisCraft', x=-1060,31, y=35,15, z=-1834,72](Theo_Toilette at -1060.3068408088047,35.14514205324103,-1834.722712335524), EntityPlayerMP['Micka31140'/3843, l='AltisCraft', x=-8485,01, y=58,67, z=-4155,70](Micka31140 at -8485.012231967165,58.6705856109038,-4155.699936974048), EntityPlayerMP['Eclipse_Prod'/3865, l='AltisCraft', x=-3434,23, y=12,00, z=-2813,47](Eclipse_Prod at -3434.233345773888,12.0,-2813.466487750833), EntityPlayerMP['JulienixFR'/4192, l='AltisCraft', x=-8716,02, y=17,00, z=-3044,55](JulienixFR at -8716.024273794248,17.0,-3044.550793321056), EntityPlayerMP['Andy20'/4593, l='AltisCraft', x=-2680,83, y=51,00, z=-3625,61](Andy20 at -2680.828653235005,51.0,-3625.6147115028075), EntityPlayerMP['irise3'/4634, l='AltisCraft', x=-8635,95, y=17,25, z=-3195,97](irise3 at -8635.954595141682,17.24918707874468,-3195.969888406509), EntityPlayerMP['ak_19'/4649, l='AltisCraft', x=-8503,59, y=33,00, z=-3737,68](ak_19 at -8503.589437987344,33.0,-3737.6801945162283), EntityPlayerMP['Benji01'/5785, l='AltisCraft', x=-8335,88, y=33,00, z=-3659,43](Benji01 at -8335.883772835083,33.0,-3659.4269708806405), EntityPlayerMP['Sir_Moustache'/5796, l='AltisCraft', x=-8497,63, y=33,00, z=-3727,53](Sir_Moustache at -8497.627152921586,33.0,-3727.525239783499), EntityPlayerMP['X_proHard'/5807, l='AltisCraft', x=-8484,32, y=56,36, z=-4137,92](X_proHard at -8484.31553556025,56.358467906713486,-4137.917810700834), EntityPlayerMP['Azitox'/5832, l='AltisCraft', x=-4218,42, y=45,00, z=-3292,68](Azitox at -4218.419413711785,45.0,-3292.6807378684744), EntityPlayerMP['jamygaming'/6481, l='AltisCraft', x=-8507,03, y=33,00, z=-3773,50](jamygaming at -8507.026943283194,33.0,-3773.503300377579), EntityPlayerMP['ArcticLov'/7166, l='AltisCraft', x=-2482,01, y=88,00, z=-7910,59](ArcticLov at -2482.01219088651,88.0,-7910.586337369956), EntityPlayerMP['Jean_Cerien'/8343, l='AltisCraft', x=-2487,61, y=89,25, z=-7888,10](Jean_Cerien at -2487.6054390004615,89.24918707874468,-7888.097183586911)]
    Chunk stats: ServerChunkCache: 5304 Drop: 0
    Level seed: 27594263
    Level generator: ID 02 - largeBiomes, ver 0. Features enabled: false
    Level generator options:
    Level spawn location: World: (0,99,0), Chunk: (at 0,6,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 333381802 game time, 345973894 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 35447 (now: false), thunder time: 74765 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
    Stacktrace:
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:954)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669)
    at java.lang.Thread.run(Unknown Source)

    – System Details --
    Details:
    Minecraft Version: 1.7.10
    KCauldron Version: pw.prok:KCauldron:1.7.10-1492.155
    Operating System: Windows Server 2012 R2 (amd64) version 6.3
    Java Version: 1.8.0_65, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 13295984432 bytes (12680 MB) / 15696658432 bytes (14969 MB) up to 15696658432 bytes (14969 MB)
    JVM Flags: 2 total; -Xms13G -Xmx15G
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 103
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1492 11 mods loaded, 11 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
    UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (OpenMod-Prov2.jar)
    UCHIJAAAA Forge{10.13.4.1492} [Minecraft Forge] (OpenMod-Prov2.jar)
    UCHIJAAAA kimagine{0.1} [KImagine] (minecraft.jar)
    UCHIJAAAA CarpentersBlocks{0.0.1 Beta} [AltisCraft.fr] (AltisCraft.fr.jar)
    UCHIJAAAA flansmod{@VERSION@} [Flan's Mod] (AltisCraft.fr.jar)
    UCHIJAAAA thirstmod{1.8.14} [Thirst Mod] (AltisCraft.fr.jar)
    UCHIJAAAA t4pro{1.0.1} [Project] (AltisCraft.fr.jar)
    UCHIJAAAA altiscraft.MODID{1.0.0} [AltisCraft.fr] (AltisCraft.fr.jar)
    UCHIJAAAA Backpack{2.0.1} [Backpack] (backpack-2.0.1-1.7.x.jar)
    UCHIJAAAA gvc{0.6.1} [§aGliby's§f Voice Chat Mod] (GlibysVC-1.7.10-0.6.1.jar)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Player Count: 30 / 100; [EntityPlayerMP['WarzyXx'/60, l='AltisCraft', x=-8491,33, y=33,00, z=-3755,51](WarzyXx at -8491.333209989414,33.0,-3755.5119653420506), EntityPlayerMP['abys'/724, l='AltisCraft', x=-1102,53, y=34,00, z=-1818,31](abys at -1102.529346807387,34.0,-1818.3132175427775), EntityPlayerMP['FuNiMaX'/845, l='AltisCraft', x=-8530,77, y=33,00, z=-3762,05](FuNiMaX at -8530.766751679066,33.0,-3762.046462854882), EntityPlayerMP['corentin'/805, l='AltisCraft', x=-8507,95, y=33,36, z=-3768,31](corentin at -8507.945970883686,33.36075,-3768.3123765484024), EntityPlayerMP['geforce07'/883, l='AltisCraft', x=-9157,41, y=20,00, z=-2640,55](geforce07 at -9157.406910702693,20.0,-2640.547818395628), EntityPlayerMP['ItsEnergix_'/894, l='AltisCraft', x=-8507,30, y=33,00, z=-3737,89](ItsEnergix_ at -8507.295838167498,33.0,-3737.8861951226963), EntityPlayerMP['Angel_S'/1425, l='AltisCraft', x=-8573,22, y=33,00, z=-3619,97](Angel_S at -8573.223984596425,33.0,-3619.9689064286777), EntityPlayerMP['DEmoNiiAkOO'/1454, l='AltisCraft', x=-8486,12, y=37,00, z=-3720,41](DEmoNiiAkOO at -8486.11538581527,37.0,-3720.4147530430146), EntityPlayerMP['Eric_Adams'/1499, l='AltisCraft', x=-8482,24, y=53,73, z=-3756,07](Eric_Adams at -8482.23619693377,53.73079337471755,-3756.0682574714924), EntityPlayerMP['link64000'/2170, l='AltisCraft', x=-8485,03, y=33,79, z=-3776,78](link64000 at -8485.03432040487,33.78502770378924,-3776.7783353562595), EntityPlayerMP['Baptiste_Grein'/2424, l='AltisCraft', x=-3434,88, y=26,83, z=-2803,72](Baptiste_Grein at -3434.877399082775,26.834925920310987,-2803.720999135037), EntityPlayerMP['REX302002'/2434, l='AltisCraft', x=-8527,83, y=33,00, z=-3756,53](REX302002 at -8527.82734976698,33.0,-3756.5347219078417), EntityPlayerMP['Kenzi_iZi'/2757, l='AltisCraft', x=-8500,63, y=33,00, z=-3731,88](Kenzi_iZi at -8500.630356172425,33.0,-3731.8790848298377), EntityPlayerMP['kalipso1000'/2766, l='AltisCraft', x=0,00, y=99,00, z=0,00](kalipso1000 at 0.0,99.0,0.0), EntityPlayerMP['komi43'/2780, l='AltisCraft', x=-8513,95, y=34,25, z=-3758,27](komi43 at -8513.947210079801,34.24918707874468,-3758.2658365502325), EntityPlayerMP['ilyas_2003'/3182, l='AltisCraft', x=-2484,37, y=88,00, z=-7908,13](ilyas_2003 at -2484.3723565447067,88.0,-7908.132955163231), EntityPlayerMP['Theo_Toilette'/3518, l='AltisCraft', x=-1060,31, y=35,15, z=-1834,72](Theo_Toilette at -1060.3068408088047,35.14514205324103,-1834.722712335524), EntityPlayerMP['Micka31140'/3843, l='AltisCraft', x=-8485,01, y=58,67, z=-4155,70](Micka31140 at -8485.012231967165,58.6705856109038,-4155.699936974048), EntityPlayerMP['Eclipse_Prod'/3865, l='AltisCraft', x=-3434,23, y=12,00, z=-2813,47](Eclipse_Prod at -3434.233345773888,12.0,-2813.466487750833), EntityPlayerMP['JulienixFR'/4192, l='AltisCraft', x=-8716,02, y=17,00, z=-3044,55](JulienixFR at -8716.024273794248,17.0,-3044.550793321056), EntityPlayerMP['Andy20'/4593, l='AltisCraft', x=-2680,83, y=51,00, z=-3625,61](Andy20 at -2680.828653235005,51.0,-3625.6147115028075), EntityPlayerMP['irise3'/4634, l='AltisCraft', x=-8635,95, y=17,25, z=-3195,97](irise3 at -8635.954595141682,17.24918707874468,-3195.969888406509), EntityPlayerMP['ak_19'/4649, l='AltisCraft', x=-8503,59, y=33,00, z=-3737,68](ak_19 at -8503.589437987344,33.0,-3737.6801945162283), EntityPlayerMP['Benji01'/5785, l='AltisCraft', x=-8335,88, y=33,00, z=-3659,43](Benji01 at -8335.883772835083,33.0,-3659.4269708806405), EntityPlayerMP['Sir_Moustache'/5796, l='AltisCraft', x=-8497,63, y=33,00, z=-3727,53](Sir_Moustache at -8497.627152921586,33.0,-3727.525239783499), EntityPlayerMP['X_proHard'/5807, l='AltisCraft', x=-8484,32, y=56,36, z=-4137,92](X_proHard at -8484.31553556025,56.358467906713486,-4137.917810700834), EntityPlayerMP['Azitox'/5832, l='AltisCraft', x=-4218,42, y=45,00, z=-3292,68](Azitox at -4218.419413711785,45.0,-3292.6807378684744), EntityPlayerMP['jamygaming'/6481, l='AltisCraft', x=-8507,03, y=33,00, z=-3773,50](jamygaming at -8507.026943283194,33.0,-3773.503300377579), EntityPlayerMP['ArcticLov'/7166, l='AltisCraft', x=-2482,01, y=88,00, z=-7910,59](ArcticLov at -2482.01219088651,88.0,-7910.586337369956), EntityPlayerMP['Jean_Cerien'/8343, l='AltisCraft', x=-2487,61, y=89,25, z=-7888,10](Jean_Cerien at -2487.6054390004615,89.24918707874468,-7888.097183586911)]
    Is Modded: Definitely; Server brand changed to 'kcauldron,cauldron,craftbukkit,mcpc,fml,forge'
    Type: Dedicated Server (map_server.txt)



  • Un truc que je ne comprends pas : si la variable ping représente le temps de latence entre le serveur et le joueur concerné, pourquoi celui-ci n'est-il pas mis à jour toutes les secondes et pourquoi utiliser le ping ?



  • Je ne sais pas c'est le code source de flansmod qui bug 😕



  • Si ce n'est pas ton propre code, je vois pas en quoi on peut t'aider car pour moi le seul moyen c'est de vérifier que le ping n'est pas négatif



  • Je n'ai pas très bien manié les tableaux si s'en est les [] j'ai essayé ce code ? Me le recommande tu ou j'ai écris n'importe quoi ?

    if(data.snapshots[0].toString().startsWith("-"))
    data.snapshots[0] = data.snapshots[0];