Posted May 8, 20214 yr 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.
May 9, 20214 yr 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
May 9, 20214 yr 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?
May 9, 20214 yr 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
May 10, 20214 yr 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
May 10, 20214 yr Author 2 minutes ago, diesieben07 said: To be honest, I do not quite understand what you mean, no. Ok then, thanks for the help.
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.