mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-21 05:44:33 +00: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
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