architectury-api icon indicating copy to clipboard operation
architectury-api copied to clipboard

Could not get BlockColors from ColorHandlerRegistry

Open XiLaiTL opened this issue 3 years ago • 3 comments

Forge provide the handleBlockColor(ColorHandlerEvent.Block event) and we could get BlockColors registered by event.getBlockColors().getColor() Fabric provide the ColorProviderRegistry.BLOCK.get(state).getColor() However, I can't get the BlockColors which has been registered from ColorHandlerRegistry.

XiLaiTL avatar Jun 22 '22 04:06 XiLaiTL

I think you can just use the ones in Minecraft itself, is it not possible?

shedaniel avatar Aug 11 '22 11:08 shedaniel

I think you can just use the ones in Minecraft itself, is it not possible?

I wanna register the color that has been registered by other block. Like this code below (fabric): ColorProviderRegistry.BLOCK.register((state, view, pos, tintIndex) -> { BlockColor blockColor = ColorProviderRegistry.BLOCK.get(state1.getBlock()); if (blockColor == null) return 0xFFFFFFFF; return blockColor.getColor(state1, view, pos, tintIndex) }, BLOCK.get()); How can I use the ones in Minecraft itself in the example to get BlockColor of state1?

XiLaiTL avatar Aug 11 '22 16:08 XiLaiTL

Minecraft.getInstance().getBlockColors()?

shedaniel avatar Aug 12 '22 13:08 shedaniel