Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.