package com.thebrokenrail.twine.client;
import com.thebrokenrail.twine.Twine;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.item.DyeableItem;
@Environment(EnvType.CLIENT)
public class TwineClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ScreenRegistry.register(Twine.BACKPACK_SCREEN_TYPE, GenericContainerScreen::new);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : ((DyeableItem) stack.getItem()).getColor(stack), Twine.SMALL_BACKPACK, Twine.LARGE_BACKPACK);
}