aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-08-06 19:24:57 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-08-06 19:24:57 +0200
commit87b9bfd0a0989ec3186cb3f8c01bbb461182da17 (patch)
tree003c67cc927e04b5158907edcac7a9d5d28917e5 /src
parente7f82a6de66c07ba7b4d5b683e681a34925be023 (diff)
downloadGT5-Unofficial-87b9bfd0a0989ec3186cb3f8c01bbb461182da17.tar.gz
GT5-Unofficial-87b9bfd0a0989ec3186cb3f8c01bbb461182da17.tar.bz2
GT5-Unofficial-87b9bfd0a0989ec3186cb3f8c01bbb461182da17.zip
+added Achivment Localisation
+MegaMachine Fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 4e539963efb6cbe8603466dea2e7850aab6e4bec
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java15
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java21
3 files changed, 30 insertions, 11 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index bca700773a..8001cb0c41 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -54,6 +54,7 @@ import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -155,6 +156,10 @@ public final class MainMod {
new ThreadedLoader().run();
else
WerkstoffLoader.INSTANCE.run();
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!");
+ GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP.desc","Get ALL the thermal energy!");
}
}
@Mod.EventHandler
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
index a9fab1b94b..6c90893975 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java
@@ -210,17 +210,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
//Long EUt calculation
long xEUt = aEUt;
//Isnt too low EUt check?
- long tempEUt = xEUt < V[1] ? V[1] : xEUt;
+ long tempEUt = Math.max(xEUt, V[1]);
this.mMaxProgresstime = aDuration;
-
while (tempEUt <= V[mTier - 1]) {
tempEUt <<= 2;//this actually controls overclocking
//xEUt *= 4;//this is effect of everclocking
this.mMaxProgresstime >>= 1;//this is effect of overclocking
- xEUt = this.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power
+ xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power
timesOverclocked++;
}
+ if (xEUt > maxInputVoltage){
+ //downclock one notch, we have overshot.
+ xEUt >>=2;
+ this.mMaxProgresstime <<= 1;
+ timesOverclocked--;
+ }
if (xEUt > Integer.MAX_VALUE - 1) {
this.mEUt = Integer.MAX_VALUE - 1;
this.mMaxProgresstime = Integer.MAX_VALUE - 1;
@@ -228,7 +233,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
this.mEUt = (int) xEUt;
if (this.mEUt == 0)
this.mEUt = 1;
- if (this.mMaxProgresstime == 0)
+ if (this.mMaxProgresstime <= 0)
this.mMaxProgresstime = 1;//set time to 1 tick
}
}
@@ -243,7 +248,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl
ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11));
ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11));
for (int y = -1; y < 17; y++) {
- ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, true, 11));
+ ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11));
if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6))
return false;
List<Byte> metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
index ea2208146b..046c9363e4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
@@ -30,6 +30,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@@ -259,7 +260,7 @@ public class BW_Util {
//Long EUt calculation
long xEUt = aEUt;
//Isnt too low EUt check?
- long tempEUt = xEUt < V[1] ? V[1] : xEUt;
+ long tempEUt = Math.max(xEUt, V[1]);
base.mMaxProgresstime = aDuration;
@@ -267,8 +268,15 @@ public class BW_Util {
tempEUt <<= 2;//this actually controls overclocking
//xEUt *= 4;//this is effect of everclocking
base.mMaxProgresstime >>= 1;//this is effect of overclocking
- xEUt = base.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power
+ xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power
}
+
+ if (xEUt > maxInputVoltage){
+ //downclock one notch, we have overshot.
+ xEUt >>=2;
+ base.mMaxProgresstime <<= 1;
+ }
+
if (xEUt > Integer.MAX_VALUE - 1) {
base.mEUt = Integer.MAX_VALUE - 1;
base.mMaxProgresstime = Integer.MAX_VALUE - 1;
@@ -276,7 +284,7 @@ public class BW_Util {
base.mEUt = (int) xEUt;
if (base.mEUt == 0)
base.mEUt = 1;
- if (base.mMaxProgresstime == 0)
+ if (base.mMaxProgresstime <= 0)
base.mMaxProgresstime = 1;//set time to 1 tick
}
}
@@ -374,8 +382,9 @@ public class BW_Util {
continue;
if (controllerLayer && (xDir + x == 0 && zDir + z == 0))
continue;
- if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) {
- if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside && dmginside > (-1))) {
+ boolean b = Math.abs(x) < radius && Math.abs(z) != radius;
+ if (insideCheck && b) {
+ if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) {
if (!(allowHatches && (
((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
@@ -388,7 +397,7 @@ public class BW_Util {
}
}
}
- if (((!(Math.abs(x) < radius && Math.abs(z) != radius))) && (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg && dmg > (-1)))) {
+ if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) {
if (!(allowHatches && (
((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||