Posted June 18, 201510 yr Hello everyone, I got a GUI in which I need to read data from a furnace. So I am delivering the ISidedInventory of the furnace via a container. My Problem right now is that for some reason ISidedInventory.getField(2) is ALWAYS returning 0, even if it should be the cook time of the current item.. Of course I placed coal and iron ore in the furnace to make it burn public class FurnacesGui extends GuiContainer{ private final ResourceLocation background = new ResourceLocation("advancedfurnaces:textures/gui/allfurnaces.png"); private int furnaceSlots; private ISidedInventory[] furnaces; public FurnacesGui(ContainerAllFurnaces container) { super(container); furnaceSlots = container.getAllFurnaceSlots(); furnaces=container.getFurnaces(); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(background); int k = (this.width - this.xSize) /2 ; int l = (this.height - this.xSize) /2 ; drawTexturedModalRect(k, l, 0, 0, xSize, ySize); int pixelToDraw; for(int i=0; i<furnaceSlots; i++) { pixelToDraw= 22*furnaces[i].getField(2)/furnaces[i].getField(3); System.out.println(furnaces[i].getField(2)); System.out.println(furnaces[i]); drawTexturedModalRect(k+10+20*i, l+10, 206, 0, 16, 60); drawTexturedModalRect(k+11+20*i, l+29, 224, 0, 16, pixelToDraw); } } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.