From 2e03112d2dc301e3a965d81bec70367e19e38f26 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 4 Mar 2016 15:50:35 +1100 Subject: [PATCH] SPIGOT-1721: Handle Enderman.getCarriedMaterial when not carrying. By: md_5 --- .../main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java index b1bf7a46ec..f602c2313c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntityEnderman; import net.minecraft.server.IBlockData; +import org.bukkit.Material; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.entity.Enderman; @@ -16,7 +17,7 @@ public class CraftEnderman extends CraftMonster implements Enderman { public MaterialData getCarriedMaterial() { IBlockData blockData = getHandle().getCarried(); - return CraftMagicNumbers.getMaterial(blockData.getBlock()).getNewData((byte) blockData.getBlock().toLegacyData(blockData)); + return (blockData == null) ? Material.AIR.getNewData((byte) 0) : CraftMagicNumbers.getMaterial(blockData.getBlock()).getNewData((byte) blockData.getBlock().toLegacyData(blockData)); } public void setCarriedMaterial(MaterialData data) {