From 0259e52fa128802c8a78fb7538839a204e2ffd62 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 12 Nov 2015 20:06:58 +0100 Subject: [PATCH] Actually fixed Laser Relay Connection Issues --- .../ellpeck/actuallyadditions/ActuallyAdditions.java | 9 +++++---- .../actuallyadditions/event/WorldLoadingEvents.java | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java index 4b72f7b80..0f4db919e 100644 --- a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java +++ b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java @@ -31,10 +31,7 @@ import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.ItemCoffee; import ellpeck.actuallyadditions.material.InitArmorMaterials; import ellpeck.actuallyadditions.material.InitToolMaterials; -import ellpeck.actuallyadditions.misc.DispenserHandlerEmptyBucket; -import ellpeck.actuallyadditions.misc.DispenserHandlerFertilize; -import ellpeck.actuallyadditions.misc.DispenserHandlerFillBucket; -import ellpeck.actuallyadditions.misc.WorldData; +import ellpeck.actuallyadditions.misc.*; import ellpeck.actuallyadditions.network.PacketHandler; import ellpeck.actuallyadditions.ore.InitOreDict; import ellpeck.actuallyadditions.proxy.IProxy; @@ -124,6 +121,10 @@ public class ActuallyAdditions{ @EventHandler public void serverStarted(FMLServerStartedEvent event){ + if(LaserRelayConnectionHandler.getInstance() == null){ + LaserRelayConnectionHandler.setInstance(new LaserRelayConnectionHandler()); + } + WorldData.init(MinecraftServer.getServer()); } diff --git a/src/main/java/ellpeck/actuallyadditions/event/WorldLoadingEvents.java b/src/main/java/ellpeck/actuallyadditions/event/WorldLoadingEvents.java index a7c6ff860..204834bb0 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/WorldLoadingEvents.java +++ b/src/main/java/ellpeck/actuallyadditions/event/WorldLoadingEvents.java @@ -12,6 +12,7 @@ package ellpeck.actuallyadditions.event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import ellpeck.actuallyadditions.misc.LaserRelayConnectionHandler; +import ellpeck.actuallyadditions.misc.WorldData; import net.minecraftforge.event.world.WorldEvent; public class WorldLoadingEvents{ @@ -28,4 +29,9 @@ public class WorldLoadingEvents{ //Clear Data so that it won't be carried over to other worlds LaserRelayConnectionHandler.getInstance().networks.clear(); } + + @SubscribeEvent + public void onSave(WorldEvent.Save event){ + WorldData.makeDirty(); + } }