diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-08-18 15:24:14 +0100 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-08-18 15:24:14 +0100 |
commit | 2f07ff2028f1bb298a920a43c741090643bf980c (patch) | |
tree | 1b1e9342ec32f034450e2e7330e615f39fa55b1a /src | |
parent | 66b3ff1d73059700673c6c1c546a4a52dd69dafe (diff) | |
download | GT5-Unofficial-2f07ff2028f1bb298a920a43c741090643bf980c.tar.gz GT5-Unofficial-2f07ff2028f1bb298a920a43c741090643bf980c.tar.bz2 GT5-Unofficial-2f07ff2028f1bb298a920a43c741090643bf980c.zip |
- Removed Maint. requirement from the PSS. Fixes #440.
$ Fixed 9 in 1 issues. Fixes #495. Closes #460.
% Adjusted PSS Tooltip.
> Added higher tier support to PSS last commit, Closes #519.
Diffstat (limited to 'src')
2 files changed, 56 insertions, 35 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index cb091264dd..aefa0da7ba 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -1362,6 +1362,15 @@ GT_MetaTileEntity_MultiBlockBase { return b; } + public void fixAllMaintenanceIssue() { + this.mCrowbar = true; + this.mWrench = true; + this.mHardHammer = true; + this.mSoftHammer = true; + this.mSolderingTool = true; + this.mScrewdriver = true; + } + public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) { @@ -1586,6 +1595,10 @@ GT_MetaTileEntity_MultiBlockBase { return false; } + public boolean clearRecipeMapForAllInputHatches() { + return resetRecipeMapForAllInputHatches(null); + } + public boolean resetRecipeMapForAllInputHatches() { return resetRecipeMapForAllInputHatches(this.getRecipeMap()); } @@ -1605,17 +1618,22 @@ GT_MetaTileEntity_MultiBlockBase { return cleared > 0; } public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();; - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap); + try { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + return resetRecipeMapForHatch((GT_MetaTileEntity_Hatch)aMetaTileEntity, aMap); + } + else { + return false; + } } - else { + catch (Throwable t) { return false; } } @@ -1645,8 +1663,9 @@ GT_MetaTileEntity_MultiBlockBase { @Override public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); - resetRecipeMapForAllInputHatches(); + clearRecipeMapForAllInputHatches(); onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ); + resetRecipeMapForAllInputHatches(); } public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { @@ -2120,31 +2139,31 @@ GT_MetaTileEntity_MultiBlockBase { log("A3"); return false; } - + @Override public boolean depleteInput(final FluidStack aLiquid) { - if (aLiquid == null) { - return false; - } - for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { - tHatch.mRecipeMap = this.getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid == null || !tLiquid.isFluidEqual(aLiquid) || tLiquid.amount < aLiquid.amount) { - continue; - } - tLiquid = tHatch.drain(aLiquid.amount, false); - if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { - tLiquid = tHatch.drain(aLiquid.amount, true); - return tLiquid != null && tLiquid.amount >= aLiquid.amount; - } - continue; - } - } - return false; - } - - + if (aLiquid == null) { + return false; + } + for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { + tHatch.mRecipeMap = this.getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid == null || !tLiquid.isFluidEqual(aLiquid) || tLiquid.amount < aLiquid.amount) { + continue; + } + tLiquid = tHatch.drain(aLiquid.amount, false); + if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { + tLiquid = tHatch.drain(aLiquid.amount, true); + return tLiquid != null && tLiquid.amount >= aLiquid.amount; + } + continue; + } + } + return false; + } + + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 618d02b9ad..dda1a6b0c0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -66,6 +66,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe return new String[]{ "[BUG] GUI does not work until structure is assembled correctly. (Do Not Report issue)", "Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches", + "Does not require maintenance", "Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-" + (CELL_HEIGHT_MAX + 2) + "", "Hatches can be placed nearly anywhere", "HV Energy/Dynamo Hatches are the lowest tier you can use", @@ -302,7 +303,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } // Only set this here, after the machine check is 100% passed. - + this.fixAllMaintenanceIssue(); this.mBatteryCapacity = getCapacityFromCellTier(tOverallCellTier) * tCellCount; return true; } @@ -376,6 +377,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe this.mMaxProgresstime = 1; this.mEUt = 0; this.mEfficiencyIncrease = 10000; + this.fixAllMaintenanceIssue(); return true; } |