-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
displayTest option in mods.toml #8656
Conversation
This comment was marked as abuse.
This comment was marked as abuse.
|
I think it’d be good to also edit the MDK in this PR. |
One thing I want to make sure to caution. This is the display test compatibility flag. It has nothing to do with where the mod can load. Mods should always be loadable wherever they find themselves. There are a whole host of mechanisms to prevent unwanted code running on the wrong side (server vs client). This is 100% a utility for mods that tend to target one side or another and don't do network comms. |
This PR is awaiting some documentation in the mods.toml file. |
What about the case where the mod can be loaded on either side. I have a mod that has both server and client code and no network comms. I guess I could split into 2 mods, but having another option would be good to avoid people thinking a mod is only good for one side. |
The names are a bit misleading:
Personally, I'd change the names to:
|
I guess if not changed, I could put a comment on that line saying that mod includes client code |
If your mod works whatever version is on the other side, then it's truly two independent mods. But I very much doubt that's the case, and in fact, you want the standard network test, or some proper version checking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Principally this is fine, the removal of the extension points if not set is a bit of code smell to me.
But in general this if fine, as long as no mod code could have been run before this is executed (like the mod constructor).
if (displayTestSupplier != null) | ||
registerExtensionPoint(IExtensionPoint.DisplayTest.class, displayTestSupplier); | ||
else | ||
extensionPoints.remove(IExtensionPoint.DisplayTest.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal opinion: Removing the extension point is not a great idea.
But I guess this runs before mod construction so no extension point could have been registered so it should not really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's absolutely fine. Removing it completely is a totally legitimate option, as demonstrated by the lowcode langprovider. It also means that you can replace it with your own, if you wish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is my question basically: if there was already an option for MO code to run, is it then not feasible that a modder could already have it set? Or has no mod code been invoked at all at this point?
* "DEFAULT" (or none) is existing match version string behaviour * "CLIENTONLY" accepts anything and sends an empty string * "SERVERONLY" accepts anything and sends special SERVERONLY string Signed-off-by: cpw <cpw+github@weeksfamily.ca>
…in mdk. Signed-off-by: cpw <cpw+github@weeksfamily.ca>
same how was merged in (MinecraftForge#8656)
same how was merged in (#8656)
same how was merged in (MinecraftForge#8656)
same how was merged in (MinecraftForge#8656)
same how was merged in (MinecraftForge#8656)
same how was merged in (MinecraftForge#8656)
Signed-off-by: cpw cpw+github@weeksfamily.ca