diff options
author | Alexdoru <57050655+Alexdoru@users.noreply.github.com> | 2024-09-28 13:25:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 11:25:01 +0000 |
commit | 86f1765b171f4cc6f163b8027d1330f4e5094e2d (patch) | |
tree | b6e293bd3c976558fc4e4b7190e4d342c2ddc555 /src/main/java/gtPlusPlus/xmod/gregtech/common | |
parent | 6b1f145f5028f1bc92cf478e5963224e7d94b5cd (diff) | |
download | GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.tar.gz GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.tar.bz2 GT5-Unofficial-86f1765b171f4cc6f163b8027d1330f4e5094e2d.zip |
Remove more reflection + reorganize mixin accessors packages (#3260)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common')
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java index d94c764e53..9b51724b35 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java @@ -23,8 +23,8 @@ import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import tectech.util.TTUtility; public class MTERTGenerator extends MTEBasicGenerator { @@ -45,13 +45,11 @@ public class MTERTGenerator extends MTEBasicGenerator { // Generates fuel value based on MC days public static int convertDaysToTicks(float days) { - int value = 0; - value = MathUtils.roundToClosestInt(20 * 86400 * days); - return value; + return MathUtils.roundToClosestInt(20 * 86400 * days); } public static long getTotalEUGenerated(int ticks, int voltage) { - return ticks * voltage; + return (long) ticks * voltage; } @Override @@ -84,18 +82,7 @@ public class MTERTGenerator extends MTEBasicGenerator { this.mDaysRemaining = aNBT.getInteger("mDaysRemaining"); this.mDayTick = aNBT.getInteger("mDayTick"); this.mNewTier = aNBT.getByte("mNewTier"); - - try { - ReflectionUtils.setByte(this, "mTier", this.mNewTier); - } catch (Exception e) { - if (this.getBaseMetaTileEntity() != null) { - IGregTechTileEntity thisTile = this.getBaseMetaTileEntity(); - if (thisTile.isAllowedToWork() || thisTile.isActive()) { - thisTile.setActive(false); - } - } - } - + TTUtility.setTier(this.mNewTier, this); final NBTTagList list = aNBT.getTagList("mRecipeItem", 10); final NBTTagCompound data = list.getCompoundTagAt(0); ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data); @@ -111,7 +98,7 @@ public class MTERTGenerator extends MTEBasicGenerator { if (aBaseMetaTileEntity.isServerSide()) { if (this.mDayTick < 24000) { this.mDayTick++; - } else if (this.mDayTick >= 24000) { + } else { this.mDayTick = 0; this.mDaysRemaining = this.removeDayOfTime(); } @@ -327,7 +314,7 @@ public class MTERTGenerator extends MTEBasicGenerator { } else { mTier2 = 0; } - ReflectionUtils.setByte(this, "mTier", mTier2); + TTUtility.setTier(mTier2, this); this.mNewTier = mTier2; } catch (Exception e) { Logger.WARNING("Failed setting mTier."); |