Search in sources :

Example 1 with TileEntityCraftingTerminal

use of com.tom.storagemod.tile.TileEntityCraftingTerminal in project Polymorph by TheIllusiveC4.

the class TomsStorageModule method selectRecipe.

@Override
public boolean selectRecipe(BlockEntity tileEntity, Recipe<?> recipe) {
    if (recipe instanceof CraftingRecipe && tileEntity instanceof TileEntityCraftingTerminal) {
        AccessorTileEntityCraftingTerminal te = (AccessorTileEntityCraftingTerminal) tileEntity;
        te.setCurrentRecipe((CraftingRecipe) recipe);
        te.callOnCraftingMatrixChanged();
        return true;
    }
    return false;
}
Also used : AccessorTileEntityCraftingTerminal(top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorTileEntityCraftingTerminal) TileEntityCraftingTerminal(com.tom.storagemod.tile.TileEntityCraftingTerminal) CraftingRecipe(net.minecraft.world.item.crafting.CraftingRecipe) AccessorTileEntityCraftingTerminal(top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorTileEntityCraftingTerminal)

Example 2 with TileEntityCraftingTerminal

use of com.tom.storagemod.tile.TileEntityCraftingTerminal 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

TileEntityCraftingTerminal (com.tom.storagemod.tile.TileEntityCraftingTerminal)2 AccessorTileEntityCraftingTerminal (top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorTileEntityCraftingTerminal)2 ContainerCraftingTerminal (com.tom.storagemod.gui.ContainerCraftingTerminal)1 CraftingRecipe (net.minecraft.world.item.crafting.CraftingRecipe)1 IPolymorphCommon (top.theillusivec4.polymorph.api.common.base.IPolymorphCommon)1 AccessorContainerStorageTerminal (top.theillusivec4.polymorph.mixin.integration.toms_storage.AccessorContainerStorageTerminal)1