This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
Twine/src/main/java/com/thebrokenrail/twine/client/TwineClient.java

20 lines
870 B
Java
Raw Normal View History

2020-06-14 03:04:21 +00:00
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;
2020-06-15 23:14:36 +00:00
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
2020-06-14 03:04:21 +00:00
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() {
2020-06-15 23:14:36 +00:00
ScreenRegistry.register(Twine.BACKPACK_SCREEN_TYPE, GenericContainerScreen::new);
2020-06-14 03:04:21 +00:00
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex > 0 ? -1 : ((DyeableItem) stack.getItem()).getColor(stack), Twine.SMALL_BACKPACK, Twine.LARGE_BACKPACK);
}
}