diff options
author | Darkere <Dark-277@web.de> | 2020-05-17 12:13:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-17 11:13:55 +0100 |
commit | f3c21318b53ba130df59990b9330ccf615d2b9b8 (patch) | |
tree | 5bd8bc814ed43b003ac8631d4d5760f28c3e16d1 /spark-forge/src/main/java/me | |
parent | 66c4ad36bbdcf278665432c35e08584130a45fd3 (diff) | |
download | spark-f3c21318b53ba130df59990b9330ccf615d2b9b8.tar.gz spark-f3c21318b53ba130df59990b9330ccf615d2b9b8.tar.bz2 spark-f3c21318b53ba130df59990b9330ccf615d2b9b8.zip |
Allow forge mod on client side only (#51)
Diffstat (limited to 'spark-forge/src/main/java/me')
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java index 1f7199d..a1c7d55 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java @@ -24,6 +24,7 @@ import me.lucko.spark.forge.plugin.ForgeClientSparkPlugin; import me.lucko.spark.forge.plugin.ForgeServerSparkPlugin; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.ExtensionPoint; import net.minecraftforge.fml.ModContainer; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; @@ -32,6 +33,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.server.FMLServerStartingEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.loading.FMLPaths; +import net.minecraftforge.fml.network.FMLNetworkConstants; +import org.apache.commons.lang3.tuple.Pair; import java.nio.file.Path; @@ -44,6 +47,7 @@ public class ForgeSparkMod { public ForgeSparkMod() { FMLJavaModLoadingContext.get().getModEventBus().register(this); MinecraftForge.EVENT_BUS.register(this); + ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true)); } public String getVersion() { |