Search in sources :

Example 1 with AbstractFurnaceScreenHandler

use of net.minecraft.screen.AbstractFurnaceScreenHandler in project Polymorph by TheIllusiveC4.

the class PolymorphClientMod method onInitializeClient.

@Override
public void onInitializeClient() {
    PolymorphClientNetwork.setup();
    ClientEventsListener.setup();
    PolymorphApi.client().registerWidget(handledScreen -> {
        ScreenHandler screenHandler = handledScreen.getScreenHandler();
        if (screenHandler instanceof SmithingScreenHandler) {
            return new PlayerRecipesWidget(handledScreen, screenHandler.slots.get(2));
        } else if (screenHandler instanceof AbstractFurnaceScreenHandler) {
            return new FurnaceRecipesWidget(handledScreen);
        }
        return null;
    });
    PolymorphIntegrations.clientSetup();
}
Also used : AbstractFurnaceScreenHandler(net.minecraft.screen.AbstractFurnaceScreenHandler) FurnaceRecipesWidget(top.theillusivec4.polymorph.client.recipe.widget.FurnaceRecipesWidget) PlayerRecipesWidget(top.theillusivec4.polymorph.client.recipe.widget.PlayerRecipesWidget) SmithingScreenHandler(net.minecraft.screen.SmithingScreenHandler) ScreenHandler(net.minecraft.screen.ScreenHandler) SmithingScreenHandler(net.minecraft.screen.SmithingScreenHandler) AbstractFurnaceScreenHandler(net.minecraft.screen.AbstractFurnaceScreenHandler)

Aggregations

AbstractFurnaceScreenHandler (net.minecraft.screen.AbstractFurnaceScreenHandler)1 ScreenHandler (net.minecraft.screen.ScreenHandler)1 SmithingScreenHandler (net.minecraft.screen.SmithingScreenHandler)1 FurnaceRecipesWidget (top.theillusivec4.polymorph.client.recipe.widget.FurnaceRecipesWidget)1 PlayerRecipesWidget (top.theillusivec4.polymorph.client.recipe.widget.PlayerRecipesWidget)1