From a7ebcfc611e69243639370ca1cba0023ea119525 Mon Sep 17 00:00:00 2001 From: HellFirePvP Date: Sun, 20 Dec 2015 17:12:07 +0100 Subject: [PATCH] - Mystcraft stuff --- .../client/fx/EntityFxFlowPolicy.java | 12 -------- .../mystcraft/EventHandlerMystcraft.java | 27 ++++++++++++++++++ .../mystcraft/IntegrationMystcraft.java | 28 +++++++++++++++++++ .../registration/RegisteredIntegrations.java | 6 +++- 4 files changed, 60 insertions(+), 13 deletions(-) delete mode 100644 src/main/java/makeo/gadomancy/client/fx/EntityFxFlowPolicy.java create mode 100644 src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java create mode 100644 src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java diff --git a/src/main/java/makeo/gadomancy/client/fx/EntityFxFlowPolicy.java b/src/main/java/makeo/gadomancy/client/fx/EntityFxFlowPolicy.java deleted file mode 100644 index d5bb90a..0000000 --- a/src/main/java/makeo/gadomancy/client/fx/EntityFxFlowPolicy.java +++ /dev/null @@ -1,12 +0,0 @@ -package makeo.gadomancy.client.fx; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - *

- * Created by HellFirePvP @ 17.11.2015 18:23 - */ -public class EntityFxFlowPolicy { -} diff --git a/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java b/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java new file mode 100644 index 0000000..bbb60a1 --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java @@ -0,0 +1,27 @@ +package makeo.gadomancy.common.integration.mystcraft; + +import com.xcompwiz.mystcraft.api.event.LinkEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import makeo.gadomancy.common.data.config.ModConfig; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by HellFirePvP @ 20.12.2015 15:53 + */ +public class EventHandlerMystcraft { + + @SubscribeEvent + public void onLink(LinkEvent.LinkEventAllow event) { + if(event.origin != null && event.origin.provider.dimensionId == ModConfig.dimOuterId) { + event.setCanceled(true); + } + if(event.destination != null && event.destination.provider.dimensionId == ModConfig.dimOuterId) { + event.setCanceled(true); + } + } + +} diff --git a/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java b/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java new file mode 100644 index 0000000..f9370e0 --- /dev/null +++ b/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java @@ -0,0 +1,28 @@ +package makeo.gadomancy.common.integration.mystcraft; + +import cpw.mods.fml.common.FMLCommonHandler; +import makeo.gadomancy.common.integration.IntegrationMod; +import net.minecraftforge.common.MinecraftForge; + +/** + * This class is part of the Gadomancy Mod + * Gadomancy is Open Source and distributed under the + * GNU LESSER GENERAL PUBLIC LICENSE + * for more read the LICENSE file + *

+ * Created by HellFirePvP @ 20.12.2015 15:50 + */ +public class IntegrationMystcraft extends IntegrationMod { + + @Override + public String getModId() { + return "Mystcraft"; + } + + @Override + protected void doInit() { + EventHandlerMystcraft eventHandler = new EventHandlerMystcraft(); + MinecraftForge.EVENT_BUS.register(eventHandler); + FMLCommonHandler.instance().bus().register(eventHandler); + } +} diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java index b21ac30..95be8ca 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java @@ -2,7 +2,9 @@ package makeo.gadomancy.common.registration; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; +import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.integration.*; +import makeo.gadomancy.common.integration.mystcraft.IntegrationMystcraft; import makeo.gadomancy.common.utils.Injector; /** @@ -18,6 +20,7 @@ public class RegisteredIntegrations { public static IntegrationThaumicExploration thaumicExploration; public static IntegrationAutomagy automagy; public static IntegrationNEI nei; + public static IntegrationMystcraft mystcraft; private RegisteredIntegrations() {} @@ -26,6 +29,7 @@ public class RegisteredIntegrations { thaumicExploration = registerIndependent(IntegrationThaumicExploration.class); automagy = registerIndependent(IntegrationAutomagy.class); nei = registerIndependent(IntegrationNEI.class); + mystcraft = registerIndependent(IntegrationMystcraft.class); registerDependent("ThaumicHorizons", "makeo.gadomancy.common.integration.thaumichorizions.IntegrationThaumicHorizions"); registerDependent("Waila", "makeo.gadomancy.common.integration.waila.IntegrationWaila"); @@ -58,7 +62,7 @@ public class RegisteredIntegrations { integration.init(); if(integration.isPresent()) { - FMLLog.severe("Initialized hook for mod \"" + integration.getModId() + "\"!"); + Gadomancy.log.info("Initialized hook for mod \"" + integration.getModId() + "\"!"); } return integration; }