|
9 | 9 | import org.bukkit.entity.Player; |
10 | 10 | import org.bukkit.event.Cancellable; |
11 | 11 | import org.bukkit.event.HandlerList; |
12 | | -@@ -21,14 +_,21 @@ |
13 | | - |
14 | | - private int targetSlot; |
15 | | - private int sourceSlot; |
| 12 | +@@ -24,6 +_,8 @@ |
| 13 | + |
| 14 | + private static final HandlerList HANDLER_LIST = new HandlerList(); |
| 15 | + |
16 | 16 | + private final Location location; |
17 | 17 | + private final Entity entity; |
18 | | -+ private boolean isRequestingData; |
19 | | -+ |
20 | | - |
| 18 | + private final boolean includeData; |
| 19 | + |
| 20 | + private int targetSlot; |
| 21 | +@@ -32,11 +_,13 @@ |
21 | 22 | private boolean cancelled; |
22 | 23 |
|
23 | 24 | @ApiStatus.Internal |
24 | | -- public PlayerPickItemEvent(final Player player, final int targetSlot, final int sourceSlot) { |
25 | | -+ public PlayerPickItemEvent(final Player player, final int targetSlot, final int sourceSlot, final Location location, final Entity entity, boolean isRequestingData) { |
| 25 | +- protected PlayerPickItemEvent(final Player player, final boolean includeData, final int targetSlot, final int sourceSlot) { |
| 26 | ++ public PlayerPickItemEvent(final Player player, final int targetSlot, final int sourceSlot, final Location location, final Entity entity, boolean includeData) { |
26 | 27 | super(player); |
| 28 | + this.includeData = includeData; |
27 | 29 | this.targetSlot = targetSlot; |
28 | 30 | this.sourceSlot = sourceSlot; |
29 | 31 | + this.location = location; |
30 | 32 | + this.entity = entity; |
31 | | -+ this.isRequestingData = isRequestingData; |
32 | 33 | } |
33 | 34 |
|
34 | 35 | /** |
35 | | -@@ -72,6 +_,18 @@ |
| 36 | +@@ -89,6 +_,14 @@ |
36 | 37 | public void setSourceSlot(final @Range(from = -1, to = 35) int sourceSlot) { |
37 | 38 | Preconditions.checkArgument(sourceSlot >= -1 && sourceSlot <= 35, "Source slot must be in range of the player's inventory slot, or -1"); |
38 | 39 | this.sourceSlot = sourceSlot; |
|
44 | 45 | + |
45 | 46 | + public @org.jetbrains.annotations.Nullable Entity getEntity() { |
46 | 47 | + return entity; |
47 | | -+ } |
48 | | -+ |
49 | | -+ public boolean isRequestingData() { |
50 | | -+ return isRequestingData; |
51 | 48 | } |
52 | 49 |
|
53 | 50 | @Override |
0 commit comments