aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/tileentities/general
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-12-30 01:48:09 +0000
committerGitHub <noreply@github.com>2019-12-30 01:48:09 +0000
commit5af823e80a611090216375fecd3794d345446830 (patch)
treec54a19977b4a25cb86f54394eb9711aaf268efe3 /src/Java/gtPlusPlus/core/tileentities/general
parenta731e939c6b9a70ac9fd444dbf06243f63f29c06 (diff)
parentcc825179dce70a5f2c4a13730639e3300243e21a (diff)
downloadGT5-Unofficial-5af823e80a611090216375fecd3794d345446830.tar.gz
GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.tar.bz2
GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.zip
Merge pull request #525 from alkcorp/DevTop
+ 6 Months of work, let's get the ball rolling.
Diffstat (limited to 'src/Java/gtPlusPlus/core/tileentities/general')
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
index 0cda40c616..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,16 +99,23 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
}
doAdd = true;
}
- }
- else {
- doAdd = true;
- aSize = g.stackSize;
}
}
- if (doAdd) {
- ItemStack aOutput = CI.getNumberedCircuit(e);
- aOutput.stackSize = aSize;
+ 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);
this.setInventorySlotContents(25, aOutput);
return true;