use of net.minecraft.entity.player.EntityPlayer.EnumStatus in project Galacticraft by micdoodle8.
the class TileEntityCryogenicChamber method onActivated.
@Override
public boolean onActivated(EntityPlayer entityPlayer) {
if (this.worldObj.isRemote) {
return false;
}
EnumStatus enumstatus = this.sleepInBedAt(entityPlayer, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
switch(enumstatus) {
case OK:
((EntityPlayerMP) entityPlayer).playerNetServerHandler.setPlayerLocation(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, entityPlayer.rotationYaw, entityPlayer.rotationPitch);
GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMars(EnumSimplePacketMars.C_BEGIN_CRYOGENIC_SLEEP, GCCoreUtil.getDimensionID(entityPlayer.worldObj), new Object[] { this.getPos() }), (EntityPlayerMP) entityPlayer);
return true;
case NOT_POSSIBLE_NOW:
GCPlayerStats stats = GCPlayerStats.get(entityPlayer);
entityPlayer.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.cryogenic.chat.cant_use", stats.getCryogenicChamberCooldown() / 20)));
return false;
default:
return false;
}
}
Aggregations