Search in sources :

Example 1 with TileEntityMiniArmourer

use of riskyken.armourersWorkshop.common.tileentities.TileEntityMiniArmourer in project Armourers-Workshop by RiskyKen.

the class MessageClientGuiSetArmourerSkinType method onMessage.

@Override
public IMessage onMessage(MessageClientGuiSetArmourerSkinType message, MessageContext ctx) {
    EntityPlayerMP player = ctx.getServerHandler().playerEntity;
    if (player == null) {
        return null;
    }
    Container container = player.openContainer;
    if (container != null && container instanceof ContainerArmourer) {
        TileEntityArmourer te = ((ContainerArmourer) container).getTileEntity();
        te.setSkinType(message.skinType);
    }
    if (container != null && container instanceof ContainerMiniArmourerBuilding) {
        TileEntityMiniArmourer te = ((ContainerMiniArmourerBuilding) container).getTileEntity();
        te.setSkinType(message.skinType);
    }
    return null;
}
Also used : Container(net.minecraft.inventory.Container) TileEntityArmourer(riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer) ContainerArmourer(riskyken.armourersWorkshop.common.inventory.ContainerArmourer) TileEntityMiniArmourer(riskyken.armourersWorkshop.common.tileentities.TileEntityMiniArmourer) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) ContainerMiniArmourerBuilding(riskyken.armourersWorkshop.common.inventory.ContainerMiniArmourerBuilding)

Aggregations

EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 Container (net.minecraft.inventory.Container)1 ContainerArmourer (riskyken.armourersWorkshop.common.inventory.ContainerArmourer)1 ContainerMiniArmourerBuilding (riskyken.armourersWorkshop.common.inventory.ContainerMiniArmourerBuilding)1 TileEntityArmourer (riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer)1 TileEntityMiniArmourer (riskyken.armourersWorkshop.common.tileentities.TileEntityMiniArmourer)1