mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 01:25:03 +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) {
|
public void setItemOnCursor(ItemStack item) {
|
||||||
CraftItemStack stack = new CraftItemStack(item);
|
net.minecraft.server.ItemStack stack = CraftItemStack.createNMSItemStack(item);
|
||||||
getHandle().inventory.setCarried(stack.getHandle());
|
getHandle().inventory.setCarried(stack);
|
||||||
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…
Add table
Reference in a new issue