Fix bug with entityspawn - if the entity doesn't extend livingbase, it fails

to write a headyaw byte, and everything will be derped for that packet.

Fixes #499, but probably a bunch of others.
This commit is contained in:
cpw 2014-08-29 21:43:17 -04:00
parent 67ebda9ace
commit f0d8b887b4
1 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,10 @@ public abstract class FMLMessage {
{
buf.writeByte((byte) (((EntityLivingBase)entity).rotationYawHead * 256.0F / 360.0F));
}
else
{
buf.writeByte(0);
}
ByteBuf tmpBuf = Unpooled.buffer();
PacketBuffer pb = new PacketBuffer(tmpBuf);
try