Skip to content

Commit

Permalink
Fix clicking slot smith table. (Closes #1491)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Sep 19, 2024
1 parent 15c5e07 commit 9f8f2da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 9f8f2da

Please sign in to comment.