Fixed NPE with parachutes
This commit is contained in:
parent
3b8d91ad6e
commit
d81561f18a
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue