From 3e5032caac63f1114784712d9badd272680842d5 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 17 Dec 2023 09:29:54 +1100 Subject: [PATCH] SPIGOT-6903, #1311: Add BlockData#getMapColor By: Miles Holder --- .../org/bukkit/craftbukkit/block/data/CraftBlockData.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java index 83e077d0ef..b822f1eb17 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -25,6 +25,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateBoolean; import net.minecraft.world.level.block.state.properties.BlockStateEnum; import net.minecraft.world.level.block.state.properties.BlockStateInteger; import net.minecraft.world.level.block.state.properties.IBlockState; +import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.SoundGroup; @@ -638,6 +639,11 @@ public class CraftBlockData implements BlockData { return state.isFaceSturdy(BlockAccessAir.INSTANCE, BlockPosition.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); } + @Override + public Color getMapColor() { + return Color.fromRGB(state.getMapColor(null, null).col); + } + @Override public Material getPlacementMaterial() { return CraftMagicNumbers.getMaterial(state.getBlock().asItem());