I have solved my problem
Let me explain how
The packet seems to work well, so that's not the problem:
I have added a System.out.println in PacketEntitySpawn
public PacketEntitySpawn(Entity ent, NetworkMod mod, int type)
{
entityID = ent.entityId;
posX = MathHelper.floor_double(ent.posX * 32D);
posY = MathHelper.floor_double(ent.posY * 32D);
posZ = MathHelper.floor_double(ent.posZ * 32D);
typeID = type;
modID = MinecraftForge.getModID(mod);
yaw = (byte)(ent.rotationYaw * 256.0F / 360.0F);
pitch = (byte)(ent.rotationPitch * 256.0F / 360.0F);
yawHead = (byte)(ent instanceof EntityLiving ? ((EntityLiving)ent).rotationYawHead * 256.0F / 360.0F : 0);
metadata = ent.getDataWatcher();
System.out.println("spawn packet ent="+ent + " entitiyID="+entityID);
And things work correctly
spawn packet ent=net.minecraft.src.TrainMod.RollingStock.EntityLocoSteamBig@47b entitiyID=1147
spawn packet ent=net.minecraft.src.TrainMod.Zeppelin.EntityZepplin@47c entitiyID=1148
I have realised that the Zeppelin is never invisible
In my code the Zeppelin just extends Entity
My trains however are more complicated:
[*]EntityMinecart extends Entity (notch code)
[*]AbstractTrains extends EntityMinecart
[*]EntityRollingStock extends AbstractTrains
[*]DieselTrain extends EntityRollingStock
[*]finally EntityLocoGP40 extends DieselTrain
I realised that I had by mistake registered EntityRollingStock:
MinecraftForge.registerEntity(EntityRollingStock.class,this, EntityIds.ROLLINGSTOCK, 200, 2, true);
Removing that line solved my problem.
So it seems that some entities were randomly registered as EntityRollingStock and some others were registered under their own name.
Sorry for bothering you with my stupid mistake
And thanks for your help