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.

TheOther

Members
  • Joined

  • Last visited

  1. Okay, so it appears that event.blockMetadata always is 0, so I found a better way, event.world.getBlockMetadata(event.x, event.y, event.z) . However, in the console, the event fires twice for each block, initially getting the metadata correct, but then firing the event with a metadata of 0 as well, which makes a different liquid. How would I get around this?
  2. Wouldn't 32bit make your game even slower?
  3. You're kind of right. My console messages print whenever any block is placed, not just tin, and they always print a metadata of 0. But thanks for the heads up, I'll change my code.
  4. I have some code that turns metal blocks into fluids in a custom dimension, and while testing it against some blocks that are only metal via metadata, it only spawned the fluid which was for the metadata of 0. After debugging a little, I found that the metadata of the block placed is always zero, regardless of the block. I was wondering how to fix this. Code: if(OreDictionary.doesOreNameExist("blockTin")) { for(ItemStack ore : OreDictionary.getOres("blockTin")) { if(ore != null) { if(event.block == Block.getBlockFromItem(ore.getItem()) && event.blockMetadata == ore.getItemDamage()) { System.out.println("block=" + Block.getBlockFromItem(ore.getItem()) + ", meta=" + ore.getItemDamage()); System.out.println("event.block=" + event.block + ", event.meta=" + event.blockMetadata); if(FluidRegistry.getFluid("tin.molten") != null) { event.world.setBlock(event.x, event.y, event.z, FluidRegistry.getFluid("tin.molten").getBlock()); } else { event.world.setBlock(event.x, event.y, event.z, Blocks.lava); } } } } }

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.