Search in sources :

Example 1 with EnumStatus

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;
    }
}
Also used : EnumStatus(net.minecraft.entity.player.EntityPlayer.EnumStatus) GCPlayerStats(micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats) PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars) ChatComponentText(net.minecraft.util.ChatComponentText)

Aggregations

GCPlayerStats (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats)1 PacketSimpleMars (micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)1 EnumStatus (net.minecraft.entity.player.EntityPlayer.EnumStatus)1 ChatComponentText (net.minecraft.util.ChatComponentText)1