diff options
author | makamys <makamys@outlook.com> | 2022-06-22 11:41:36 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-22 11:42:37 +0200 |
commit | 676caee4d37d6de8e0f170f3fd22c578b595e2fa (patch) | |
tree | 9f727a9dd3c78669e9e34c33b909365b4c519ff9 /src/main/java | |
parent | d7852470c3618466aa8105c97bd6786cafb45756 (diff) | |
download | Neodymium-676caee4d37d6de8e0f170f3fd22c578b595e2fa.tar.gz Neodymium-676caee4d37d6de8e0f170f3fd22c578b595e2fa.tar.bz2 Neodymium-676caee4d37d6de8e0f170f3fd22c578b595e2fa.zip |
Fix `enabled` config option not working properly when disabled
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/makamys/neodymium/Neodymium.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/makamys/neodymium/Neodymium.java b/src/main/java/makamys/neodymium/Neodymium.java index d70330a..22bcade 100644 --- a/src/main/java/makamys/neodymium/Neodymium.java +++ b/src/main/java/makamys/neodymium/Neodymium.java @@ -17,6 +17,7 @@ import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLConstructionEvent; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerAboutToStartEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; @@ -72,6 +73,12 @@ public class Neodymium MinecraftForge.EVENT_BUS.register(this); } + @EventHandler + public void onServerAboutToStart(FMLServerAboutToStartEvent event) + { + Config.reloadConfig(); + } + private void onPlayerWorldChanged(World newWorld) { if(getRendererWorld() == null && newWorld != null) { Config.reloadConfig(); @@ -91,6 +98,8 @@ public class Neodymium @SubscribeEvent @SideOnly(Side.CLIENT) public void onWorldUnload(WorldEvent.Unload event) { + if(!Config.enabled) return; + if(event.world == getRendererWorld()) { onPlayerWorldChanged(null); } @@ -115,6 +124,8 @@ public class Neodymium @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { + if(!Config.enabled) return; + if(event.phase == TickEvent.Phase.START) { if(Config.hotswap) { if(Config.reloadIfChanged()) { @@ -128,6 +139,8 @@ public class Neodymium @SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event) { + if(!Config.enabled) return; + if(event.phase == TickEvent.Phase.START) { if(isActive()) { renderer.serverTick(); @@ -137,6 +150,8 @@ public class Neodymium @SubscribeEvent public void onRenderTick(TickEvent.RenderTickEvent event) { + if(!Config.enabled) return; + if(event.phase == TickEvent.Phase.START) { if(MixinConfigPlugin.isOptiFinePresent()) { try { |