mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
[Bleeding] Fixed NullPointerException in InventoryView.setCursor() if you tried to empty the cursor by setting it to null. Fixes BUKKIT-1043
By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
parent
b350a11bc0
commit
5f0bee3860
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue