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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Then why does said non-existent instance need to know? Probably.
  2. Entity AI tasks have access to the Entity they're acting on. Entities have a World object and a Position. World object + Position -> Get block, tile entity, and capabilities.
  3. Your TE class shouldn't even be instanced for inventory render.
  4. There should never be any reason (that I know of) for a ChunkCache to be passed to that method.
  5. You probably can't, then. What are you trying to do?
  6. 1) Not in vanilla and not in most mods. 2) Always do an instanceof check before casting. 3) There is no other way than the IBlockAccess passed to the method.
  7. They're either bezier curves or splines. You'd likely have to write the math for them yourself
  8. ...Only override it if your block has a tile entity. Overriding to return false/null is stupid because Block already does that.
  9. That said, I personally prefer the "ClientProxy extends CommonProxy" (where Common == Server, just all the methods are blank) setup over the IProxy method (where I'd still need a server side implementation to avoid NPE, where all the methods are, again, blank). The thing that I really hate is the Main Mod hands off the init event to the Proxy which then hands off the init event to ModBlocks and everything is done there (and the event object goes untouched). Like, seriously, WHY DID YOU BOTHER PASSING IT ALONG.
  10. You don't need a TE, ITickable, or even a custom block. You just need to check on block placement if there's a valid structure. For vanilla blocks, you'll need to use events. For your own blocks you can use Block#onPlacedByPlayer (If I remember the method name correctly).
  11. if the stack size is greater than one, split off the extra, shove them into the player's inventory, then open the gui.
  12. Something like that. I was tired.
  13. How about you check for null instead? Try...catch is actually pretty CPU intensive.
  14. ITileEntityProvider is the Mojang way. Forge patches things so that it's not needed and uses the newer, better, IBlockState parameter rather than the old metadata parameter. So yes, not using BlockContainer is better in all the ways. Don't use it.
  15. Having to repeatedly ask everybody the same stupid question is why I don't have any patience. There's a reason the "Frequently Asked Questions" thread is actually called the "Excessively Asked Questions" thread. Asking "I overrode the method, but didn't put anything in it, nothing changed" is pretty freaking dumb. Of course nothing changed, the default behavior is an empty method. Right click -> Find all references.
  16. Everything. It's based on an interface that isn't needed, overrides several methods that you have to override again to get back the (desired) default behavior...
  17. More like the basics of Java. Method overriding isn't that hard, looking at examples in vanilla isn't that hard either, and intuiting what the method should do based on the parameter names, return type, and javadoc isn't super complicated.
  18. Seriously, what? https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/item/ItemRawOre.java#L52 Fuck. Yes you are. You have Minecraft.getMinecraft() in your ModBlocks class and it's not marked Side Only: Client. Your ModBlocks class is common code. Therefor you have client-only code in a common location. THIS WILL CRASH THE DEDICATED SERVER. Don't believe me? Hit the little ▼ next to the Run button and click "Server"
  19. WRONG SIR. All you need to do is override the hasTileEntity and getTileEntity methods in the Block class. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/block/BlockMillstone.java#L36 https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/block/BlockMillstone.java#L63-L71
  20. So, a couple things. 1) You can't register the renderer in common code. 2) If a subtype isn't showing up in the creative menu, that's because you haven't overriden getSubItemsin your Item class.

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.