Do not show incompatible client.

This commit is contained in:
IzzelAliz 2020-05-19 10:19:11 +08:00
parent be2a44e769
commit 5302b8f008

View File

@ -2,7 +2,11 @@ package io.izzel.arclight.mod;
import io.izzel.arclight.mod.server.event.ArclightEventDispatcherRegistry; import io.izzel.arclight.mod.server.event.ArclightEventDispatcherRegistry;
import net.minecraftforge.fml.CrashReportExtender; import net.minecraftforge.fml.CrashReportExtender;
import net.minecraftforge.fml.ExtensionPoint;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.network.FMLNetworkConstants;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.bukkit.craftbukkit.v1_14_R1.CraftCrashReport; import org.bukkit.craftbukkit.v1_14_R1.CraftCrashReport;
@ -16,5 +20,6 @@ public class ArclightMod {
LOGGER.info("Arclight Mod loaded."); LOGGER.info("Arclight Mod loaded.");
ArclightEventDispatcherRegistry.registerAllEventDispatchers(); ArclightEventDispatcherRegistry.registerAllEventDispatchers();
CrashReportExtender.registerCrashCallable("Arclight", () -> new CraftCrashReport().call().toString()); CrashReportExtender.registerCrashCallable("Arclight", () -> new CraftCrashReport().call().toString());
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true));
} }
} }