-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
7 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/client/java/com/nuclearcrackhead/serverboss/registry/ModColorProviders.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.nuclearcrackhead.serverboss.registry; | ||
|
||
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.client.color.block.BlockColorProvider; | ||
import net.minecraft.client.color.block.BlockColors; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.registry.Registries; | ||
|
||
public class ModColorProviders { | ||
|
||
public static void init() { | ||
//blocks | ||
ColorProviderRegistry.BLOCK.register( | ||
(state, view, pos, tintIndex) -> view != null && pos != null ? -14647248 : -9321636, | ||
ModBlocks.WATER_SILK | ||
); | ||
|
||
//items | ||
ColorProviderRegistry.ITEM.register( | ||
(stack, tintIndex) -> { | ||
BlockState blockState = ((BlockItem)stack.getItem()).getBlock().getDefaultState(); | ||
BlockColorProvider blockColorProvider = (BlockColorProvider) ColorProviderRegistry.BLOCK.get(blockState.getBlock()); | ||
return blockColorProvider == null ? -1 : blockColorProvider.getColor(blockState, null, null, tintIndex); | ||
}, | ||
ModItems.WATER_SILK | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters