Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 46 lines 1.1 kB view raw
1package org.bukkit.event.player; 2 3import org.bukkit.entity.Item; 4import org.bukkit.entity.Player; 5import org.bukkit.event.Cancellable; 6 7/** 8 * Thrown when a player picks an item up from the ground 9 */ 10public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { 11 private final Item item; 12 private boolean cancel = false; 13 private int remaining; 14 15 public PlayerPickupItemEvent(final Player player, final Item item, int remaining) { 16 super(Type.PLAYER_PICKUP_ITEM, player); 17 this.item = item; 18 this.remaining = remaining; 19 } 20 21 /** 22 * Gets the ItemDrop created by the player 23 * 24 * @return Item 25 */ 26 public Item getItem() { 27 return item; 28 } 29 30 /** 31 * Gets the amount remaining on the ground, if any 32 * 33 * @return amount remaining on the ground 34 */ 35 public int getRemaining() { 36 return remaining; 37 } 38 39 public boolean isCancelled() { 40 return cancel; 41 } 42 43 public void setCancelled(boolean cancel) { 44 this.cancel = cancel; 45 } 46}