aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-10-13 20:38:03 +0200
committerGitHub <noreply@github.com>2022-10-13 20:38:03 +0200
commit819069c6d6cbbe1815b78e0b89926de036418255 (patch)
tree976588d0f63ae0a7e3ba4696d3ca6e055b5b8774 /src
parent166c7411daeb523cd8411e6db2822a8de6705a22 (diff)
downloadGT5-Unofficial-819069c6d6cbbe1815b78e0b89926de036418255.tar.gz
GT5-Unofficial-819069c6d6cbbe1815b78e0b89926de036418255.tar.bz2
GT5-Unofficial-819069c6d6cbbe1815b78e0b89926de036418255.zip
Fix accidental block dupe (#216)
* Fix dupe * Move setup process to checkRecipe Former-commit-id: f72a6bd720ae66d8d722658e8d467a239b969ec3
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java56
1 files changed, 27 insertions, 29 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java
index 7342c35b63..c64050ed0e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java
@@ -312,34 +312,6 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse
}
}
}
- if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) {
- startRecipeProcessing();
- if (setupphase == 1 && mStorage.size() < mMaxSlots) {
- List<ItemStack> inputs = getStoredInputs();
- for (ItemStack input : inputs) addCrop(input);
- this.updateSlots();
- } else if (setupphase == 2 && mStorage.size() > 0) {
- int emptySlots = 0;
- boolean ignoreEmptiness = false;
- for (GT_MetaTileEntity_Hatch_OutputBus i : mOutputBusses) {
- if (i instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) {
- ignoreEmptiness = true;
- break;
- }
- for (int j = 0; j < i.getSizeInventory(); j++)
- if (i.isValidSlot(j)) if (i.getStackInSlot(j) == null) emptySlots++;
- }
- while (mStorage.size() > 0) {
- if (!ignoreEmptiness && (emptySlots -= 2) < 0) break;
- this.addOutput(this.mStorage.get(0).input.copy());
- if (this.mStorage.get(0).undercrop != null)
- this.addOutput(this.mStorage.get(0).undercrop.copy());
- this.mStorage.remove(0);
- }
- this.updateSlots();
- }
- endRecipeProcessing();
- }
}
@Override
@@ -368,7 +340,32 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse
if (setupphase > 0) {
if ((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2))
return false;
- this.mMaxProgresstime = 20;
+
+ if (setupphase == 1) {
+ List<ItemStack> inputs = getStoredInputs();
+ for (ItemStack input : inputs) addCrop(input);
+ } else if (setupphase == 2) {
+ int emptySlots = 0;
+ boolean ignoreEmptiness = false;
+ for (GT_MetaTileEntity_Hatch_OutputBus i : mOutputBusses) {
+ if (i instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) {
+ ignoreEmptiness = true;
+ break;
+ }
+ for (int j = 0; j < i.getSizeInventory(); j++)
+ if (i.isValidSlot(j)) if (i.getStackInSlot(j) == null) emptySlots++;
+ }
+ while (mStorage.size() > 0) {
+ if (!ignoreEmptiness && (emptySlots -= 2) < 0) break;
+ this.addOutput(this.mStorage.get(0).input.copy());
+ if (this.mStorage.get(0).undercrop != null)
+ this.addOutput(this.mStorage.get(0).undercrop.copy());
+ this.mStorage.remove(0);
+ }
+ }
+
+ this.updateSlots();
+ this.mMaxProgresstime = 5;
this.mEUt = 0;
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
@@ -802,6 +799,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse
boolean cangrow = false;
ArrayList<ItemStack> inputs = tileEntity.getStoredInputs();
for (ItemStack a : inputs) {
+ if (a.stackSize <= 0) continue;
Block b = Block.getBlockFromItem(a.getItem());
if (b == Blocks.air) continue;
world.setBlock(xyz[0], xyz[1] - 2, xyz[2], b, a.getItemDamage(), 0);