From 9f8f2dac7406d93fe8e79e2bb72663fa85cb7194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E9=9B=A8=E8=90=BD?= Date: Thu, 19 Sep 2024 22:06:15 +0800 Subject: [PATCH] Fix clicking slot smith table. (Closes #1491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秋雨落 --- .../core/world/inventory/SmithingTableContainerMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/inventory/SmithingTableContainerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/inventory/SmithingTableContainerMixin.java index b0ff3a94e..9776f63a1 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/inventory/SmithingTableContainerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/inventory/SmithingTableContainerMixin.java @@ -2,6 +2,7 @@ import io.izzel.arclight.common.bridge.core.entity.player.PlayerEntityBridge; import io.izzel.arclight.common.bridge.core.util.IWorldPosCallableBridge; +import io.izzel.arclight.mixin.Decorate; import io.izzel.arclight.mixin.DecorationOps; import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.inventory.SmithingMenu; @@ -14,14 +15,13 @@ import org.bukkit.event.inventory.PrepareSmithingEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(SmithingMenu.class) public abstract class SmithingTableContainerMixin extends ItemCombinerMixin { private CraftInventoryView bukkitEntity; - @Redirect(method = "createResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/inventory/ResultContainer;setItem(ILnet/minecraft/world/item/ItemStack;)V")) + @Decorate(method = "createResult", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/inventory/ResultContainer;setItem(ILnet/minecraft/world/item/ItemStack;)V")) private void arclight$prepareSmithing(ResultContainer craftResultInventory, int index, ItemStack stack) throws Throwable { PrepareSmithingEvent event = new PrepareSmithingEvent(getBukkitView(), CraftItemStack.asCraftMirror(stack).clone()); Bukkit.getServer().getPluginManager().callEvent(event);