From b896f2585216e61497de183cc5dd90e2fdab2311 Mon Sep 17 00:00:00 2001 From: Allison-Rodrigo Date: Fri, 27 Dec 2024 23:13:05 -0300 Subject: [PATCH 1/3] lathee --- .../machines/multi/MTEMultiLathe.java | 75 +++---------------- 1 file changed, 9 insertions(+), 66 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java index af36579ffdc..f8da86f5c7b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java @@ -14,8 +14,6 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_LATHE_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_LATHE_GLOW; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; -import static net.minecraft.util.EnumChatFormatting.BLUE; -import static net.minecraft.util.EnumChatFormatting.DARK_AQUA; import java.text.DecimalFormat; import java.util.List; @@ -32,7 +30,6 @@ import net.minecraftforge.common.util.ForgeDirection; import org.apache.commons.lang3.tuple.Pair; -import org.jetbrains.annotations.NotNull; import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -54,7 +51,6 @@ import gregtech.api.multitileentity.multiblock.casing.Glasses; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; -import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; @@ -78,40 +74,6 @@ public MTEMultiLathe(String aName) { protected int pipeTier = 0; - public enum PipeTiers { - - Tin(1, 0.75F), - Brass(1, 0.8F), - Electrum(2, 0.9F), - Platinum(4, 1F), - Osmium(8, 1.5F), - Quantium(12, 2F), - FluxedElectrum(16, 3F), - BlackPlutonium(32, 4F); - - final int maxParallel; - final float speedBoost; - - PipeTiers(int maxParallel, float speedBoost) { - this.maxParallel = maxParallel; - this.speedBoost = speedBoost; - } - } - - private PipeTiers getPipeData() { - pipeTier = getPipeTier(); - return switch (pipeTier) { - case 2 -> PipeTiers.Brass; - case 3 -> PipeTiers.Electrum; - case 4 -> PipeTiers.Platinum; - case 5 -> PipeTiers.Osmium; - case 6 -> PipeTiers.Quantium; - case 7 -> PipeTiers.FluxedElectrum; - case 8 -> PipeTiers.BlackPlutonium; - default -> PipeTiers.Tin; - }; - } - // get tier from block meta private static Integer getTierFromMeta(Block block, Integer metaID) { if (block != GregTechAPI.sBlockCasings11) return -1; @@ -228,16 +190,9 @@ public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirect protected MultiblockTooltipBuilder createTooltip() { MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); tt.addMachineType("Lathe") - .addInfo(BLUE + "Allows more parallel recipes based on item pipe casing parallel and voltage.") - .addInfo("Max Parallel Recipes = Item Pipe Casing Parallel + (Voltage Tier * 2).") - .addInfo(BLUE + "Increases processing speed based on item pipe casing speed and voltage.") - .addInfo("Time Reduction = 1 / (Item Pipe Casing Speed Boost + Voltage Tier / 4).") - .addInfo("Speed Increase = (100 / Time Reduction).") - .addInfo( - DARK_AQUA - + "For example, using Black Plutonium item pipe casings (boost of 4) and Tier 3 voltage (HV) ") - .addInfo(DARK_AQUA + "reduces processing time to 57% of the recipe time, making the machine 175% faster.") - .addInfo(BLUE + "Only uses 80% of the EU/T normally required.") + .addInfo("300% faster than using single block machines of the same voltage") + .addInfo("Gains 8 parallel per Pipe Casing Tier") + .addInfo("Only uses 80% of the EU/T normally required.") .beginStructureBlock(7, 5, 5, true) .addController("Front Center") .addCasingInfoMin("Solid Steel Machine Casing", 42, false) @@ -293,36 +248,24 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a return this.mMaintenanceHatches.size() == 1 && pipeTier > 0 && !mEnergyHatches.isEmpty() && mCasingAmount >= 42; } - public float speedBoost(float speedBoost, byte voltageTier) { - return 1F / ((speedBoost + voltageTier) / 4F); - } - @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic() { - - @NotNull - @Override - public CheckRecipeResult process() { - speedBoost = (speedBoost(getPipeData().speedBoost, GTUtility.getTier(getMaxInputVoltage()))); - return super.process(); - } - }.setEuModifier(0.8F) + return new ProcessingLogic().setSpeedBonus(1F / 4F) + .setEuModifier(0.8F) .setMaxParallelSupplier(this::getMaxParallelRecipes); } public int getMaxParallelRecipes() { - return getPipeData().maxParallel + (GTUtility.getTier(this.getMaxInputVoltage()) * 2); + return (getPipeTier() * 8); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); - tag.setInteger("itemPipeTier", Math.max(0, pipeTier)); - tag.setFloat("speedBonus", getPipeData().speedBoost); + tag.setInteger("itemPipeTier", Math.max(0, getPipeTier())); + tag.setFloat("speedBonus", 400); tag.setFloat("getMaxParallelRecipes", Math.max(0, getMaxParallelRecipes())); - tag.setByte("voltageTier", GTUtility.getTier(this.getMaxInputVoltage())); } private static final DecimalFormat dfNone = new DecimalFormat("#"); @@ -343,7 +286,7 @@ public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDat currenttip.add( StatCollector.translateToLocal("GT5U.multiblock.speed") + ": " + EnumChatFormatting.WHITE - + dfNone.format(Math.max(0, 100 / speedBoost(tag.getFloat("speedBonus"), tag.getByte("voltageTier")))) + + dfNone.format((Math.max(0, tag.getInteger("speedBonus")))) + "%"); } From 00c6df51547f27dc2a61e3747172dbdc7c222175 Mon Sep 17 00:00:00 2001 From: Allison-Rodrigo Date: Sat, 28 Dec 2024 15:51:33 -0300 Subject: [PATCH 2/3] Spotless --- .../common/tileentities/machines/multi/MTEMultiLathe.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java index cf0c56d9e57..361f5c9803c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java @@ -15,8 +15,6 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_LATHE_GLOW; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import static gregtech.api.util.GTStructureUtility.chainAllGlasses; -import static net.minecraft.util.EnumChatFormatting.BLUE; -import static net.minecraft.util.EnumChatFormatting.DARK_AQUA import java.text.DecimalFormat; import java.util.List; From 51fa63c576defa54a91cf004aa884a1fb79c98d5 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:44:35 -0600 Subject: [PATCH 3/3] Update src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java --- .../common/tileentities/machines/multi/MTEMultiLathe.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java index 361f5c9803c..ea42aea04a0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java @@ -192,7 +192,7 @@ protected MultiblockTooltipBuilder createTooltip() { tt.addMachineType("Lathe") .addInfo("300% faster than using single block machines of the same voltage") .addInfo("Gains 8 parallel per Pipe Casing Tier") - .addInfo("Only uses 80% of the EU/T normally required.") + .addInfo("Only uses 80% of the EU/t normally required.") .beginStructureBlock(7, 5, 5, true) .addController("Front Center") .addCasingInfoMin("Solid Steel Machine Casing", 42, false)