diff --git a/src/main/java/appeng/integration/Integrations.java b/src/main/java/appeng/integration/Integrations.java index 8f3d87caf..12a139cab 100644 --- a/src/main/java/appeng/integration/Integrations.java +++ b/src/main/java/appeng/integration/Integrations.java @@ -20,11 +20,11 @@ package appeng.integration; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; -import appeng.integration.modules.theoneprobe.TheOneProbeModule; +import appeng.integration.modules.theoneprobe.TOP; public class Integrations { public static void enqueueIMC(final InterModEnqueueEvent event) { - TheOneProbeModule.enqueueIMC(event); + TOP.enqueueIMC(event); } } diff --git a/src/main/java/appeng/integration/modules/theoneprobe/TOP.java b/src/main/java/appeng/integration/modules/theoneprobe/TOP.java new file mode 100644 index 000000000..c99fbe146 --- /dev/null +++ b/src/main/java/appeng/integration/modules/theoneprobe/TOP.java @@ -0,0 +1,31 @@ +/* + * This file is part of Applied Energistics 2. + * Copyright (c) 2020, AlgorithmX2, All rights reserved. + * + * Applied Energistics 2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Applied Energistics 2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Applied Energistics 2. If not, see . + */ + +package appeng.integration.modules.theoneprobe; + +import net.minecraftforge.fml.InterModComms; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; + +public class TOP { + public static void enqueueIMC(final InterModEnqueueEvent event) { + if (ModList.get().isLoaded("theoneprobe")) { + InterModComms.sendTo("theoneprobe", "getTheOneProbe", TheOneProbeModule::new); + } + } +} diff --git a/src/main/java/appeng/integration/modules/theoneprobe/TheOneProbeModule.java b/src/main/java/appeng/integration/modules/theoneprobe/TheOneProbeModule.java index ac83cda28..11d4eb384 100644 --- a/src/main/java/appeng/integration/modules/theoneprobe/TheOneProbeModule.java +++ b/src/main/java/appeng/integration/modules/theoneprobe/TheOneProbeModule.java @@ -1,6 +1,6 @@ /* * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved. + * Copyright (c) 2020, AlgorithmX2, All rights reserved. * * Applied Energistics 2 is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -20,9 +20,6 @@ package appeng.integration.modules.theoneprobe; import java.util.function.Function; -import net.minecraftforge.fml.InterModComms; -import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; - import mcjty.theoneprobe.api.ITheOneProbe; import appeng.integration.IIntegrationModule; @@ -30,10 +27,6 @@ import appeng.integration.modules.theoneprobe.config.AEConfigProvider; public class TheOneProbeModule implements IIntegrationModule, Function { - public static void enqueueIMC(final InterModEnqueueEvent event) { - InterModComms.sendTo("theoneprobe", "getTheOneProbe", TheOneProbeModule::new); - } - @Override public Void apply(ITheOneProbe input) { input.registerProbeConfigProvider(new AEConfigProvider());