Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
SPIGOT-1721: Handle Enderman.getCarriedMaterial when not carrying.
Dieser Commit ist enthalten in:
Ursprung
6742811d69
Commit
7863085a62
@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.entity;
|
|||||||
import net.minecraft.server.EntityEnderman;
|
import net.minecraft.server.EntityEnderman;
|
||||||
|
|
||||||
import net.minecraft.server.IBlockData;
|
import net.minecraft.server.IBlockData;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||||
import org.bukkit.entity.Enderman;
|
import org.bukkit.entity.Enderman;
|
||||||
@ -16,7 +17,7 @@ public class CraftEnderman extends CraftMonster implements Enderman {
|
|||||||
|
|
||||||
public MaterialData getCarriedMaterial() {
|
public MaterialData getCarriedMaterial() {
|
||||||
IBlockData blockData = getHandle().getCarried();
|
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) {
|
public void setCarriedMaterial(MaterialData data) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren