mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
[Bleeding] Fixed NullPointerException in InventoryView.setCursor() if you tried to empty the cursor by setting it to null. Fixes BUKKIT-1043
This commit is contained in:
parent
288662bfae
commit
93732e21bc
@ -68,8 +68,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
}
|
||||
|
||||
public void setItemOnCursor(ItemStack item) {
|
||||
CraftItemStack stack = new CraftItemStack(item);
|
||||
getHandle().inventory.setCarried(stack.getHandle());
|
||||
net.minecraft.server.ItemStack stack = CraftItemStack.createNMSItemStack(item);
|
||||
getHandle().inventory.setCarried(stack);
|
||||
if (this instanceof CraftPlayer) {
|
||||
((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user