diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/IntegrationFunkyLocomotion.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/IntegrationFunkyLocomotion.java index c705def51..7a9a88989 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/IntegrationFunkyLocomotion.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/IntegrationFunkyLocomotion.java @@ -1,9 +1,9 @@ package com.raoulvdberge.refinedstorage.integration.funkylocomotion; -import com.rwtema.funkylocomotion.api.FunkyRegistry; +import net.minecraftforge.fml.common.Loader; public final class IntegrationFunkyLocomotion { public static boolean isLoaded() { - return FunkyRegistry.INSTANCE != null; + return Loader.isModLoaded("funkylocomotion"); } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/MoveFactoryRegisterer.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/MoveFactoryRegisterer.java new file mode 100644 index 000000000..808fe8c6a --- /dev/null +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/funkylocomotion/MoveFactoryRegisterer.java @@ -0,0 +1,18 @@ +package com.raoulvdberge.refinedstorage.integration.funkylocomotion; + +import com.raoulvdberge.refinedstorage.block.BlockBase; +import com.raoulvdberge.refinedstorage.block.BlockNode; +import com.rwtema.funkylocomotion.api.FunkyRegistry; +import net.minecraft.block.Block; + +import java.util.List; + +public class MoveFactoryRegisterer { + public static void register(List blocks) { + for (Block block : blocks) { + if (block instanceof BlockNode) { + FunkyRegistry.INSTANCE.registerMoveFactoryBlock(block, new MoveFactoryNetworkNode()); + } + } + } +} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java index 2718397fd..fbfd10770 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java @@ -20,13 +20,12 @@ import com.raoulvdberge.refinedstorage.apiimpl.network.readerwriter.ReaderWriter import com.raoulvdberge.refinedstorage.apiimpl.network.readerwriter.ReaderWriterHandlerRedstone; import com.raoulvdberge.refinedstorage.apiimpl.solderer.SoldererRecipeLoader; import com.raoulvdberge.refinedstorage.block.BlockBase; -import com.raoulvdberge.refinedstorage.block.BlockNode; import com.raoulvdberge.refinedstorage.capability.CapabilityNetworkNodeProxy; import com.raoulvdberge.refinedstorage.gui.GuiHandler; import com.raoulvdberge.refinedstorage.integration.craftingtweaks.IntegrationCraftingTweaks; import com.raoulvdberge.refinedstorage.integration.forgeenergy.ReaderWriterHandlerForgeEnergy; import com.raoulvdberge.refinedstorage.integration.funkylocomotion.IntegrationFunkyLocomotion; -import com.raoulvdberge.refinedstorage.integration.funkylocomotion.MoveFactoryNetworkNode; +import com.raoulvdberge.refinedstorage.integration.funkylocomotion.MoveFactoryRegisterer; import com.raoulvdberge.refinedstorage.integration.oc.DriverNetwork; import com.raoulvdberge.refinedstorage.integration.oc.IntegrationOC; import com.raoulvdberge.refinedstorage.integration.projecte.IntegrationProjectE; @@ -40,7 +39,6 @@ import com.raoulvdberge.refinedstorage.tile.grid.WirelessGrid; import com.raoulvdberge.refinedstorage.tile.grid.portable.PortableGrid; import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid; import com.raoulvdberge.refinedstorage.util.StackUtils; -import com.rwtema.funkylocomotion.api.FunkyRegistry; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentData; @@ -268,13 +266,11 @@ public class ProxyCommon { @SubscribeEvent public void registerBlocks(RegistryEvent.Register e) { - blocksToRegister.forEach(b -> { - if (b instanceof BlockNode && IntegrationFunkyLocomotion.isLoaded()) { - FunkyRegistry.INSTANCE.registerMoveFactoryBlock(b, new MoveFactoryNetworkNode()); - } + blocksToRegister.forEach(e.getRegistry()::register); - e.getRegistry().register(b); - }); + if (IntegrationFunkyLocomotion.isLoaded()) { + MoveFactoryRegisterer.register(blocksToRegister); + } } @SubscribeEvent