mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 05:25:42 +01:00
Make setting slots to AIR set them to null. Addresses BUKKIT-1043
This commit is contained in:
parent
68c89fcac9
commit
f534863552
@ -69,7 +69,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
|
|
||||||
public void setItemOnCursor(ItemStack item) {
|
public void setItemOnCursor(ItemStack item) {
|
||||||
CraftItemStack stack = new CraftItemStack(item.getType(), item.getAmount(), item.getDurability());
|
CraftItemStack stack = new CraftItemStack(item.getType(), item.getAmount(), item.getDurability());
|
||||||
getHandle().inventory.setCarried(stack.getHandle());
|
getHandle().inventory.setCarried(stack.getType() == Material.AIR ? null : stack.getHandle());
|
||||||
if (this instanceof CraftPlayer) {
|
if (this instanceof CraftPlayer) {
|
||||||
((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor
|
((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user