From cec6accdea37e86552cfc6e9b5720059cf3dd70e Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 1 Nov 2019 13:22:57 +0100 Subject: [PATCH] Inventory Sorter integration --- .../IntegrationInventorySorter.java | 11 ----------- .../InventorySorterIntegration.java | 17 +++++++++++++++++ .../refinedstorage/setup/CommonSetup.java | 5 +++++ 3 files changed, 22 insertions(+), 11 deletions(-) delete mode 100644 src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/IntegrationInventorySorter.java create mode 100644 src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/InventorySorterIntegration.java diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/IntegrationInventorySorter.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/IntegrationInventorySorter.java deleted file mode 100644 index 365136886..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/IntegrationInventorySorter.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.inventorysorter; -/* -import net.minecraftforge.fml.common.event.FMLInterModComms; - -public class IntegrationInventorySorter { - public static void register() { - // Prevent items moving while scrolling through slots with Inventory Sorter in the Crafter Manager - FMLInterModComms.sendMessage("inventorysorter", "slotblacklist", "com.raoulvdberge.refinedstorage.container.slot.SlotCrafterManager"); - } -} - */ \ No newline at end of file diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/InventorySorterIntegration.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/InventorySorterIntegration.java new file mode 100644 index 000000000..b51068c4d --- /dev/null +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/inventorysorter/InventorySorterIntegration.java @@ -0,0 +1,17 @@ +package com.raoulvdberge.refinedstorage.integration.inventorysorter; + +import net.minecraftforge.fml.InterModComms; +import net.minecraftforge.fml.ModList; + +public class InventorySorterIntegration { + private static final String ID = "inventorysorter"; + + public static boolean isLoaded() { + return ModList.get().isLoaded(ID); + } + + public static void register() { + // Prevent items moving while scrolling through slots with Inventory Sorter in the Crafter Manager + InterModComms.sendTo("inventorysorter", "slotblacklist", () -> "com.raoulvdberge.refinedstorage.container.slot.CrafterManagerSlot"); + } +} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/setup/CommonSetup.java b/src/main/java/com/raoulvdberge/refinedstorage/setup/CommonSetup.java index b980bfe9e..a33b8f769 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/setup/CommonSetup.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/setup/CommonSetup.java @@ -33,6 +33,7 @@ import com.raoulvdberge.refinedstorage.capability.NetworkNodeProxyCapability; import com.raoulvdberge.refinedstorage.container.*; import com.raoulvdberge.refinedstorage.container.factory.*; import com.raoulvdberge.refinedstorage.integration.craftingtweaks.CraftingTweaksIntegration; +import com.raoulvdberge.refinedstorage.integration.inventorysorter.InventorySorterIntegration; import com.raoulvdberge.refinedstorage.item.*; import com.raoulvdberge.refinedstorage.item.blockitem.*; import com.raoulvdberge.refinedstorage.loottable.ControllerLootFunctionSerializer; @@ -139,6 +140,10 @@ public class CommonSetup { if (CraftingTweaksIntegration.isLoaded()) { CraftingTweaksIntegration.register(); } + + if (InventorySorterIntegration.isLoaded()) { + InventorySorterIntegration.register(); + } } private INetworkNode readAndReturn(CompoundNBT tag, NetworkNode node) {