fixes in the integration table, #1861
This commit is contained in:
parent
a5b9a8870e
commit
ed1675ada5
5 changed files with 21 additions and 40 deletions
common/buildcraft
|
@ -20,12 +20,12 @@ import buildcraft.core.ItemRobot;
|
|||
import buildcraft.core.recipes.FlexibleRecipe;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
import buildcraft.silicon.ItemRedstoneBoard;
|
||||
import buildcraft.silicon.TileIntegrationTable;
|
||||
|
||||
public class RobotIntegrationRecipe extends FlexibleRecipe implements IIntegrationRecipeFactory {
|
||||
|
||||
public RobotIntegrationRecipe(String id) {
|
||||
setContents(id, new ItemStack(BuildCraftSilicon.robotItem), 10000, new ItemStack(
|
||||
BuildCraftSilicon.redstoneBoard));
|
||||
setContents(id, new ItemStack(BuildCraftSilicon.robotItem), 10000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,6 +40,9 @@ public class RobotIntegrationRecipe extends FlexibleRecipe implements IIntegrati
|
|||
|
||||
@Override
|
||||
public CraftingResult craft(IInventory items, IFluidHandler fluids) {
|
||||
ItemStack inputA = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_A, 1);
|
||||
ItemStack inputB = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_B, 1);
|
||||
|
||||
CraftingResult result = super.craft(items, fluids);
|
||||
|
||||
if (result != null) {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
package buildcraft.silicon;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -25,16 +24,13 @@ import buildcraft.core.inventory.StackHelper;
|
|||
import buildcraft.core.inventory.Transactor;
|
||||
import buildcraft.core.triggers.ActionMachineControl;
|
||||
import buildcraft.core.utils.StringUtils;
|
||||
import buildcraft.core.utils.Utils;
|
||||
|
||||
public class TileIntegrationTable extends TileLaserTableBase implements ISidedInventory {
|
||||
public class TileIntegrationTable extends TileLaserTableBase {
|
||||
|
||||
public static final int SLOT_INPUT_A = 0;
|
||||
public static final int SLOT_INPUT_B = 1;
|
||||
public static final int SLOT_OUTPUT = 2;
|
||||
private static final int CYCLE_LENGTH = 32;
|
||||
private static final int[] SLOTS = Utils.createSlotArray(0, 3);
|
||||
private static final int[] SLOT_COMPONENTS = Utils.createSlotArray(3, 9);
|
||||
private int tick = 0;
|
||||
private SimpleInventory invRecipeOutput = new SimpleInventory(1, "integrationOutput", 64);
|
||||
private InventoryMapper invOutput = new InventoryMapper(inv, SLOT_OUTPUT, 1, false);
|
||||
|
@ -130,14 +126,8 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
|
|||
|
||||
@Override
|
||||
public double getRequiredEnergy() {
|
||||
if (activeRecipe != null) {
|
||||
CraftingResult result = activeRecipe.craftPreview(this, null);
|
||||
|
||||
if (result != null) {
|
||||
return result.energyCost;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
if (craftingPreview != null) {
|
||||
return craftingPreview.energyCost;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -179,22 +169,6 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return SLOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
return isItemValidForSlot(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
// return slot == SLOT_OUTPUT;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 12;
|
||||
|
|
|
@ -45,6 +45,13 @@ public class AdvancedFacadeRecipe extends FlexibleRecipe implements IIntegration
|
|||
|
||||
@Override
|
||||
public CraftingResult craft(IInventory items, IFluidHandler fluids) {
|
||||
ItemStack inputA = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_A, 1);
|
||||
ItemStack inputB = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_B, 1);
|
||||
|
||||
if (inputA == null || inputB == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CraftingResult result = super.craft(items, fluids);
|
||||
|
||||
if (result == null) {
|
||||
|
@ -53,9 +60,6 @@ public class AdvancedFacadeRecipe extends FlexibleRecipe implements IIntegration
|
|||
|
||||
PipeWire wire = null;
|
||||
|
||||
ItemStack inputA = items.getStackInSlot(TileIntegrationTable.SLOT_INPUT_A);
|
||||
ItemStack inputB = items.getStackInSlot(TileIntegrationTable.SLOT_INPUT_B);
|
||||
|
||||
for (ItemStack stack : result.usedItems) {
|
||||
if (stack != null && stack.getItem() instanceof ItemPipeWire) {
|
||||
wire = PipeWire.fromOrdinal(stack.getItemDamage());
|
||||
|
|
|
@ -31,7 +31,7 @@ public class GateExpansionRecipe extends FlexibleRecipe implements IIntegrationR
|
|||
this.expansion = expansion;
|
||||
this.chipset = chipset.copy();
|
||||
|
||||
setContents(id, BuildCraftTransport.pipeGate, 10000, BuildCraftTransport.pipeGate, chipset);
|
||||
setContents(id, BuildCraftTransport.pipeGate, 10000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,14 +52,13 @@ public class GateExpansionRecipe extends FlexibleRecipe implements IIntegrationR
|
|||
|
||||
@Override
|
||||
public CraftingResult craft(IInventory items, IFluidHandler fluids) {
|
||||
ItemStack inputA = items.getStackInSlot(TileIntegrationTable.SLOT_INPUT_A);
|
||||
ItemStack inputA = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_A, 1);
|
||||
ItemStack inputB = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_B, 1);
|
||||
|
||||
if (inputA == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
inputA = inputA.copy();
|
||||
|
||||
CraftingResult result = super.craft(items, fluids);
|
||||
|
||||
if (result == null) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import buildcraft.transport.gates.ItemGate;
|
|||
public class GateLogicSwapRecipe extends FlexibleRecipe implements IIntegrationRecipeFactory {
|
||||
|
||||
public GateLogicSwapRecipe(String id) {
|
||||
setContents(id, BuildCraftTransport.pipeGate, 2000, BuildCraftTransport.pipeGate);
|
||||
setContents(id, BuildCraftTransport.pipeGate, 2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +42,8 @@ public class GateLogicSwapRecipe extends FlexibleRecipe implements IIntegrationR
|
|||
|
||||
@Override
|
||||
public CraftingResult craft(IInventory items, IFluidHandler fluids) {
|
||||
ItemStack inputA = items.getStackInSlot(TileIntegrationTable.SLOT_INPUT_A).copy();
|
||||
ItemStack inputA = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_A, 1);
|
||||
ItemStack inputB = items.decrStackSize(TileIntegrationTable.SLOT_INPUT_B, 1);
|
||||
|
||||
CraftingResult result = super.craft(items, fluids);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue