Hello,
I have another issue:
In my ItemGun i have this:
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityBullet(par2World, ((EntityPlayer)par3Entity), 21.0F));
par2World.spawnEntityInWorld(new EntityNoiseLocation(par2World, ((EntityPlayer)par3Entity), this.noiseRange));
}
And in my EntityBullet i have this in onUpdate:
if(this.stopTick && this.doneDisplay)
{
int nbMs = nbTicks * 50;
System.out.println(this.entityId + " 100 meters in " + nbMs + "ms");
this.doneDisplay = false;
}
this.stopTick take false when in onUpdate again:
if (this.inGround)
{
int j = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
this.stopTick = true;
............
}
My issue is when my bullet hit a block, this:
System.out.println(this.entityId + " 100 meters in " + nbMs + "ms");
is writting twice in consol and most of time nbMs is different (1 tick more)
I don't know why this is showing twice, my entity is only spawning once i think with isRemote.
Thanks