public void handleBed(Packet70Bed par1Packet70Bed)
    {
        EntityPlayerSP var2 = this.mc.thePlayer;
        int var3 = par1Packet70Bed.bedState;

        if (var3 >= 0 && var3 < Packet70Bed.bedChat.length && Packet70Bed.bedChat[var3] != null)
        {
            var2.addChatMessage(Packet70Bed.bedChat[var3]);
        }

        if (var3 == 1)
        {
            this.worldClient.getWorldInfo().setRaining(true);
            this.worldClient.setRainStrength(1.0F);
        }
        else if (var3 == 2)
        {
            this.worldClient.getWorldInfo().setRaining(false);
            this.worldClient.setRainStrength(0.0F);
        }
        else if (var3 == 3)
        {
            ((PlayerControllerMP)this.mc.playerController).setCreative(par1Packet70Bed.gameMode == 1);
        }
        else if (var3 == 4)
        {
            this.mc.displayGuiScreen(new GuiWinGame());
        }
    }