diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-12-10 11:18:44 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-12-10 11:18:44 +0000 |
commit | 162a990fe4a1cb9cbc18e011e4d69fc4da0693b6 (patch) | |
tree | 90808afedab35d3786be94f45ce48369fc6d505c /src/Java/gtPlusPlus/core/tileentities | |
parent | 2525ff075586759657e89b9f01969f0596bca2df (diff) | |
download | GT5-Unofficial-162a990fe4a1cb9cbc18e011e4d69fc4da0693b6.tar.gz GT5-Unofficial-162a990fe4a1cb9cbc18e011e4d69fc4da0693b6.tar.bz2 GT5-Unofficial-162a990fe4a1cb9cbc18e011e4d69fc4da0693b6.zip |
+ Added support for Bio Circuits to Circuit Slots and the Circuit Programmer.
Diffstat (limited to 'src/Java/gtPlusPlus/core/tileentities')
-rw-r--r-- | src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java index 0157384cd0..23ad2a3233 100644 --- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java +++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java @@ -11,6 +11,7 @@ import net.minecraft.tileentity.TileEntity; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.inventories.InventoryCircuitProgrammer; import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.slots.SlotIntegratedCircuit; import gtPlusPlus.core.util.minecraft.PlayerUtils; public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInventory { @@ -76,16 +77,21 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv boolean doAdd = false; ItemStack g = this.getStackInSlot(e); int aSize = 0; - ItemStack aInputStack = null; - if (g != null) { + ItemStack aInputStack = null; + int aTypeInSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(g); + if (aTypeInSlot >= 0 && g != null) { + // No Existing Output if (!hasOutput) { aSize = g.stackSize; doAdd = true; } + // Existing Output else { ItemStack f = this.getStackInSlot(25); - if (f != null) { - if (f.getItemDamage() == e) { + int aTypeInCheckedSlot = SlotIntegratedCircuit.isRegularProgrammableCircuit(f); + // Check that the Circuit in the Output slot is not null and the same type as the circuit input. + if (aTypeInCheckedSlot >= 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) { + if (g.getItem() == f.getItem() && f.getItemDamage() == e) { aSize = f.stackSize + g.stackSize; if (aSize > 64) { aInputStack = g.copy(); @@ -93,14 +99,21 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv } doAdd = true; } - } - else { - doAdd = true; - aSize = g.stackSize; } } - if (doAdd) { - ItemStack aOutput = CI.getNumberedCircuit(e); + if (doAdd) { + // Check Circuit Type + ItemStack aOutput; + if (aTypeInSlot == 0) { + aOutput = CI.getNumberedCircuit(e); + } + else if (aTypeInSlot == 1) { + aOutput = CI.getNumberedBioCircuit(e); + } + else { + aOutput = null; + } + if (aOutput != null) { aOutput.stackSize = aSize; this.setInventorySlotContents(e, aInputStack); |