Permalink
Browse files

Fixed PlayerPickupItem event returning wrong amount picked up and add…

…ed function to get the amount remaining on the ground.
  • Loading branch information...
1 parent 38863ab commit b2e236878c8a3251cc768f47ccc5dfdb3244d9fd EvilSeph committed Jul 2, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
@@ -10,10 +10,12 @@
public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
private final Item item;
private boolean cancel = false;
+ private int remaining;
- public PlayerPickupItemEvent(final Player player, final Item item) {
+ public PlayerPickupItemEvent(final Player player, final Item item, int remaining) {
super(Type.PLAYER_PICKUP_ITEM, player);
this.item = item;
+ this.remaining = remaining;
}
/**
@@ -26,6 +28,15 @@ public Item getItem() {
}
/**
+ * Gets the amount remaining on the ground, if any
+ *
+ * @return amount remaining on the ground
+ */
+ public int getRemaining() {
+ return remaining;
+ }
+
+ /**
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*

0 comments on commit b2e2368

Please sign in to comment.