diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 02:07:40 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 02:07:40 +1000 |
commit | a6bb1b33da251f4a2ec7a6d6facb4864e9905341 (patch) | |
tree | 84d47440794cadd5c64598355903b123e18e0662 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines | |
parent | 142fe00070526484862f15f3a125400a22a2fe96 (diff) | |
download | GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.gz GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.bz2 GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.zip |
+ Added a power cost of 32eu/action for the Tree Farmer. (Will eventually get a config option).
% Moved the internal power buffer variable out of the cut method into the class.
% Massive project tidy up, lots of old unused code removed or tidied up.
$ Fixed lots of String comparisons that used == instead of .equals().
$ Fixed Double/Triple/Quad null checks in certain places.
$ Fixed returns that set values at the same time.
$ Swapped 3.14 and 1.57 to Math.PI and Math.PI/2.
$ Fixed possible cases where a NPE may be thrown, by calling logging outside of null checks.
+ Added PI to CORE.java, since it's a double and MC uses it as a float in each instance.
- Stripped 95% of the useless code out of Meta_GT_Proxy.java
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines')
2 files changed, 11 insertions, 13 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java index 5e552f6647..5a165c4072 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java @@ -35,10 +35,6 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo private boolean running = false; private boolean p1, p2, p3, p4, p5, p6; - public int mMaxProgresstime = 0; - public int mUpdate = 5; - public int mProgresstime = 0; - public boolean mMachine = false; public ItemStack mOutputItem1; public ItemStack mOutputItem2; private Block Humus; 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 87367f168a..f779f0767a 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 @@ -41,7 +41,8 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock /* private */ private int plantSaplingTicks = 0; /* private */ private int cleanupTicks = 0; /* private */ private boolean canChop = false; - /* private */ private long mInternalPower = 0; + /* private */ private long mInternalPower = 0; + /* private */ private static int powerDrain = 32; public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -89,7 +90,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock if (this.mInternalPower<(maxEUStore()-128)){ tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128, false); this.mInternalPower = (this.mInternalPower+128); - Utils.LOG_INFO("Increasing internal power storage by 128EU. Stored:"+this.mInternalPower); + //Utils.LOG_INFO("Increasing internal power storage by 128EU. Stored:"+this.mInternalPower); } } } @@ -421,25 +422,24 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock if (TreefarmManager.isWoodLog(loopBlock) || TreefarmManager.isLeaves(loopBlock)){ - long tempStoredEU = tHatch.getEUVar(); - int powerDrain = 32; + long tempStoredEU = tHatch.getEUVar(); if (tempStoredEU >= powerDrain){ - Utils.LOG_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+tHatch.maxEUStore()); + //Utils.LOG_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+tHatch.maxEUStore()); //tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128 * 1, false); drainEnergyInput(powerDrain); long tempStoredEU2 = tHatch.getEUVar(); if (tempStoredEU != tempStoredEU2){ if (tempStoredEU == (tempStoredEU2+powerDrain)){ - Utils.LOG_INFO(powerDrain+"EU was drained."); + //Utils.LOG_INFO(powerDrain+"EU was drained."); } else { - Utils.LOG_INFO(""+(tempStoredEU-tempStoredEU2)+"EU was drained."); + //Utils.LOG_INFO(""+(tempStoredEU-tempStoredEU2)+"EU was drained."); } } else { - Utils.LOG_INFO("Stored EU did not change."); + //Utils.LOG_INFO("Stored EU did not change."); } posX = aBaseMetaTileEntity.getXCoord()+xDir+i; @@ -504,7 +504,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock return true; } - private static boolean findSaplings(final IGregTechTileEntity aBaseMetaTileEntity){ + private boolean findSaplings(final IGregTechTileEntity aBaseMetaTileEntity){ Utils.LOG_INFO("called findSaplings()"); int saplings = 0; final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; @@ -520,6 +520,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock posiZ = aBaseMetaTileEntity.getZCoord()+zDir+j; //Utils.LOG_INFO("Found a sapling to grow."); saplings++; + drainEnergyInput(powerDrain); applyBonemeal(aBaseMetaTileEntity.getWorld(), posiX, posiY, posiZ); } } @@ -591,6 +592,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock world.setBlockMetadataWithNotify(posX, posY, posZ, n.getItemDamage(), 4); //Deplete Input stack depleteInputEx(n); + drainEnergyInput(powerDrain); counter--; //Update slot contents? updateSlots(); |