Skip to content

Commit

Permalink
Fix Turf Item tinting in Forge
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiancc committed Jun 1, 2024
1 parent 152f160 commit 50b008e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions forge/src/main/java/cc/cassian/pyrite/forge/PyriteClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ public static void registerBlockColors(RegisterColorHandlersEvent.Block event){
}
}

public static void registerItemColors(RegisterColorHandlersEvent.Item event){
// Client-side mod bus event handler
@SubscribeEvent
public static void registerItemColorHandlers(RegisterColorHandlersEvent.Item event) {
for (RegistrySupplier<Block> pyriteBlock : grassBlocks) {
ItemColors itemColors = event.getItemColors();
BlockColors blockColors = event.getBlockColors();
event.register((stack, tintIndex) -> {
BlockState blockstate = ((BlockItem) stack.getItem()).getBlock().getDefaultState();
return blockColors.getColor(blockstate, null, null, tintIndex);
}, pyriteBlock.get());
}}
event.register((stack, tintIndex) -> 9551193, pyriteBlock.get());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public PyriteForge() {
// Run our common setup.
Pyrite.init(SharedConstants.WORLD_VERSION + "-forge");
modEventBus.addListener(PyriteClient::registerBlockColors);
modEventBus.addListener(PyriteClient::registerItemColorHandlers);



Expand Down

0 comments on commit 50b008e

Please sign in to comment.