From 2ad0303c5518c5fc1ebb01a2abf1d843450f7ee5 Mon Sep 17 00:00:00 2001 From: Kogepan229 <73163994+Kogepan229@users.noreply.github.com> Date: Tue, 16 Jun 2026 19:49:59 +0900 Subject: [PATCH] Fix WCT crafting action (#69) --- .../nee/nei/NEECraftingPreviewHandler.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingPreviewHandler.java b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingPreviewHandler.java index a76c297..edb3484 100644 --- a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingPreviewHandler.java +++ b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingPreviewHandler.java @@ -41,7 +41,6 @@ import codechicken.nei.PositionedStack; import codechicken.nei.recipe.IRecipeHandler; import codechicken.nei.recipe.TemplateRecipeHandler; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.ReflectionHelper; @@ -149,25 +148,13 @@ public class NEECraftingPreviewHandler { private void openCraftAmount(GuiContainer firstGui, ItemStack itemstack) { final IAEItemStack aeItemStack = AEItemStack.create(itemstack); - if (this.modID.equals(ModIDs.WCT)) { - ((AEBaseContainer) firstGui.inventorySlots).setTargetStack(aeItemStack); - sendToWirelessCraftingServer(); - } else if (this.modID.equals("AE")) { - ((AEBaseContainer) firstGui.inventorySlots).setTargetStack(aeItemStack); + if (firstGui.inventorySlots instanceof AEBaseContainer baseContainer) { + baseContainer.setTargetStack(aeItemStack); NetworkHandler.instance.sendToServer(new PacketInventoryAction(InventoryAction.AUTO_CRAFT, 0, 0)); } } - @Optional.Method(modid = ModIDs.WCT) - protected void sendToWirelessCraftingServer() { - net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketInventoryAction packet = new net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketInventoryAction( - InventoryAction.AUTO_CRAFT, - 0, - 0); - net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler.instance.sendToServer(packet); - } - @SubscribeEvent public void onGuiCraftConfirmOpen(GuiOpenEvent event) { if (this.patternCompound == null && this.tracker == null) {