Fix Multi-part entity children ID issue, mobs with custom spawning must deal with child ids themselves.

This commit is contained in:
LexManos 2013-03-09 10:07:41 -08:00
parent a98bf99037
commit a8da44fb8f
1 changed files with 9 additions and 12 deletions

View File

@ -341,6 +341,7 @@ public class FMLClientHandler implements IFMLSidedHandler
else
{
entity = (Entity)(cls.getConstructor(World.class).newInstance(wc));
int offset = packet.entityId - entity.field_70157_k;
entity.field_70157_k = packet.entityId;
entity.func_70012_b(packet.scaledX, packet.scaledY, packet.scaledZ, packet.scaledYaw, packet.scaledPitch);
if (entity instanceof EntityLiving)
@ -348,6 +349,14 @@ public class FMLClientHandler implements IFMLSidedHandler
((EntityLiving)entity).field_70759_as = packet.scaledHeadYaw;
}
Entity parts[] = entity.func_70021_al();
if (parts != null)
{
for (int j = 0; j < parts.length; j++)
{
parts[j].field_70157_k += offset;
}
}
}
entity.field_70118_ct = packet.rawX;
@ -360,18 +369,6 @@ public class FMLClientHandler implements IFMLSidedHandler
((IThrowableEntity)entity).setThrower(thrower);
}
Entity parts[] = entity.func_70021_al();
if (parts != null)
{
int i = packet.entityId - entity.field_70157_k;
for (int j = 0; j < parts.length; j++)
{
parts[j].field_70157_k += i;
}
}
if (packet.metadata != null)
{
entity.func_70096_w().func_75687_a((List)packet.metadata);