private ItemStack[] getOutputs() { if (this.isCraftingMode()) { final ItemStack out = this.getAndUpdateOutput(); if (out != null && out.stackSize > 0) { return new ItemStack[] {out}; } } else { final List<ItemStack> list = new ArrayList<ItemStack>(3); boolean hasValue = false; for (final OptionalSlotFake outputSlot : this.outputSlots) { final ItemStack out = outputSlot.getStack(); if (out != null && out.stackSize > 0) { list.add(out); hasValue = true; } } if (hasValue) { return list.toArray(new ItemStack[list.size()]); } } return null; }
@Override protected final void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) { final int ox = this.guiLeft; // (width - xSize) / 2; final int oy = this.guiTop; // (height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.drawBG(ox, oy, x, y); final List<Slot> slots = this.getInventorySlots(); for (final Slot slot : slots) { if (slot instanceof OptionalSlotFake) { final OptionalSlotFake fs = (OptionalSlotFake) slot; if (fs.renderDisabled()) { if (fs.isEnabled()) { this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18); } else { GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F); GL11.glEnable(GL11.GL_BLEND); this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopAttrib(); } } } } }