Search in sources :

Example 1 with TileEntityColourMixer

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

the class MessageClientGuiButton method onMessage.

@Override
public IMessage onMessage(MessageClientGuiButton message, MessageContext ctx) {
    EntityPlayerMP player = ctx.getServerHandler().playerEntity;
    if (player == null) {
        return null;
    }
    Container container = player.openContainer;
    if (container != null && container instanceof ContainerArmourer) {
        TileEntityArmourer armourerBrain = ((ContainerArmourer) container).getTileEntity();
        if (message.buttonId == 14) {
            armourerBrain.loadArmourItem(player);
        }
        if (message.buttonId == 7) {
            armourerBrain.toggleGuides();
        }
        if (message.buttonId == 9) {
            armourerBrain.toggleOverlay();
        }
        if (message.buttonId == 6) {
            armourerBrain.toggleHelper();
        }
        if (message.buttonId == 11) {
        // armourerBrain.cloneToSide(ForgeDirection.WEST);
        }
        if (message.buttonId == 12) {
        // armourerBrain.cloneToSide(ForgeDirection.EAST);
        }
    }
    if (container != null && container instanceof ContainerColourMixer) {
        TileEntityColourMixer colourMixer = ((ContainerColourMixer) container).getTileEntity();
        colourMixer.setColourFamily(ColourFamily.values()[message.buttonId]);
    }
    if (container instanceof IButtonPress) {
        ((IButtonPress) container).buttonPressed(message.buttonId);
    }
    return null;
}
Also used : Container(net.minecraft.inventory.Container) TileEntityArmourer(riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer) ContainerArmourer(riskyken.armourersWorkshop.common.inventory.ContainerArmourer) ContainerColourMixer(riskyken.armourersWorkshop.common.inventory.ContainerColourMixer) TileEntityColourMixer(riskyken.armourersWorkshop.common.tileentities.TileEntityColourMixer) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Example 2 with TileEntityColourMixer

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

the class MessageClientGuiColourUpdate method onMessage.

@Override
public IMessage onMessage(MessageClientGuiColourUpdate message, MessageContext ctx) {
    EntityPlayerMP player = ctx.getServerHandler().playerEntity;
    if (player == null) {
        return null;
    }
    Container container = player.openContainer;
    if (container != null && container instanceof ContainerColourMixer) {
        TileEntityColourMixer colourMixer = ((ContainerColourMixer) container).getTileEntity();
        colourMixer.receiveColourUpdateMessage(message.colour, message.item, message.paintType);
    }
    return null;
}
Also used : Container(net.minecraft.inventory.Container) ContainerColourMixer(riskyken.armourersWorkshop.common.inventory.ContainerColourMixer) TileEntityColourMixer(riskyken.armourersWorkshop.common.tileentities.TileEntityColourMixer) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Aggregations

EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 Container (net.minecraft.inventory.Container)2 ContainerColourMixer (riskyken.armourersWorkshop.common.inventory.ContainerColourMixer)2 TileEntityColourMixer (riskyken.armourersWorkshop.common.tileentities.TileEntityColourMixer)2 ContainerArmourer (riskyken.armourersWorkshop.common.inventory.ContainerArmourer)1 TileEntityArmourer (riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer)1