FTB Backups 2

FTB Backups 2

16M Downloads

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

Raidobw2 opened this issue ยท 3 comments

commented

This is a suggestion to adapt the displayTest property for the modlist handshake at

public FTBBackupsForge() {
// Submit our event bus to let architectury register our content on the right time
EventBuses.registerModEventBus(FTBBackups.MOD_ID, FMLJavaModLoadingContext.get().getModEventBus());
FTBBackups.init();
}

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

commented

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

commented

Added in latest commit to 1.19.2, will backport soon

commented

Thanks a bunch!