Start moving everything over to the new system
This commit is contained in:
parent
98dd01697c
commit
1dad4697ba
48 changed files with 311 additions and 1379 deletions
|
@ -37,7 +37,7 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.items.DynamicCell;
|
||||
|
@ -57,7 +57,7 @@ public class TileIndustrialCentrifuge extends TileGenericMachine implements ICon
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.inventory = new Inventory<>(7, "TileIndustrialCentrifuge", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.CENTRIFUGE_RECIPE, this, 2, 4, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.CENTRIFUGE, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
|
@ -26,23 +26,22 @@ package techreborn.tiles.machine.iron;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.recipe.IBaseRecipeType;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.api.tile.ItemHandlerProvider;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
import reborncore.common.crafting.Recipe;
|
||||
import reborncore.common.recipes.RecipeTranslator;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
|
||||
|
@ -118,21 +117,15 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
}
|
||||
}
|
||||
|
||||
public boolean hasAllInputs(final IBaseRecipeType recipeType) {
|
||||
public boolean hasAllInputs(final Recipe recipeType) {
|
||||
if (recipeType == null) {
|
||||
return false;
|
||||
}
|
||||
for (final Object input : recipeType.getInputs()) {
|
||||
for (Ingredient ingredient : recipeType.getIngredients()) {
|
||||
boolean hasItem = false;
|
||||
boolean useTags = input instanceof String || recipeType.useOreDic();
|
||||
boolean checkSize = input instanceof ItemStack;
|
||||
for (int inputslot = 0; inputslot < 2; inputslot++) {
|
||||
if (ItemUtils.isInputEqual(input, inventory.getStackInSlot(inputslot), true,
|
||||
useTags)) {
|
||||
ItemStack stack = RecipeTranslator.getStackFromObject(input);
|
||||
if (!checkSize || inventory.getStackInSlot(inputslot).getCount() >= stack.getCount()) {
|
||||
hasItem = true;
|
||||
}
|
||||
if (ingredient.test(inventory.getStackInSlot(inputslot))) {
|
||||
hasItem = true;
|
||||
}
|
||||
}
|
||||
if (!hasItem)
|
||||
|
@ -146,9 +139,9 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
return false;
|
||||
} else {
|
||||
ItemStack itemstack = null;
|
||||
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) {
|
||||
for (final Recipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
|
||||
if (this.hasAllInputs(recipeType)) {
|
||||
itemstack = recipeType.getOutput(0);
|
||||
itemstack = recipeType.getOutputs().get(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -178,9 +171,9 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
public void smeltItem() {
|
||||
if (this.canSmelt()) {
|
||||
ItemStack itemstack = ItemStack.EMPTY;
|
||||
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) {
|
||||
for (final Recipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
|
||||
if (this.hasAllInputs(recipeType)) {
|
||||
itemstack = recipeType.getOutput(0);
|
||||
itemstack = recipeType.getOutputs().get(0);
|
||||
break;
|
||||
}
|
||||
if (!itemstack.isEmpty()) {
|
||||
|
@ -194,7 +187,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
inventory.shrinkSlot(this.output, -itemstack.getCount());
|
||||
}
|
||||
|
||||
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) {
|
||||
for (final Recipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
|
||||
boolean hasAllRecipes = true;
|
||||
if (this.hasAllInputs(recipeType)) {
|
||||
|
||||
|
@ -202,14 +195,11 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
hasAllRecipes = false;
|
||||
}
|
||||
if (hasAllRecipes) {
|
||||
for (Object input : recipeType.getInputs()) {
|
||||
boolean useOreDict = input instanceof String || recipeType.useOreDic();
|
||||
for (Ingredient ingredient : recipeType.getIngredients()) {
|
||||
for (int inputSlot = 0; inputSlot < 2; inputSlot++) {
|
||||
if (ItemUtils.isInputEqual(input, this.inventory.getStackInSlot(inputSlot), true, useOreDict)) {
|
||||
if (ingredient.test(this.inventory.getStackInSlot(inputSlot))) {
|
||||
int count = 1;
|
||||
if (input instanceof ItemStack) {
|
||||
count = RecipeTranslator.getStackFromObject(input).getCount();
|
||||
}
|
||||
//TODO also look into ingredient size here
|
||||
inventory.shrinkSlot(inputSlot, count);
|
||||
break;
|
||||
}
|
||||
|
@ -290,13 +280,9 @@ public class TileIronAlloyFurnace extends TileMachineBase
|
|||
return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this)
|
||||
.filterSlot(0, 47, 17,
|
||||
stack -> RecipeHandler.recipeList.stream()
|
||||
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
||||
&& ItemUtils.isInputEqual(recipe.getInputs().get(0), stack, true, true)))
|
||||
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(0).test(stack)))
|
||||
.filterSlot(1, 65, 17,
|
||||
stack -> RecipeHandler.recipeList.stream()
|
||||
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
||||
&& ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true)))
|
||||
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(1).test(stack)))
|
||||
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53).syncIntegerValue(this::getBurnTime, this::setBurnTime)
|
||||
.syncIntegerValue(this::getCookTime, this::setCookTime)
|
||||
.syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create(this);
|
||||
|
|
|
@ -35,7 +35,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -55,7 +55,7 @@ public class TileDistillationTower extends TileGenericMachine implements IContai
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.inventory = new Inventory<>(7, "TileDistillationTower", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.DISTILLATION_TOWER_RECIPE, this, 2, 4, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.DISTILLATION_TOWER, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -54,7 +54,7 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3 };
|
||||
this.inventory = new Inventory<>(5, "TileImplosionCompressor", 64, this);
|
||||
this.crafter = new RecipeCrafter(Reference.IMPLOSION_COMPRESSOR_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.IMPLOSION_COMPRESSOR, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
|
|
|
@ -40,10 +40,8 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
|
@ -51,7 +49,7 @@ import techreborn.tiles.TileGenericMachine;
|
|||
import techreborn.tiles.TileMachineCasing;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialBlastFurnace extends TileGenericMachine implements IContainerProvider, ITileRecipeHandler<BlastFurnaceRecipe> {
|
||||
public class TileIndustrialBlastFurnace extends TileGenericMachine implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxInput", comment = "Industrial Blast Furnace Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -66,7 +64,7 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3 };
|
||||
this.inventory = new Inventory<>(5, "TileIndustrialBlastFurnace", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.BLAST_FURNACE_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.BLAST_FURNACE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
public int getHeat() {
|
||||
|
@ -154,19 +152,5 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
|
|||
.energySlot(4, 8, 72).syncEnergyValue().syncCrafterValue()
|
||||
.syncIntegerValue(this::getHeat, this::setHeat).addInventory().create(this);
|
||||
}
|
||||
|
||||
// ITileRecipeHandler
|
||||
@Override
|
||||
public boolean canCraft(final TileEntity tile, final BlastFurnaceRecipe recipe) {
|
||||
if (tile instanceof TileIndustrialBlastFurnace) {
|
||||
final TileIndustrialBlastFurnace blastFurnace = (TileIndustrialBlastFurnace) tile;
|
||||
return blastFurnace.getHeat() >= recipe.neededHeat;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(final TileEntity tile, final BlastFurnaceRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,7 @@ import reborncore.common.util.IInventoryAccess;
|
|||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -55,7 +53,7 @@ import techreborn.tiles.TileGenericMachine;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialGrinder extends TileGenericMachine implements IContainerProvider, ITileRecipeHandler<IndustrialGrinderRecipe> {
|
||||
public class TileIndustrialGrinder extends TileGenericMachine implements IContainerProvider{
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxInput", comment = "Industrial Grinder Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -72,7 +70,7 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] {2, 3, 4, 5};
|
||||
this.inventory = new Inventory<>(8, "TileIndustrialGrinder", 64, this, getInventoryAccess());
|
||||
this.crafter = new RecipeCrafter(Reference.INDUSTRIAL_GRINDER_RECIPE, this, 1, 4, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_GRINDER, this, 1, 4, this.inventory, inputs, outputs);
|
||||
this.tank = new Tank("TileIndustrialGrinder", TileIndustrialGrinder.TANK_CAPACITY, this);
|
||||
this.ticksSinceLastChange = 0;
|
||||
}
|
||||
|
@ -154,51 +152,5 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
|
|||
.outputSlot(4, 126, 54).outputSlot(5, 126, 72).outputSlot(6, 34, 55).energySlot(7, 8, 72)
|
||||
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
|
||||
}
|
||||
|
||||
// ITileRecipeHandler
|
||||
@Override
|
||||
public boolean canCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) {
|
||||
if (!getMultiBlock()) {
|
||||
return false;
|
||||
}
|
||||
final FluidStack recipeFluid = recipe.fluidStack;
|
||||
final FluidStack tankFluid = tank.getFluid();
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tankFluid == null) {
|
||||
return false;
|
||||
}
|
||||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) {
|
||||
final FluidStack recipeFluid = recipe.fluidStack;
|
||||
final FluidStack tankFluid = tank.getFluid();
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tankFluid == null) {
|
||||
return false;
|
||||
}
|
||||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
if (tankFluid.amount == recipeFluid.amount) {
|
||||
tank.setFluid(null);
|
||||
}
|
||||
else {
|
||||
tankFluid.amount -= recipeFluid.amount;
|
||||
}
|
||||
syncWithAll();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -45,9 +45,8 @@ import reborncore.common.util.IInventoryAccess;
|
|||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -55,7 +54,7 @@ import techreborn.tiles.TileGenericMachine;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class TileIndustrialSawmill extends TileGenericMachine implements IContainerProvider, ITileRecipeHandler<IndustrialSawmillRecipe> {
|
||||
public class TileIndustrialSawmill extends TileGenericMachine implements IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_sawmill", key = "IndustrialSawmillMaxInput", comment = "Industrial Sawmill Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
|
@ -72,7 +71,7 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4 };
|
||||
this.inventory = new Inventory<>(7, "TileSawmill", 64, this, getInventoryAccess());
|
||||
this.crafter = new RecipeCrafter(Reference.INDUSTRIAL_SAWMILL_RECIPE, this, 1, 3, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_SAWMILL, this, 1, 3, this.inventory, inputs, outputs);
|
||||
this.tank = new Tank("TileSawmill", TileIndustrialSawmill.TANK_CAPACITY, this);
|
||||
this.ticksSinceLastChange = 0;
|
||||
}
|
||||
|
@ -155,50 +154,5 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
|
|||
.outputSlot(4, 126, 61).outputSlot(5, 34, 55).energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue()
|
||||
.addInventory().create(this);
|
||||
}
|
||||
|
||||
// ITileRecipeHandler
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile, IndustrialSawmillRecipe recipe) {
|
||||
if (!getMutliBlock()) {
|
||||
return false;
|
||||
}
|
||||
final FluidStack recipeFluid = recipe.fluidStack;
|
||||
final FluidStack tankFluid = tank.getFluid();
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tankFluid == null) {
|
||||
return false;
|
||||
}
|
||||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile, IndustrialSawmillRecipe recipe) {
|
||||
final FluidStack recipeFluid = recipe.fluidStack;
|
||||
final FluidStack tankFluid = tank.getFluid();
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tankFluid == null) {
|
||||
return false;
|
||||
}
|
||||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
if (tankFluid.amount == recipeFluid.amount) {
|
||||
tank.setFluid(null);
|
||||
} else {
|
||||
tankFluid.amount -= recipeFluid.amount;
|
||||
}
|
||||
syncWithAll();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -54,7 +54,7 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP
|
|||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new Inventory<>(3, "TileVacuumFreezer", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.VACUUM_FREEZER_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.VACUUM_FREEZER, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
public boolean getMultiBlock() {
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.tiles.machine.tier1;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.client.containerBuilder.IContainerProvider;
|
||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||
import reborncore.client.containerBuilder.builder.ContainerBuilder;
|
||||
|
@ -33,10 +32,8 @@ import reborncore.common.recipes.RecipeCrafter;
|
|||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -54,7 +51,7 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new Inventory<>(4, "TileAlloySmelter", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.ALLOY_SMELTER_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.ALLOY_SMELTER, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
@ -63,13 +60,9 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
|
|||
return new ContainerBuilder("alloysmelter").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(this)
|
||||
.filterSlot(0, 34, 47,
|
||||
stack -> RecipeHandler.recipeList.stream()
|
||||
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
||||
&& ItemUtils.isInputEqual(recipe.getInputs().get(0), stack, true, true)))
|
||||
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(0).test(stack)))
|
||||
.filterSlot(1, 126, 47,
|
||||
stack -> RecipeHandler.recipeList.stream()
|
||||
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
|
||||
&& ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true)))
|
||||
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(1).test(stack)))
|
||||
.outputSlot(2, 80, 47).energySlot(3, 8, 72).syncEnergyValue().syncCrafterValue().addInventory()
|
||||
.create(this);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -51,7 +51,7 @@ public class TileAssemblingMachine extends TileGenericMachine implements IContai
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new Inventory<>(4, "TileAssemblingMachine", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.ASSEMBLING_MACHINE_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.ASSEMBLING_MACHINE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -51,7 +51,7 @@ public class TileChemicalReactor extends TileGenericMachine implements IContaine
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2 };
|
||||
this.inventory = new Inventory<>(4, "TileChemicalReactor", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.CHEMICAL_REACTOR_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.CHEMICAL_REACTOR, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -51,7 +51,7 @@ public class TileCompressor extends TileGenericMachine implements IContainerProv
|
|||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new Inventory<>(3, "TileCompressor", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.COMPRESSOR_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.COMPRESSOR, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -51,7 +51,7 @@ public class TileExtractor extends TileGenericMachine implements IContainerProvi
|
|||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new Inventory<>(3, "TileExtractor", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.EXTRACTOR_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.EXTRACTOR, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
|
@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
|
|||
import reborncore.common.registration.config.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.tiles.TileGenericMachine;
|
||||
|
@ -51,7 +51,7 @@ public class TileGrinder extends TileGenericMachine implements IContainerProvide
|
|||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.inventory = new Inventory<>(3, "TileGrinder", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.GRINDER_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.GRINDER, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
|
@ -34,7 +34,7 @@ import reborncore.common.registration.config.ConfigRegistry;
|
|||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRTileEntities;
|
||||
import techreborn.items.DynamicCell;
|
||||
|
@ -53,7 +53,7 @@ public class TileIndustrialElectrolyzer extends TileGenericMachine implements IC
|
|||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.inventory = new Inventory<>(7, "TileIndustrialElectrolyzer", 64, this).withConfiguredAccess();
|
||||
this.crafter = new RecipeCrafter(Reference.INDUSTRIAL_ELECTROLYZER_RECIPE, this, 2, 4, this.inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_ELECTROLYZER, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue