Search in sources :

Example 1 with SlotDyeBottle

use of riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle in project Armourers-Workshop by RiskyKen.

the class ContainerDyeTable method skinRemoved.

public void skinRemoved() {
    if (!tileEntity.getWorldObj().isRemote) {
        for (int i = 0; i < 8; i++) {
            SlotDyeBottle slot = (SlotDyeBottle) getSlot(37 + i);
            if (!slot.isLocked()) {
                UtilPlayer.giveItem(invPlayer.player, getSlot(37 + i).getStack());
            } else {
                slot.setLocked(false);
            }
            putStackInSlot(37 + i, null);
        }
        putStackInSlot(45, null);
        detectAndSendChanges();
    }
    unlockedSlots();
}
Also used : SlotDyeBottle(riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle)

Example 2 with SlotDyeBottle

use of riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle in project Armourers-Workshop by RiskyKen.

the class GuiDyeTable method drawGuiContainerBackgroundLayer.

@Override
protected void drawGuiContainerBackgroundLayer(float f1, int mouseX, int mouseY) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.getTextureManager().bindTexture(texture);
    drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 256, this.ySize);
    drawTexturedModalRect(this.guiLeft + 182 + 56, this.guiTop, 174, 0, 82, this.ySize);
    // drawRect(guiLeft, guiTop, guiLeft + xSize, guiTop + ySize, 0x88FFFFFF);
    if (ConfigHandler.lockDyesOnSkins) {
        ModRenderHelper.enableAlphaBlend();
        for (int i = 0; i < 8; i++) {
            SlotDyeBottle dyeSlot = (SlotDyeBottle) inventorySlots.getSlot(37 + i);
            if (dyeSlot.isLocked()) {
                drawRect(this.guiLeft + dyeSlot.xDisplayPosition, this.guiTop + dyeSlot.yDisplayPosition, this.guiLeft + dyeSlot.xDisplayPosition + 16, this.guiTop + dyeSlot.yDisplayPosition + 16, 0x88FF0000);
            }
        }
    }
}
Also used : SlotDyeBottle(riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle)

Example 3 with SlotDyeBottle

use of riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle in project Armourers-Workshop by RiskyKen.

the class ContainerDyeTable method updateLockedSlots.

/**
 * Reads the input slot and locks dye slots that are in use.
 * @param stack
 */
private void updateLockedSlots(ItemStack stack) {
    SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
    ISkinDye dye = skinPointer.getSkinDye();
    for (int i = 0; i < 8; i++) {
        if (dye.haveDyeInSlot(i)) {
            ((SlotDyeBottle) getSlot(37 + i)).setLocked(true);
        } else {
            ((SlotDyeBottle) getSlot(37 + i)).setLocked(false);
        }
    }
}
Also used : SkinPointer(riskyken.armourersWorkshop.common.skin.data.SkinPointer) ISkinDye(riskyken.armourersWorkshop.api.common.skin.data.ISkinDye) SlotDyeBottle(riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle)

Aggregations

SlotDyeBottle (riskyken.armourersWorkshop.common.inventory.slot.SlotDyeBottle)3 ISkinDye (riskyken.armourersWorkshop.api.common.skin.data.ISkinDye)1 SkinPointer (riskyken.armourersWorkshop.common.skin.data.SkinPointer)1