SPIGOT-6464: Fix ShulkerBox#getColor for undyed shulkers
This commit is contained in:
parent
d49530f9c4
commit
9c7acb6cbe
@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.sounds.SoundCategory;
|
||||
import net.minecraft.sounds.SoundEffects;
|
||||
import net.minecraft.world.item.EnumColor;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.BlockShulkerBox;
|
||||
import net.minecraft.world.level.block.entity.TileEntityShulkerBox;
|
||||
@ -39,9 +40,9 @@ public class CraftShulkerBox extends CraftLootable<TileEntityShulkerBox> impleme
|
||||
|
||||
@Override
|
||||
public DyeColor getColor() {
|
||||
net.minecraft.world.level.block.Block block = CraftMagicNumbers.getBlock(this.getType());
|
||||
EnumColor color = ((BlockShulkerBox) CraftMagicNumbers.getBlock(this.getType())).color;
|
||||
|
||||
return DyeColor.getByWoolData((byte) ((BlockShulkerBox) block).color.getColorIndex());
|
||||
return (color == null) ? null : DyeColor.getByWoolData((byte) color.getColorIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user