SPIGOT-6903, #1311: Add BlockData#getMapColor

By: Miles Holder <mwholder2005@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2023-12-17 09:29:54 +11:00
parent bbb64e5e0e
commit 3e5032caac

View file

@ -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());