mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-1721: Handle Enderman.getCarriedMaterial when not carrying.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
b3cf0dfe0a
commit
2e03112d2d
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue