Fixed NPE with parachutes

This commit is contained in:
Kino 2019-01-31 20:54:17 -05:00
parent 3b8d91ad6e
commit d81561f18a
2 changed files with 6 additions and 3 deletions

View file

@ -150,13 +150,13 @@ public class EntityParachute extends Entity implements IEntityAdditionalSpawnDat
@Override
public void writeSpawnData(ByteBuf buffer) {
buffer.writeBoolean(this.isGoldenParachute);
buffer.writeInt(this.ridingPlayer.getEntityId());
buffer.writeInt(this.ridingPlayer == null ? 0 : this.ridingPlayer.getEntityId());
}
@Override
public void readSpawnData(ByteBuf buffer) {
this.isGoldenParachute = buffer.readBoolean();
this.ridingPlayer = (EntityPlayer) this.worldObj.getEntityByID(buffer.readInt());
this.ridingPlayer = buffer.readInt() == 0 ? null : (EntityPlayer) this.worldObj.getEntityByID(buffer.readInt());
}
}

View file

@ -281,7 +281,10 @@ public class PlayerAether implements IPlayerAether {
this.getEntity().riddenByEntity.mountEntity(null);
}
server.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) this.getEntity(), transferDimension, teleporter);
if (server != null && server.getConfigurationManager() != null)
{
server.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) this.getEntity(), transferDimension, teleporter);
}
}
}