Skip to content

Commit

Permalink
Fix onItemStackedOn not fired (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Feb 2, 2024
1 parent 7a40f10 commit 2d5fde2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.registries.ForgeRegistries;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v.entity.CraftHumanEntity;
Expand Down Expand Up @@ -68,6 +69,7 @@ public abstract class AbstractContainerMenuMixin implements ContainerBridge {
@Shadow protected abstract SlotAccess createCarriedSlotAccess();
@Shadow public abstract void sendAllDataToRemote();
@Shadow public abstract int incrementStateId();
@Shadow protected abstract boolean tryItemClickBehaviourOverride(Player p_249615_, ClickAction p_250300_, Slot p_249384_, ItemStack p_251073_, ItemStack p_252026_);
// @formatter:on

public boolean checkReachable = true;
Expand Down Expand Up @@ -245,7 +247,7 @@ private void doClick(int slotId, int dragType, ClickType clickType, Player playe
ItemStack itemstack10 = slot7.getItem();
ItemStack itemstack11 = this.getCarried();
player.updateTutorialInventoryAction(itemstack11, slot7.getItem(), clickaction);
if (!itemstack11.overrideStackedOnOther(slot7, clickaction, player) && !itemstack10.overrideOtherStackedOnMe(itemstack11, slot7, clickaction, player, this.createCarriedSlotAccess())) {
if (!this.tryItemClickBehaviourOverride(player, clickaction, slot7, itemstack10, itemstack11) && !ForgeHooks.onItemStackedOn(itemstack10, itemstack11, slot7, clickaction, player, this.createCarriedSlotAccess())) {
if (itemstack10.isEmpty()) {
if (!itemstack11.isEmpty()) {
int l2 = clickaction == ClickAction.PRIMARY ? itemstack11.getCount() : 1;
Expand Down

0 comments on commit 2d5fde2

Please sign in to comment.