CreeperHost / FTB-Backups-2

7 stars 9 forks source link

Suggestion: Adapt the displayTest property in mod init to prevent modlist handshake mismatch #26

Closed Raidobw2 closed 1 year ago

Raidobw2 commented 1 year ago

This is a suggestion to adapt the displayTest property for the modlist handshake at https://github.com/CreeperHost/FTB-Backups-2/blob/57be6d5f7e398f709274bdd07c96b09470e4f176/forge/src/main/java/net/creeperhost/ftbbackups/forge/FTBBackupsForge.java#L10-L14

Since technically FTB Backups 2 is optional everywhere, this would make sense.

You could use ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (a, b) -> true));, which I've taken from https://docs.minecraftforge.net/en/1.19.x/concepts/sides/#writing-one-sided-mods. Change the value of IGNORESERVERONLY to something else, possibly IGNORE_ALL_VERSION? This would work for 1.19 -- but I'm guessing for 1.18 too, Forge's handshake probably didn't change much?

The request is mainly for 1.18.X, if that's possible.

If you need to see an example, Rubidium is a client-only mod that does it this way https://github.com/Asek3/Rubidium/blob/deb88f404fe4a0ea4aff1b380226bb3d97b0cf69/src/main/java/me/jellysquid/mods/sodium/client/SodiumClientMod.java#L39

Since FTB Backups 2 looks to be a server-only mod that's optional everywhere, it probably needs to be adapted with the info above and not look exactly like Rubidium is

Thanks a lot for checking if this enhancement is worth looking into :) and have a good day

Raidobw2 commented 1 year ago

Just a visual in case it's helpful, I forgot to mention it. The displayTest property affects what you see in main menu image

FTB Backups 2 shows a red X if the mod is installed on the client but not on the server, that's basically it

gigabit101 commented 1 year ago

Added in latest commit to 1.19.2, will backport soon

Raidobw2 commented 1 year ago

Thanks a bunch!