Fixed forge scripts on the server side. getIEntity() now correctly returns an IPlayer when given a player as a parameter.

This commit is contained in:
luisc committed 2021-10-20 20:27:42 -05:00
1 parent 5515f5ef83
commit a993c8feff
2 files changed
+3 -4

No files matched your search

@@ -49,7 +49,7 @@ public class WrapperNpcAPI extends NpcAPI {
public IEntity getIEntity(Entity entity) {
if (entity != null && !entity.worldObj.isRemote) {
return (IEntity)(entity instanceof EntityNPCInterface ? ((EntityNPCInterface)entity).wrappedNPC : WrapperEntityData.get(entity));
return (entity instanceof EntityNPCInterface ? ((EntityNPCInterface)entity).wrappedNPC : entity instanceof EntityPlayerMP ? getIPlayer((EntityPlayerMP) entity) : WrapperEntityData.get(entity));
} else {
return null;
}