Search in sources :

Example 1 with ContainerCraftingTerminal

use of com.tom.storagemod.gui.ContainerCraftingTerminal in project Polymorph by TheIllusiveC4.

the class TomsStorageModule method clientSetup.

@Override
public void clientSetup() {
    IPolymorphClient clientApi = PolymorphApi.client();
    clientApi.registerWidget(containerScreen -> {
        if (containerScreen.getMenu() instanceof ContainerCraftingTerminal) {
            return clientApi.findCraftingResultSlot(containerScreen).map(slot -> new CraftingTerminalRecipesWidget(containerScreen, slot)).orElse(null);
        }
        return null;
    });
}
Also used : AbstractCompatibilityModule(top.theillusivec4.polymorph.common.integration.AbstractCompatibilityModule) AccessorContainerStorageTerminal(top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorContainerStorageTerminal) CraftingRecipe(net.minecraft.world.item.crafting.CraftingRecipe) Recipe(net.minecraft.world.item.crafting.Recipe) AccessorTileEntityCraftingTerminal(top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorTileEntityCraftingTerminal) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity) PolymorphApi(top.theillusivec4.polymorph.api.PolymorphApi) IPolymorphCommon(top.theillusivec4.polymorph.api.common.base.IPolymorphCommon) ContainerCraftingTerminal(com.tom.storagemod.gui.ContainerCraftingTerminal) TileEntityCraftingTerminal(com.tom.storagemod.tile.TileEntityCraftingTerminal) IPolymorphClient(top.theillusivec4.polymorph.api.client.base.IPolymorphClient) ContainerCraftingTerminal(com.tom.storagemod.gui.ContainerCraftingTerminal) IPolymorphClient(top.theillusivec4.polymorph.api.client.base.IPolymorphClient)

Example 2 with ContainerCraftingTerminal

use of com.tom.storagemod.gui.ContainerCraftingTerminal in project Polymorph by TheIllusiveC4.

the class TomsStorageModule method setup.

@Override
public void setup() {
    IPolymorphCommon commonApi = PolymorphApi.common();
    commonApi.registerTileEntity2RecipeData(pTileEntity -> {
        if (pTileEntity instanceof TileEntityCraftingTerminal) {
            return new CraftingTerminalRecipeData((TileEntityCraftingTerminal) pTileEntity);
        }
        return null;
    });
    commonApi.registerContainer2TileEntity(pContainer -> {
        if (pContainer instanceof ContainerCraftingTerminal) {
            return ((AccessorContainerStorageTerminal) pContainer).getTe();
        }
        return null;
    });
}
Also used : AccessorTileEntityCraftingTerminal(top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorTileEntityCraftingTerminal) TileEntityCraftingTerminal(com.tom.storagemod.tile.TileEntityCraftingTerminal) ContainerCraftingTerminal(com.tom.storagemod.gui.ContainerCraftingTerminal) AccessorContainerStorageTerminal(top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorContainerStorageTerminal) IPolymorphCommon(top.theillusivec4.polymorph.api.common.base.IPolymorphCommon)

Aggregations

ContainerCraftingTerminal (com.tom.storagemod.gui.ContainerCraftingTerminal)2 TileEntityCraftingTerminal (com.tom.storagemod.tile.TileEntityCraftingTerminal)2 IPolymorphCommon (top.theillusivec4.polymorph.api.common.base.IPolymorphCommon)2 AccessorContainerStorageTerminal (top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorContainerStorageTerminal)2 AccessorTileEntityCraftingTerminal (top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorTileEntityCraftingTerminal)2 CraftingRecipe (net.minecraft.world.item.crafting.CraftingRecipe)1 Recipe (net.minecraft.world.item.crafting.Recipe)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1 PolymorphApi (top.theillusivec4.polymorph.api.PolymorphApi)1 IPolymorphClient (top.theillusivec4.polymorph.api.client.base.IPolymorphClient)1 AbstractCompatibilityModule (top.theillusivec4.polymorph.common.integration.AbstractCompatibilityModule)1