|
22 | 22 |
|
23 | 23 | - this.tryPickItem(cloneItemStack); |
24 | 24 | + Location location = new Location(this.player.getBukkitEntity().getWorld(), blockPos.getX(), blockPos.getY(), blockPos.getZ()); |
25 | | -+ this.tryPickItem(cloneItemStack, location, null); |
| 25 | ++ this.tryPickItem(cloneItemStack, location, null, flag); |
26 | 26 | } |
27 | 27 | } |
28 | 28 | } |
|
31 | 31 | ItemStack pickResult = entity.getPickResult(); |
32 | 32 | if (pickResult != null && !pickResult.isEmpty()) { |
33 | 33 | - this.tryPickItem(pickResult); |
34 | | -+ this.tryPickItem(pickResult, null, entity.getBukkitEntity()); |
| 34 | ++ this.tryPickItem(pickResult, null, entity.getBukkitEntity(), this.player.hasInfiniteMaterials() && packet.includeData()); |
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
38 | 38 |
|
39 | 39 | - private void tryPickItem(ItemStack stack) { |
40 | | -+ private void tryPickItem(ItemStack stack, Location location, org.bukkit.entity.Entity entity) { |
| 40 | ++ private void tryPickItem(ItemStack stack, Location location, org.bukkit.entity.Entity entity, boolean isRequestingData) { |
41 | 41 | if (stack.isItemEnabled(this.player.level().enabledFeatures())) { |
42 | 42 | Inventory inventory = this.player.getInventory(); |
43 | 43 | int i = inventory.findSlotMatchingItem(stack); |
|
46 | 46 | final int targetSlot = Inventory.isHotbarSlot(sourceSlot) ? sourceSlot : inventory.getSuitableHotbarSlot(); |
47 | 47 | final org.bukkit.entity.Player bukkitPlayer = this.player.getBukkitEntity(); |
48 | 48 | - final io.papermc.paper.event.player.PlayerPickItemEvent event = new io.papermc.paper.event.player.PlayerPickItemEvent(bukkitPlayer, targetSlot, sourceSlot); |
49 | | -+ final io.papermc.paper.event.player.PlayerPickItemEvent event = new io.papermc.paper.event.player.PlayerPickItemEvent(bukkitPlayer, targetSlot, sourceSlot, location, entity); |
| 49 | ++ final io.papermc.paper.event.player.PlayerPickItemEvent event = new io.papermc.paper.event.player.PlayerPickItemEvent(bukkitPlayer, targetSlot, sourceSlot, location, entity, isRequestingData); |
50 | 50 | if (!event.callEvent()) { |
51 | 51 | return; |
52 | 52 | } |
|
0 commit comments