-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/andersmmg/lockandblock/client/LockAndBlockClient.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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
package com.andersmmg.lockandblock.client; | ||
|
||
import com.andersmmg.lockandblock.block.ModBlocks; | ||
import com.andersmmg.lockandblock.item.ModItems; | ||
import com.andersmmg.lockandblock.item.custom.KeycardItem; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; | ||
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; | ||
import net.minecraft.client.render.RenderLayer; | ||
|
||
public class LockAndBlockClient implements ClientModInitializer { | ||
@Override | ||
public void onInitializeClient() { | ||
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.FORCEFIELD, RenderLayer.getTranslucent()); | ||
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> { | ||
if (stack.getItem() instanceof KeycardItem keycardItem) { | ||
return keycardItem.getColor(stack); | ||
} | ||
return 0; | ||
}, ModItems.KEYCARD); | ||
} | ||
} |
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