Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
Fixed PlayerPickupItem event firing even if the player could not pick up the item.
Dieser Commit ist enthalten in:
Ursprung
98098481e9
Commit
ebfd973d09
@ -127,12 +127,12 @@ public class EntityItem extends Entity {
|
|||||||
int i = this.itemStack.count;
|
int i = this.itemStack.count;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (this.pickupDelay <= 0) { // <-- == to <=
|
if (this.pickupDelay <= 0 && entityhuman.inventory.canHold(this.itemStack)) { // <-- == to <=
|
||||||
Player player = (Player) entityhuman.getBukkitEntity();
|
Player player = (Player) entityhuman.getBukkitEntity();
|
||||||
PlayerPickupItemEvent event = new PlayerPickupItemEvent(player, (org.bukkit.entity.Item) this.getBukkitEntity());
|
PlayerPickupItemEvent event = new PlayerPickupItemEvent(player, (org.bukkit.entity.Item) this.getBukkitEntity());
|
||||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
world.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (event.isCancelled() || !entityhuman.inventory.canHold(this.itemStack)) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren