Post init API enhancement, automatic render registry (WIP)

This commit is contained in:
paulevsGitch 2021-07-22 23:38:32 +03:00
parent 50ccbace6d
commit 551bf6865c
4 changed files with 43 additions and 18 deletions

View file

@ -16,19 +16,6 @@ public class BCLibClient implements ClientModInitializer {
public void onInitializeClient() {
ModIntegrationAPI.registerAll();
BaseBlockEntityRenders.register();
registerRenderLayers();
PostInitAPI.postInit();
}
private void registerRenderLayers() {
RenderType cutout = RenderType.cutout();
RenderType translucent = RenderType.translucent();
Registry.BLOCK.forEach(block -> {
if (block instanceof RenderLayerProvider) {
BCLRenderLayer layer = ((RenderLayerProvider) block).getRenderLayer();
if (layer == BCLRenderLayer.CUTOUT) BlockRenderLayerMap.INSTANCE.putBlock(block, cutout);
else if (layer == BCLRenderLayer.TRANSLUCENT) BlockRenderLayerMap.INSTANCE.putBlock(block, translucent);
}
});
PostInitAPI.postInit(true);
}
}