diff options
author | Jakub <53441451+kuba6000@users.noreply.github.com> | 2023-04-01 15:42:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-01 15:42:50 +0200 |
commit | 28461486172ce24611b5283e59d3b96e2f42885d (patch) | |
tree | 4bcb97be6b56c41ffb0b497c7033e17448e06623 /src/main/java/kubatech/tileentity/gregtech | |
parent | bd1913da8ad916a27d2dc9ebe3f3c04719817e39 (diff) | |
download | GT5-Unofficial-28461486172ce24611b5283e59d3b96e2f42885d.tar.gz GT5-Unofficial-28461486172ce24611b5283e59d3b96e2f42885d.tar.bz2 GT5-Unofficial-28461486172ce24611b5283e59d3b96e2f42885d.zip |
Fix EIG and EEC energy consumption (#68)
* Deprecate and final modifier to mEUt
* Fix all energy issues
* Update build.gradle
* Update MixinPlugin.java
* Refactoring / Fixes
* Update KubaTechGTMultiBlockBase.java
Diffstat (limited to 'src/main/java/kubatech/tileentity/gregtech')
3 files changed, 23 insertions, 31 deletions
diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java index f7e2fee904..a35c275bcd 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java @@ -449,13 +449,13 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber return false; if (isInRitualMode && isRitualValid()) { - if (getMaxInputVoltage() < recipe.mEUt / 4) return false; + if (getMaxInputEu() < recipe.mEUt / 4) return false; this.mOutputFluids = new FluidStack[] { FluidRegistry.getFluidStack("xpjuice", 5000) }; this.mOutputItems = recipe.generateOutputs(rand, this, 3, 0, mIsProducingInfernalDrops); this.lEUt /= 4L; this.mMaxProgresstime = 400; } else { - if (getMaxInputVoltage() < recipe.mEUt) return false; + if (getMaxInputEu() < recipe.mEUt) return false; double attackDamage = DIAMOND_SPIKES_DAMAGE; // damage from spikes GT_MetaTileEntity_Hatch_InputBus inputbus = this.mInputBusses.size() == 0 ? null : this.mInputBusses.get(0); diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java index e8ddcb29b9..372fe819e2 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java @@ -227,10 +227,6 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); } - private static String tierString(int tier) { - return GT_Values.TIER_COLORS[tier] + GT_Values.VN[tier] + EnumChatFormatting.RESET + EnumChatFormatting.GRAY; - } - @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); @@ -248,18 +244,21 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse .addInfo("[IC2] You need to also input block that is required under the crop") .addInfo("Output mode: machine will take planted seeds and output them") .addInfo("-------------------- NORMAL CROPS --------------------") - .addInfo("Minimal tier: " + tierString(4)).addInfo("Starting with 1 slot") + .addInfo("Minimal tier: " + voltageTooltipFormatted(4)).addInfo("Starting with 1 slot") .addInfo("Every slot gives 64 crops") - .addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2") + .addInfo("Every tier past " + voltageTooltipFormatted(4) + ", slots are multiplied by 2") .addInfo("Base process time: 5 sec") - .addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)") + .addInfo( + "Process time is divided by number of tiers past " + voltageTooltipFormatted(3) + + " (Minimum 1 sec)") .addInfo("All crops are grown at the end of the operation") .addInfo("Will automatically craft seeds if they are not dropped") .addInfo("1 Fertilizer per 1 crop +200%") .addInfo("-------------------- IC2 CROPS --------------------") - .addInfo("Minimal tier: " + tierString(6)).addInfo("Need " + tierString(6) + " glass tier") - .addInfo("Starting with 4 slots").addInfo("Every slot gives 1 crop") - .addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4") + .addInfo("Minimal tier: " + voltageTooltipFormatted(6)) + .addInfo("Need " + voltageTooltipFormatted(6) + " glass tier").addInfo("Starting with 4 slots") + .addInfo("Every slot gives 1 crop") + .addInfo("Every tier past " + voltageTooltipFormatted(6) + ", slots are multiplied by 4") .addInfo("Process time: 5 sec").addInfo("All crops are accelerated by x32 times") .addInfo("1 Fertilizer per 1 crop +10%").addInfo(StructureHologram).addSeparator() .beginStructureBlock(5, 6, 5, false).addController("Front bottom center") @@ -336,8 +335,7 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse } private void updateMaxSlots() { - long v = this.getMaxInputVoltage(); - int tier = GT_Utility.getTier(v); + int tier = getVoltageTier(); if (tier < (isIC2Mode ? 6 : 4)) mMaxSlots = 0; else if (isIC2Mode) mMaxSlots = 4 << (2 * (tier - 6)); else mMaxSlots = 1 << (tier - 4); @@ -345,8 +343,7 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse @Override public boolean checkRecipe(ItemStack itemStack) { - long v = this.getMaxInputVoltage(); - int tier = GT_Utility.getTier(v); + int tier = getVoltageTier(); updateMaxSlots(); if (oldVersion != EIG_MATH_VERSION) { @@ -385,7 +382,7 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse this.updateSlots(); this.mMaxProgresstime = 5; - this.mEUt = 0; + this.lEUt = 0; this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; return true; @@ -478,7 +475,7 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse } this.mOutputItems = outputs.toArray(new ItemStack[0]); } - this.mEUt = -(int) ((double) GT_Values.V[tier] * 0.99d); + this.lEUt = -(int) ((double) GT_Values.V[tier] * 0.99d); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; this.updateSlots(); diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java index c91efacb4c..a17af113c0 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java @@ -26,7 +26,6 @@ import java.util.stream.IntStream; import kubatech.Tags; import kubatech.api.LoaderReference; -import kubatech.api.helpers.GTHelper; import kubatech.api.implementations.KubaTechGTMultiBlockBase; import kubatech.client.effect.MegaApiaryBeesRenderer; @@ -227,10 +226,6 @@ public class GT_MetaTileEntity_MegaIndustrialApiary return (d, r, f) -> d.offsetY == 0 && r.isNotRotated(); } - private String voltageFormatted(int v) { - return GT_Values.TIER_COLORS[v] + GT_Values.VN[v] + EnumChatFormatting.GRAY; - } - @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); @@ -244,9 +239,9 @@ public class GT_MetaTileEntity_MegaIndustrialApiary .addInfo("-------------------- OUTPUT MODE ---------------------").addInfo("- Does not take power") .addInfo("- Will give your bees back to output bus") .addInfo("------------------- OPERATING MODE -------------------").addInfo("- NORMAL:") - .addInfo(" - For each " + voltageFormatted(6) + " amp you can insert 1 bee") + .addInfo(" - For each " + voltageTooltipFormatted(6) + " amp you can insert 1 bee") .addInfo(" - Processing time: 5 seconds") - .addInfo(" - Uses 1 " + voltageFormatted(6) + " amp per queen") + .addInfo(" - Uses 1 " + voltageTooltipFormatted(6) + " amp per queen") .addInfo(" - All bees are accelerated 64 times").addInfo(" - 8 production upgrades are applied") .addInfo(" - Genetic Stabilizer upgrade applied") .addInfo(" - Simulates perfect environment for your bees") @@ -257,7 +252,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary .addInfo("- SWARMER:").addInfo(" - You can only insert 1 queen") .addInfo(" - It will slowly produce ignoble princesses") .addInfo(" - Consumes 100 royal jelly per operation").addInfo(" - Base processing time: 1 minute") - .addInfo(" - Uses 1 amp " + voltageFormatted(5)).addInfo(" - Can overclock") + .addInfo(" - Uses 1 amp " + voltageTooltipFormatted(5)).addInfo(" - Can overclock") .addInfo(StructureHologram).addSeparator().beginStructureBlock(15, 17, 15, false) .addController("Front Bottom Center").addCasingInfoMin("Bronze Plated Bricks", 190, false) .addOtherStructurePart("Borosilicate Glass", "Look at the hologram") @@ -374,7 +369,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary if (mPrimaryMode < 2) { if (mPrimaryMode == 0 && mStorage.size() < mMaxSlots) { World w = getBaseMetaTileEntity().getWorld(); - float t = (float) GTHelper.getVoltageTierD(this); + float t = (float) getVoltageTierExact(); ArrayList<ItemStack> inputs = getStoredInputs(); for (ItemStack input : inputs) { if (beeRoot.getType(input) == EnumBeeType.QUEEN) { @@ -405,7 +400,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary if (megaApiaryStorageVersion != MEGA_APIARY_STORAGE_VERSION) { megaApiaryStorageVersion = MEGA_APIARY_STORAGE_VERSION; World w = getBaseMetaTileEntity().getWorld(); - float t = (float) GTHelper.getVoltageTierD(this); + float t = (float) getVoltageTierExact(); mStorage.forEach(s -> s.generate(w, t)); } @@ -414,7 +409,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary if (flowersError) return false; if (needsTVarUpdate) { - float t = (float) GTHelper.getVoltageTierD(this); + float t = (float) getVoltageTierExact(); needsTVarUpdate = false; mStorage.forEach(s -> s.updateTVar(t)); } @@ -603,7 +598,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary return super.transferStackInSlot(aPlayer, aSlotIndex); } World w = mte.getBaseMetaTileEntity().getWorld(); - float t = (float) GTHelper.getVoltageTierD(mte); + float t = (float) mte.getVoltageTierExact(); BeeSimulator bs = new BeeSimulator(aStack, w, t); if (bs.isValid) { mte.mStorage.add(bs); @@ -727,7 +722,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary } if (beeRoot.getType(input) == EnumBeeType.QUEEN) { World w = getBaseMetaTileEntity().getWorld(); - float t = (float) GTHelper.getVoltageTierD(this); + float t = (float) getVoltageTierExact(); BeeSimulator bs = new BeeSimulator(input, w, t); if (bs.isValid) { if (mStorage.size() > ID) { |