Inventory Sorter integration

This commit is contained in:
raoulvdberge
2019-11-01 13:22:57 +01:00
parent defab90d8c
commit cec6accdea
3 changed files with 22 additions and 11 deletions

View File

@@ -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");
}
}
*/

View File

@@ -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");
}
}

View File

@@ -33,6 +33,7 @@ import com.raoulvdberge.refinedstorage.capability.NetworkNodeProxyCapability;
import com.raoulvdberge.refinedstorage.container.*; import com.raoulvdberge.refinedstorage.container.*;
import com.raoulvdberge.refinedstorage.container.factory.*; import com.raoulvdberge.refinedstorage.container.factory.*;
import com.raoulvdberge.refinedstorage.integration.craftingtweaks.CraftingTweaksIntegration; import com.raoulvdberge.refinedstorage.integration.craftingtweaks.CraftingTweaksIntegration;
import com.raoulvdberge.refinedstorage.integration.inventorysorter.InventorySorterIntegration;
import com.raoulvdberge.refinedstorage.item.*; import com.raoulvdberge.refinedstorage.item.*;
import com.raoulvdberge.refinedstorage.item.blockitem.*; import com.raoulvdberge.refinedstorage.item.blockitem.*;
import com.raoulvdberge.refinedstorage.loottable.ControllerLootFunctionSerializer; import com.raoulvdberge.refinedstorage.loottable.ControllerLootFunctionSerializer;
@@ -139,6 +140,10 @@ public class CommonSetup {
if (CraftingTweaksIntegration.isLoaded()) { if (CraftingTweaksIntegration.isLoaded()) {
CraftingTweaksIntegration.register(); CraftingTweaksIntegration.register();
} }
if (InventorySorterIntegration.isLoaded()) {
InventorySorterIntegration.register();
}
} }
private INetworkNode readAndReturn(CompoundNBT tag, NetworkNode node) { private INetworkNode readAndReturn(CompoundNBT tag, NetworkNode node) {