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

Hello, I've recently decided to clean up my mod because it was a huge mess, so one thing I did was move all of the registration out of the one "registration" god class and divide the registration tasks into categories of block and item. Somewhere during this process, I must have gone wrong because my mod either fails to load or inevitably crashes when loading a world. I've played around with adding listeners and registering classes to the forge and mod busses, and gotten different errors. One thing I noticed is that they all lead to null pointers to items whose fields should have been injected from registries using the @ObjectHolder tag, so this is where I focused my research. I'm struggling to find anything about object holders, and beyond the idea that I didn't update the resource locations to match my new modid I'm stumped.

Latest Log and crash report (which correspond to the version on my repo) are attached.

Repo: https://github.com/eddie1101/PortalTest

Can someone tell me what I'm doing wrong?

latest.log crash-2021-02-01_20.37.37-client.txt

All of these methods are pointless, just call setRegistryName instead of calling a wrapper function that calls one line of code.

https://github.com/eddie1101/PortalTest/blob/c26623c062770115212536c540219f7abda1091f/src/main/java/erg/voidcraft/common/util/Util.java#L12

 

All of the declared types of these can just be Block

https://github.com/eddie1101/PortalTest/blob/c26623c062770115212536c540219f7abda1091f/src/main/java/erg/voidcraft/common/block/VoidcraftBlocks.java#L10-L14

Also, you haven't @ObjectHolder'd them, so you're not even using the thing you said you are in your thread title.

 

You aren't registering any blocks or items, because you haven't registered your classes with the event bus:

https://github.com/eddie1101/PortalTest/blob/c26623c062770115212536c540219f7abda1091f/src/main/java/erg/voidcraft/common/Voidcraft.java#L40

(You also aren't using the @EventBusSubscriber annotation)

 

Or the @SubscribeEvent annotation:

https://github.com/eddie1101/PortalTest/blob/master/src/main/java/erg/voidcraft/common/block/VoidcraftBlocks.java#L16

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
1 hour ago, Draco18s said:

Also, you haven't @ObjectHolder'd them, so you're not even using the thing you said you are in your thread title.

 

1 hour ago, Draco18s said:

(You also aren't using the @EventBusSubscriber annotation)

 

Or the @SubscribeEvent annotation:

Oh, I forgot all of the annotations in my blocks class. ¯\_(ツ)_/¯
Thanks for the eye.

 

 

If you use @Object holder, the field needs to be final and null, so you can't assign a value to it like you are.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.