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

my mod has a "StructureManager" that overrides the ReloadListener <?> method. How do I register this listener correctly?
I created a Listener based on RecipeManager and saw that it registers to MinecraftServer. However, nothing works for me.
Here is an example of my registration code:

private void server(final FMLServerAboutToStartEvent event){

        LOGGER.info("SERVER ^>>>");

        event.getServer().getResourceManager().addReloadListener(structureManager);

}

Thank you in advance for your cooperation.

  • Author
3 hours ago, poopoodice said:

There's an AddReloadListenerEvent

Oh sorry i forgot to provide the version. my version is 1.15.2. as far as I know, what you anticipated for 1.16.x

  • Author
4 hours ago, poopoodice said:

Is the event being triggered? What's in your reload listener?

No, nothing starts. As I described the problem, I need a recipe file reloader. A very similar class -> RecipeManager. You gave a class that is not present in 1.15.2. How to be in this version?

  • Author
3 hours ago, diesieben07 said:

The event you are using currently should be fine for 1.15.2. If it is not triggering, you are not registering it correctly. Show how you register your event handler.

public ArchitectsDream() {

        final IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();

        eventBus.addListener(this::commonRegistry);

        eventBus.addListener(this::clientRegistry);

        eventBus.addListener(this::server);

}

"clientRegistry" and "commonRegistry" work

  • Author
On 5/9/2021 at 5:18 PM, diesieben07 said:

The event fires on the forge event bus.

Thank you more for your help, I don't even know how to thank you :)

However, in "gratitude" I would like to ask one more question.

The fact is that my Manager supports 3 types of files and for each I have my own deserializer. And this order of events does not quite fit in with the Forge ReloadListener, where the T type is essentially the file extension that is obtained after preparation. (like for example the same RecipeManager passes keys and JsonObject). In this case, is it better to inherit from IFutureReloadListener or can you do something differently?
(To put it simply, I wanted to say that the apply and prepare methods and the type T are not entirely appropriate and unnecessary).

I hope you understand what I mean :)

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.