public Slot get(final LivingEntity p) {
if (!delayed) {
if (e instanceof PlayerItemHeldEvent && ((PlayerItemHeldEvent) e).getPlayer() == p) {
final PlayerInventory i = ((PlayerItemHeldEvent) e).getPlayer().getInventory();
assert i != null;
return new InventorySlot(i, getTime() >= 0 ? ((PlayerItemHeldEvent) e).getNewSlot() : ((PlayerItemHeldEvent) e).getPreviousSlot());
} else if (e instanceof PlayerBucketEvent && ((PlayerBucketEvent) e).getPlayer() == p) {
final PlayerInventory i = ((PlayerBucketEvent) e).getPlayer().getInventory();
assert i != null;
return new InventorySlot(i, ((PlayerBucketEvent) e).getPlayer().getInventory().getHeldItemSlot()) {
@Override
@Nullable
public ItemStack getItem() {
return getTime() <= 0 ? super.getItem() : ((PlayerBucketEvent) e).getItemStack();
}