Skip to content

Commit

Permalink
Fix not registering Block Colors on Forge
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph T. McQuigg <[email protected]>
  • Loading branch information
JT122406 committed Dec 28, 2024
1 parent 225abed commit d2230ce
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.potionstudios.biomeswevegone.forge.client;

import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.EntityRenderersEvent;
Expand Down Expand Up @@ -30,9 +29,7 @@ public static void init(final IEventBus eventBus) {
eventBus.addListener((EntityRenderersEvent.RegisterRenderers event) -> BiomesWeveGoneClient.registerBlockEntityRenderers(event::registerBlockEntityRenderer));
eventBus.addListener((RegisterParticleProvidersEvent event) -> BiomesWeveGoneClient.registerParticles((type, spriteProviderFactory) -> event.registerSpriteSet(type, spriteProviderFactory::apply)));
eventBus.addListener((EntityRenderersEvent.RegisterLayerDefinitions event) -> BiomesWeveGoneClient.registerLayerDefinitions(event::registerLayerDefinition));
eventBus.addListener((RegisterColorHandlersEvent.Item event) -> BiomesWeveGoneClient.registerBlockItemColors(consumer -> event.register((stack, tintIndex) -> {
Block block = ((BlockItem) stack.getItem()).getBlock();
return event.getBlockColors().getColor(block.defaultBlockState(), null, null, tintIndex);
}, consumer)));
eventBus.addListener((RegisterColorHandlersEvent.Block event) -> BiomesWeveGoneClient.registerBlockColors(event::register));
eventBus.addListener((RegisterColorHandlersEvent.Item event) -> BiomesWeveGoneClient.registerBlockItemColors(consumer -> event.register((stack, tintIndex) -> event.getBlockColors().getColor(((BlockItem) stack.getItem()).getBlock().defaultBlockState(), null, null, tintIndex), consumer)));
}
}

0 comments on commit d2230ce

Please sign in to comment.