Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented modular SubMod loading #90

Merged
merged 2 commits into from
Apr 7, 2019

Conversation

FiskFille
Copy link

  • the config UI that comes with it


LOGGER.info("Loaded submod {} from class {}.", modName, data.getClassName());
}
else if (!requiresMcRestart)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does requiring a restart prevent it from being registered into the event bus, these seem like completely isolated properties?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since event handlers can't be unregistered, they're only registered for that submod if
A) it's loaded during startup (L56), or
B) it won't require a restart.

Submods that don't require a restart are expected to limit their features to when they're enabled, so they get their handlers registered on init regardless if they're enabled or not.

return INSTANCE.loadedSubMods.contains(INSTANCE.subMods.get(subMod));
}

public static boolean unload(ISubMod subMod)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Event listeners of the sub mod (registered by default by this PR) are not unregistered when it is unloaded?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Event handlers are dynamically generated using ASM by Forge, so unregistering one post-init wouldn't change anything.

@Darkhax Darkhax merged commit ceba7ac into MinecraftModDevelopmentMods:master Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants