mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
[1.19.x] Add event for items being stacked or swapped in a GUI. (#9050)
This commit is contained in:
1 parent
bdba5ef2d3
commit
051db7907a
6 files changed
+172
-1
No files matched your search
@@ -60,7 +60,10 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.entity.ai.attributes.DefaultAttributes;
|
||||
import net.minecraft.world.entity.monster.EnderMan;
|
||||
import net.minecraft.world.entity.SlotAccess;
|
||||
import net.minecraft.world.inventory.ClickAction;
|
||||
import net.minecraft.world.inventory.ContainerLevelAccess;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
@@ -115,6 +118,7 @@ import net.minecraftforge.event.DifficultyChangeEvent;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.event.GrindstoneEvent;
|
||||
import net.minecraftforge.event.ItemAttributeModifierEvent;
|
||||
import net.minecraftforge.event.ItemStackedOnOtherEvent;
|
||||
import net.minecraftforge.event.ModMismatchEvent;
|
||||
import net.minecraftforge.event.ServerChatEvent;
|
||||
import net.minecraftforge.event.RegisterStructureConversionsEvent;
|
||||
@@ -266,6 +270,11 @@ public class ForgeHooks
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean onItemStackedOn(ItemStack carriedItem, ItemStack stackedOnItem, Slot slot, ClickAction action, Player player, SlotAccess carriedSlotAccess)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new ItemStackedOnOtherEvent(carriedItem, stackedOnItem, slot, action, player, carriedSlotAccess));
|
||||
}
|
||||
|
||||
public static void onDifficultyChange(Difficulty difficulty, Difficulty oldDifficulty)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new DifficultyChangeEvent(difficulty, oldDifficulty));
|
||||
|
||||
Reference in new issue
Block a user