SPIGOT-6903, #1311: Add BlockData#getMapColor

This commit is contained in:
Miles Holder 2023-12-17 09:29:54 +11:00 committed by md_5
parent 1dbdbbed49
commit 2ab4508c08
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

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