diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 17:14:07 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 17:14:07 +1000 |
commit | 99856fa03383b984f11fea2c2847a78af453b296 (patch) | |
tree | f5626cf00b882fa969d7a8121666a300f7e379a7 | |
parent | 665b59c23585c4a45a4037d259f1220c129f64d4 (diff) | |
download | GT5-Unofficial-99856fa03383b984f11fea2c2847a78af453b296.tar.gz GT5-Unofficial-99856fa03383b984f11fea2c2847a78af453b296.tar.bz2 GT5-Unofficial-99856fa03383b984f11fea2c2847a78af453b296.zip |
% Enforced leaf check by name.
% Tweaked the code that handled item removal from the TreeFarmers input bus slots.
-rw-r--r-- | src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java | 14 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java | 21 |
2 files changed, 27 insertions, 8 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java b/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java index 9579d0b846..31c47da796 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java +++ b/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java @@ -79,7 +79,19 @@ public class TreefarmManager { return OrePrefixes.log.contains(new ItemStack(log, 1))&& ((tTool != null) && (tTool.equals("axe"))) || (log.getMaterial() != Material.wood) ? false : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true); } - public static boolean isLeaves(Block log){ + public static boolean isLeaves(Block log){ + if (log.getUnlocalizedName().toLowerCase().contains("leaf")){ + return true; + } + if (log.getUnlocalizedName().toLowerCase().contains("leaves")){ + return true; + } + if (log.getLocalizedName().toLowerCase().contains("leaf")){ + return true; + } + if (log.getLocalizedName().toLowerCase().contains("leaves")){ + return true; + } return OrePrefixes.leaves.contains(new ItemStack(log, 1)) || (log.getMaterial() == Material.leaves); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java index 88c00d697e..ca71e19ccc 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java @@ -464,7 +464,6 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock long tempStoredEU = mInternalPower; if (tempStoredEU >= powerDrain){ Utils.LOG_MACHINE_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+maxEUStore()); - //tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128 * 1, false); drainEnergyInput(powerDrain); long tempStoredEU2 = mInternalPower; @@ -592,7 +591,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock int counter = 0; if (r.size() > 0){ Utils.LOG_MACHINE_INFO("| r was not null. "+r.size()+" |"); - for (ItemStack n : r){ + OUTER : for (ItemStack n : r){ Utils.LOG_MACHINE_INFO("found "+n.getDisplayName()); if (OrePrefixes.sapling.contains(n) || n.getDisplayName().toLowerCase().contains("sapling")){ Utils.LOG_MACHINE_INFO(""+n.getDisplayName()); @@ -610,9 +609,11 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock //Find Gaps for Saplings after scanning Item Busses for (int i = -7; i <= 7; i++) { - for (int j = -7; j <= 7; j++) { - int h = 1; - if (counter > 0) + INNER : for (int j = -7; j <= 7; j++) { + int h = 1; + + + if (counter > 0){ if ((i != -7 && i != 7) && (j != -7 && j != 7)) { if (TreefarmManager.isAirBlock(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))){ @@ -654,15 +655,21 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock } else { //Utils.LOG_MACHINE_INFO("No space for sapling, no air."); - continue; + continue INNER; } } + + } //TODO + else { + break OUTER; + } + } } } else { Utils.LOG_MACHINE_INFO("item was not a sapling"); - continue; + continue OUTER; } } } |