Posted November 5, 201212 yr is there a way i can check if a certain item is in the smeltable slot in the furnace. (where iron ore, gold ore, etc goes). I'm trying to make a block change its texture depending on what item is in the smeltable slot. I tried an if statement like: if (tile.inv[0] == new ItemStack(Item.wheat)) { bindTextureByName("/****/****/*********.png"); } where "tile" is the tileEntity, "inv" is the inventory slot, and "[0]" is the smeltable slot. instead of changing the texture to what i want it just changes it to a glitchy terrain.png.
November 7, 201212 yr For the compare you'll want to compare the IDs of the items or (even better) use isItemEqual, rather than comparing the address of the new item stack against a different one in your tile. if(tile.inv[0].isItemEqual(new ItemStack(Item.wheat)) ..... or maybe if(tile.inv[0].itemID == Item.wheat.shiftedIndex).... Check TileEntityFurnace (functions canSmelt and smeltItem) for examples of checking what is where. Not sure about your texture problem.
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.