Don't mark Forge WorldEdit as required on client

Fixes #1343.
This commit is contained in:
Octavia Togami 2020-06-03 15:03:22 -07:00
parent e0346ff53b
commit e755acddc0
No known key found for this signature in database
GPG Key ID: CC364524D1983C99

View File

@ -54,6 +54,7 @@
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ExtensionPoint;
import net.minecraftforge.fml.ModContainer;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
@ -63,7 +64,9 @@
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
import net.minecraftforge.fml.network.FMLNetworkConstants;
import net.minecraftforge.registries.ForgeRegistries;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -107,6 +110,15 @@ public ForgeWorldEdit() {
MinecraftForge.EVENT_BUS.register(ThreadSafeCache.getInstance());
MinecraftForge.EVENT_BUS.register(this);
// Mark WorldEdit as only required on the server
ModLoadingContext.get().registerExtensionPoint(
ExtensionPoint.DISPLAYTEST,
() -> Pair.of(
() -> FMLNetworkConstants.IGNORESERVERONLY,
(a, b) -> true
)
);
}
private void init(FMLCommonSetupEvent event) {