package com.anthonyhilyard.iceberg.events;
import net.minecraftforge.event.entity.player.PlayerEvent;
import java.util.UUID;
import net.minecraft.client.Minecraft;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
/**
* This event is fired right before a player picks up a new item. Unlike EntityItemPickupEvent, this event fires on the logical client.
*
* This event is not {@link net.minecraftforge.eventbus.api.Cancelable}.
*
* This event does not have a result. {@link HasResult}
*
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.
*/
@SuppressWarnings("null")
public class NewItemPickupEvent extends PlayerEvent
{
private final ItemStack itemStack;
public NewItemPickupEvent(Player player, ItemStack itemStack)
{
super(player);
this.itemStack = itemStack;
}
@SuppressWarnings("resource")
public NewItemPickupEvent(UUID playerUUID, ItemStack itemStack)
{
this(Minecraft.getInstance().level.getPlayerByUUID(playerUUID), itemStack);
}
public ItemStack getItemStack()
{
return itemStack;
}
}