diff --git a/Forge/build.gradle b/Forge/build.gradle index af240d63..90e7b4bd 100644 --- a/Forge/build.gradle +++ b/Forge/build.gradle @@ -78,8 +78,8 @@ dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" //compileOnly fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}") //runtimeOnly fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}") - runtimeOnly "curse.maven:geckolib-388172:${geckolib_file}" - compileOnly "curse.maven:geckolib-388172:${geckolib_file}" + runtimeOnly fg.deobf("curse.maven:geckolib-388172:${geckolib_file}") + compileOnly fg.deobf("curse.maven:geckolib-388172:${geckolib_file}") } tasks.named('processResources', ProcessResources).configure { diff --git a/Forge/src/main/java/software/bluelib/BlueLib.java b/Forge/src/main/java/software/bluelib/BlueLib.java index 65cb6fe6..c34b5008 100644 --- a/Forge/src/main/java/software/bluelib/BlueLib.java +++ b/Forge/src/main/java/software/bluelib/BlueLib.java @@ -61,6 +61,8 @@ public class BlueLib { */ public static final String MODID = "bluelib"; + public static final boolean EditorMode = false; + public static CommonProxy PROXY = DistExecutor.safeRunForDist(() -> ClientProxy::new, () -> CommonProxy::new); // public static final Logger LOGGER = LogUtils.getLogger(); @@ -78,10 +80,12 @@ public BlueLib() modEventBus.register(this); if (isDeveloperMode()) { - ModEntities.register(modEventBus); - MinecraftForge.EVENT_BUS.register(ReloadHandler.class); - modEventBus.addListener(this::setupComplete); - modEventBus.addListener(this::setupClient); + if (EditorMode) { + ModEntities.register(modEventBus); + MinecraftForge.EVENT_BUS.register(ReloadHandler.class); + modEventBus.addListener(this::setupComplete); + modEventBus.addListener(this::setupClient); + } } } diff --git a/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java b/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java index 187fc9ab..b3f17dc9 100644 --- a/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java +++ b/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java @@ -14,8 +14,10 @@ public class ClientEvents { public static void registerRenderers() { - // Register the renderer for all the Entities - EntityRenderers.register(ModEntities.DRAGON.get(), DragonRender::new); - EntityRenderers.register(ModEntities.REX.get(), RexRender::new); + if (BlueLib.EditorMode) { + // Register the renderer for all the Entities + EntityRenderers.register(ModEntities.DRAGON.get(), DragonRender::new); + EntityRenderers.register(ModEntities.REX.get(), RexRender::new); + } } } diff --git a/Forge/src/main/java/software/bluelib/example/event/CommonModEvent.java b/Forge/src/main/java/software/bluelib/example/event/CommonModEvent.java index c45cfb03..68c812de 100644 --- a/Forge/src/main/java/software/bluelib/example/event/CommonModEvent.java +++ b/Forge/src/main/java/software/bluelib/example/event/CommonModEvent.java @@ -12,7 +12,9 @@ public class CommonModEvent { @SubscribeEvent public static void onAttributeCreate(EntityAttributeCreationEvent pEvent) { + if (BlueLib.EditorMode) { pEvent.put(ModEntities.DRAGON.get(), DragonEntity.createAttributes().build()); pEvent.put(ModEntities.REX.get(), RexEntity.createAttributes().build()); } } +}