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.

JackSprat

Members
  • Joined

  • Last visited

  1. Is there any way to add a Tile Entity to a block that inherits from say, BlockStairs, without causing a NPE whenever Minecraft's code checks against a BlockContainer? I've been stuck on this code for a while and just realised Minecraft has a couple of places where it uses InstanceOf BlockContainer to handle TileEntities. And as Java doesn't have multiple inheritance, I'm kind of hoping I don't have to write an entirely new Stairs class and use up seventeen block IDs in the process. I'm almost resigned to it though. Recommendation for MC developers; move getTileEntity to Block?
  2. Where would the onBlockPlaced event be raised from, if not the world.setBlock function?
  3. For it to be effective the event would need to be fired including the Entity that caused the place event, which would mean that a modified setBlock/completely new method is required and all vanilla/mod files where a block is placed would have to use the new method and signature. Am I making sense or am I completely off the mark here?
  4. A sorted list of block locations per player might work, with simple binary search. Not the most efficient, but quick to implement and simple to use. Either way, from my knowledge, it's not possible to do this without quite a few Forge additions. And all mods having to change the way they set blocks.
  5. If you're trying to do it for every vanilla block then you're going to have to modify base classes. It's possible (and rather simple) to do this on your own blocks just by checking against TileEntity data with RemoveBlockByPlayer, setting the placer during OnBlockPlacedBy, and upping the resistance to make sure it's not damaged during explosions.

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.