aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic
diff options
context:
space:
mode:
author‭huajijam <strhuaji@gmail.com>2019-03-18 20:52:30 +0800
committer‭huajijam <strhuaji@gmail.com>2019-03-18 20:52:30 +0800
commit8b090e1fd20eb4c301996b5e1dfeb78353e595e4 (patch)
tree52152dd767d195c76baa8fd8bacb14b105aaa146 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic
parent40d7e5da9f5b84213e2c3e4596fdc69b94bd523e (diff)
downloadGT5-Unofficial-8b090e1fd20eb4c301996b5e1dfeb78353e595e4.tar.gz
GT5-Unofficial-8b090e1fd20eb4c301996b5e1dfeb78353e595e4.tar.bz2
GT5-Unofficial-8b090e1fd20eb4c301996b5e1dfeb78353e595e4.zip
fix a bug
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java16
2 files changed, 12 insertions, 8 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
index eb6a9bfcd3..c364fe5e9e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
@@ -229,7 +229,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
//I stole this code
reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1);
Logger.WARNING("reduction[2]:"+reduction);
- reduction = GT_Utility.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
+ reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
Logger.WARNING("reduction[3]:"+reduction);
mPollutionReduction = reduction;
@@ -683,7 +683,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides);
reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1);
- reduction = GT_Utility.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
+ reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
aTooltipSuper.put("Maximum pollution removed per second: "+reduction);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
index 25c14a68e7..f2e3b3c3c0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
@@ -17,7 +17,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.EntityUtils;
@@ -457,7 +456,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
}
}
- public BlockPos getTileEntityPosition(){
+ public BlockPos getTileEntityPosition(){
return new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld());
}
@@ -533,10 +532,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
@Override
public void onServerStart() {
mWirelessChargingMap.clear();
- mLocalChargingMap.clear();
- if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){
- mHasBeenMapped = true;
- }
+ mLocalChargingMap.clear();
super.onServerStart();
}
@@ -552,4 +548,12 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity {
super.doExplosion(aExplosionPower);
}
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){
+ mHasBeenMapped = true;
+ }
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ }
+
} \ No newline at end of file