mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
SPIGOT-6464: Fix ShulkerBox#getColor for undyed shulkers
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d8a90faeb1
commit
4d77463831
1 changed files with 3 additions and 2 deletions
|
@ -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…
Reference in a new issue