3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

[Bleeding] Fixed NullPointerException in InventoryView.setCursor() if you tried to empty the cursor by setting it to null. Fixes BUKKIT-1043

Dieser Commit ist enthalten in:
Celtic Minstrel 2012-03-13 21:46:00 -04:00 committet von EvilSeph
Ursprung 288662bfae
Commit 93732e21bc

Datei anzeigen

@ -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
} }