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();
}
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);
}
}
}
}
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);
}
}
}
Aggregations