From eb5b6a5a98fb414eb37808aeb2b3899c3fcf7b8d Mon Sep 17 00:00:00 2001 From: bruberu <80226372+bruberu@users.noreply.github.com> Date: Sat, 20 Jul 2024 21:00:44 -0500 Subject: [PATCH] feat: overhaul part 4 --- .../capability/impl/PrimitiveRecipeLogic.java | 2 - .../api/gui/widgets/UpdatedSliderWidget.java | 3 - .../api/nuclear/fission/FissionReactor.java | 10 +- .../fission/components/ControlRod.java | 9 +- .../fission/components/CoolantChannel.java | 1 - .../java/gregtech/api/recipes/RecipeMaps.java | 48 +++++----- .../api/unification/material/Material.java | 34 +++---- .../api/unification/material/Materials.java | 1 + .../material/materials/ElementMaterials.java | 9 +- .../materials/FirstDegreeMaterials.java | 26 ++--- .../materials/SecondDegreeMaterials.java | 10 +- .../UnknownCompositionMaterials.java | 2 - .../gregtech/api/util/FluidTooltipUtil.java | 31 +++--- .../api/util/function/FloatSupplier.java | 1 + .../java/gregtech/common/ConfigHolder.java | 27 +++--- .../common/blocks/BlockPanelling.java | 41 ++++---- .../metatileentities/MetaTileEntities.java | 90 ++++++------------ .../MetaTileEntityHeatExchanger.java | 10 +- .../multi/MetaTileEntityFissionReactor.java | 46 +++++---- .../MetaTileEntityControlRodPort.java | 6 +- .../MetaTileEntityCoolantImportHatch.java | 6 +- .../MetaTileEntityFuelRodImportBus.java | 6 +- .../utils/render/ItemStackTextRenderer.java | 2 +- .../resources/assets/gregtech/lang/en_us.lang | 1 + .../fluids/fluid.high_pressure_steam.png | Bin 0 -> 6295 bytes .../fluid.high_pressure_steam.png.mcmeta | 5 + 26 files changed, 206 insertions(+), 221 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/blocks/fluids/fluid.high_pressure_steam.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/fluids/fluid.high_pressure_steam.png.mcmeta diff --git a/src/main/java/gregtech/api/capability/impl/PrimitiveRecipeLogic.java b/src/main/java/gregtech/api/capability/impl/PrimitiveRecipeLogic.java index 66ea9dc997e..281927d138b 100644 --- a/src/main/java/gregtech/api/capability/impl/PrimitiveRecipeLogic.java +++ b/src/main/java/gregtech/api/capability/impl/PrimitiveRecipeLogic.java @@ -1,9 +1,7 @@ package gregtech.api.capability.impl; import gregtech.api.GTValues; -import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; -import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/gregtech/api/gui/widgets/UpdatedSliderWidget.java b/src/main/java/gregtech/api/gui/widgets/UpdatedSliderWidget.java index 9b02c3e1924..f6e1c0c24c5 100644 --- a/src/main/java/gregtech/api/gui/widgets/UpdatedSliderWidget.java +++ b/src/main/java/gregtech/api/gui/widgets/UpdatedSliderWidget.java @@ -4,14 +4,11 @@ import gregtech.api.util.Position; import gregtech.api.util.Size; import gregtech.api.util.function.FloatConsumer; - import gregtech.api.util.function.FloatSupplier; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import java.util.function.Supplier; - public class UpdatedSliderWidget extends SliderWidget { private FloatSupplier detector; diff --git a/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java b/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java index fbcfa796c6b..14599062f81 100644 --- a/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java +++ b/src/main/java/gregtech/api/nuclear/fission/FissionReactor.java @@ -245,7 +245,7 @@ public void computeGeometry() { * Geometric factor calculation is done by (rough) numerical integration along a straight path between * the two cells */ - double resolution = ConfigHolder.machines.fissionReactorResolution; + double resolution = ConfigHolder.machines.nuclear.fissionReactorResolution; for (int t = 0; t < resolution; t++) { double x; double y; @@ -294,7 +294,7 @@ public void computeGeometry() { * The fraction of fast neutrons is simply one minus the fraction of slow neutrons */ if (pathIsClear) { - mij /= ConfigHolder.machines.fissionReactorResolution; + mij /= resolution; geometricMatrixSlowNeutrons[i][j] = (1.0 - Math.exp(-mij * rodOne.getDistance(rodTwo))) / rodOne.getDistance(rodTwo); @@ -356,11 +356,11 @@ public void computeGeometry() { (1 - sigmoid) * Math.pow(avgFuelRodDistance, -1); maxPower = fuelRods.size() * (avgHighEnergyFissionFactor + avgLowEnergyFissionFactor) * fuelRodFactor * - ConfigHolder.machines.nuclearPowerMultiplier; + ConfigHolder.machines.nuclear.nuclearPowerMultiplier; } else { // The calculations break down for the geometry, so we just do this instead. k = 0.00001; - maxPower = 0.1 * ConfigHolder.machines.nuclearPowerMultiplier; + maxPower = 0.1 * ConfigHolder.machines.nuclear.nuclearPowerMultiplier; } /* * We give each control rod and coolant channel a weight depending on how many fuel rods they affect @@ -475,7 +475,7 @@ public double makeCoolantFlow(int flowRate) { } double heatRemovedPerLiter = prop.getSpecificHeatCapacity() / - ConfigHolder.machines.fissionCoolantDivisor * + ConfigHolder.machines.nuclear.fissionCoolantDivisor * (cooledTemperature - coolant.getFluid().getTemperature()); // Explained by: // https://physics.stackexchange.com/questions/153434/heat-transfer-between-the-bulk-of-the-fluid-inside-the-pipe-and-the-pipe-externa diff --git a/src/main/java/gregtech/api/nuclear/fission/components/ControlRod.java b/src/main/java/gregtech/api/nuclear/fission/components/ControlRod.java index 4cec68be8dd..8d86b0fd4f8 100644 --- a/src/main/java/gregtech/api/nuclear/fission/components/ControlRod.java +++ b/src/main/java/gregtech/api/nuclear/fission/components/ControlRod.java @@ -16,8 +16,9 @@ public ControlRod(double maxTemperature, boolean tipModeration, double thermalCo /** * Normalizes the weights of a list of control rods based on the true number of fuel rod pairs. + * * @param effectiveControlRods The control rods to normalize. - * @param fuelRodNum The number of fuel rods in the reactor. + * @param fuelRodNum The number of fuel rods in the reactor. */ public static void normalizeWeights(List effectiveControlRods, int fuelRodNum) { for (ControlRod control_rod : effectiveControlRods) { @@ -28,8 +29,9 @@ public static void normalizeWeights(List effectiveControlRods, int f /** * Determines the effect of a list of control rods based on how far they are inserted into a reactor. + * * @param effectiveControlRods The list of control rods to be analyzed. - * @param insertion How far the control rods are inserted into the reactor, from 0 to 1. + * @param insertion How far the control rods are inserted into the reactor, from 0 to 1. * @return A number representing the reactivity change of the reactor from the control rods. */ public static double controlRodFactor(List effectiveControlRods, double insertion) { @@ -77,7 +79,8 @@ public boolean hasModeratorTip() { } /** - * Automatically calculates the control rod weight (its effect on reactivity) based on the number of fuel rod pairs that it is in the way of. + * Automatically calculates the control rod weight (its effect on reactivity) based on the number of fuel rod pairs + * that it is in the way of. */ public void computeWeightFromFuelRodMap() { this.weight = relatedFuelRodPairs * 4; // 4 being a constant to help balance this out diff --git a/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java b/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java index b70f2b4e7eb..c10c2ef4aaa 100644 --- a/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java +++ b/src/main/java/gregtech/api/nuclear/fission/components/CoolantChannel.java @@ -65,5 +65,4 @@ public ICoolantHandler getInputHandler() { public ICoolantHandler getOutputHandler() { return outputHandler; } - } diff --git a/src/main/java/gregtech/api/recipes/RecipeMaps.java b/src/main/java/gregtech/api/recipes/RecipeMaps.java index dcfea256b3c..e407b04a324 100644 --- a/src/main/java/gregtech/api/recipes/RecipeMaps.java +++ b/src/main/java/gregtech/api/recipes/RecipeMaps.java @@ -1484,14 +1484,15 @@ public final class RecipeMaps { * */ @ZenProperty - public static final RecipeMap HEAT_EXCHANGER_RECIPES = new RecipeMapBuilder<>("heat_exchanger", + public static final RecipeMap HEAT_EXCHANGER_RECIPES = new RecipeMapBuilder<>( + "heat_exchanger", new PrimitiveRecipeBuilder()) - .itemInputs(1) - .fluidInputs(2) - .fluidOutputs(2) - .progressBar(GuiTextures.PROGRESS_BAR_ARROW_MULTIPLE, MoveType.HORIZONTAL) - .sound(GTSoundEvents.COOLING) - .build(); + .itemInputs(1) + .fluidInputs(2) + .fluidOutputs(2) + .progressBar(GuiTextures.PROGRESS_BAR_ARROW_MULTIPLE, MoveType.HORIZONTAL) + .sound(GTSoundEvents.COOLING) + .build(); /** * Example: @@ -1505,34 +1506,35 @@ public final class RecipeMaps { * */ @ZenProperty - public static final RecipeMap SPENT_FUEL_POOL_RECIPES = new RecipeMapBuilder<>("spent_fuel_pool", + public static final RecipeMap SPENT_FUEL_POOL_RECIPES = new RecipeMapBuilder<>( + "spent_fuel_pool", new SimpleRecipeBuilder()) - .itemInputs(1) - .itemOutputs(1) - .fluidInputs(1) - .fluidOutputs(1) - .progressBar(GuiTextures.PROGRESS_BAR_BATH, MoveType.HORIZONTAL) - .build(); + .itemInputs(1) + .itemOutputs(1) + .fluidInputs(1) + .fluidOutputs(1) + .progressBar(GuiTextures.PROGRESS_BAR_BATH, MoveType.HORIZONTAL) + .build(); /** * Example: * *
      * GAS_CENTRIFUGE_RECIPES.recipeBuilder().duration(800).EUt(VA[HV])
-     *      .fluidInputs(UraniumHexafluoride.getFluid(1000))
-     *      .fluidOutputs(LowEnrichedUraniumHexafluoride.getFluid(100))
-     *      .fluidOutputs(DepletedUraniumHexafluoride.getFluid(900))
-     *      .buildAndRegister();
+     *         .fluidInputs(UraniumHexafluoride.getFluid(1000))
+     *         .fluidOutputs(LowEnrichedUraniumHexafluoride.getFluid(100))
+     *         .fluidOutputs(DepletedUraniumHexafluoride.getFluid(900))
+     *         .buildAndRegister();
      * 
*/ @ZenProperty public static final RecipeMap GAS_CENTRIFUGE_RECIPES = new RecipeMapBuilder<>("gas_centrifuge", new SimpleRecipeBuilder()) - .fluidInputs(1) - .fluidOutputs(2) - .progressBar(GuiTextures.PROGRESS_BAR_MIXER, MoveType.CIRCULAR) - .sound(GTSoundEvents.CENTRIFUGE) - .build(); + .fluidInputs(1) + .fluidOutputs(2) + .progressBar(GuiTextures.PROGRESS_BAR_MIXER, MoveType.CIRCULAR) + .sound(GTSoundEvents.CENTRIFUGE) + .build(); ////////////////////////////////////// // Fuel Recipe Maps // diff --git a/src/main/java/gregtech/api/unification/material/Material.java b/src/main/java/gregtech/api/unification/material/Material.java index e32aacbfba7..e3c8be1f2a3 100644 --- a/src/main/java/gregtech/api/unification/material/Material.java +++ b/src/main/java/gregtech/api/unification/material/Material.java @@ -283,8 +283,8 @@ public MaterialIconSet getMaterialIconSet() { @ZenGetter("radioactive") public boolean isRadioactive() { if (materialInfo.element != null) return materialInfo.element.halfLifeSeconds >= 0; - for (MaterialStack material : materialInfo.componentList) - if (material.material.isRadioactive()) return true; + for (MaterialStack stack : materialInfo.componentList) + if (stack.material.isRadioactive()) return true; return false; } @@ -298,8 +298,8 @@ public double getDecaysPerSecond() { return 6e23 * (Math.log(2) * Math.exp(-Math.log(2) / materialInfo.element.halfLifeSeconds)); } double decaysPerSecond = 0; - for (MaterialStack material : materialInfo.componentList) - decaysPerSecond += material.material.getDecaysPerSecond(); + for (MaterialStack stack : materialInfo.componentList) + decaysPerSecond += stack.material.getDecaysPerSecond(); return decaysPerSecond; } @@ -308,9 +308,9 @@ public long getProtons() { if (materialInfo.element != null) return materialInfo.element.getProtons(); if (materialInfo.componentList.isEmpty()) return Math.max(1, Elements.Tc.getProtons()); long totalProtons = 0, totalAmount = 0; - for (MaterialStack material : materialInfo.componentList) { - totalAmount += material.amount; - totalProtons += material.amount * material.material.getProtons(); + for (MaterialStack stack : materialInfo.componentList) { + totalAmount += stack.amount; + totalProtons += stack.amount * stack.material.getProtons(); } return totalProtons / totalAmount; } @@ -320,9 +320,9 @@ public long getNeutrons() { if (materialInfo.element != null) return materialInfo.element.getNeutrons(); if (materialInfo.componentList.isEmpty()) return Elements.Tc.getNeutrons(); long totalNeutrons = 0, totalAmount = 0; - for (MaterialStack material : materialInfo.componentList) { - totalAmount += material.amount; - totalNeutrons += material.amount * material.material.getNeutrons(); + for (MaterialStack stack : materialInfo.componentList) { + totalAmount += stack.amount; + totalNeutrons += stack.amount * stack.material.getNeutrons(); } return totalNeutrons / totalAmount; } @@ -332,9 +332,9 @@ public long getMass() { if (materialInfo.element != null) return materialInfo.element.getMass(); if (materialInfo.componentList.size() == 0) return Elements.Tc.getMass(); long totalMass = 0, totalAmount = 0; - for (MaterialStack material : materialInfo.componentList) { - totalAmount += material.amount; - totalMass += material.amount * material.material.getMass(); + for (MaterialStack stack : materialInfo.componentList) { + totalAmount += stack.amount; + totalMass += stack.amount * stack.material.getMass(); } return totalMass / totalAmount; } @@ -1086,10 +1086,10 @@ public Builder itemPipeProperties(int priority, float stacksPerSec) { return this; } - public Builder fissionFuelProperties(int maxTemperature, int duration, double slowNeutronCaptureCrossSection, - double fastNeutronCaptureCrossSection, - double slowNeutronFissionCrossSection, - double fastNeutronFissionCrossSection, double neutronGenerationTime) { + public Builder fissionFuel(int maxTemperature, int duration, double slowNeutronCaptureCrossSection, + double fastNeutronCaptureCrossSection, + double slowNeutronFissionCrossSection, + double fastNeutronFissionCrossSection, double neutronGenerationTime) { properties.ensureSet(PropertyKey.DUST); properties.setProperty(PropertyKey.FISSION_FUEL, new FissionFuelProperty(maxTemperature, duration, slowNeutronCaptureCrossSection, diff --git a/src/main/java/gregtech/api/unification/material/Materials.java b/src/main/java/gregtech/api/unification/material/Materials.java index 4d3ed8dad0d..6a20866035f 100644 --- a/src/main/java/gregtech/api/unification/material/Materials.java +++ b/src/main/java/gregtech/api/unification/material/Materials.java @@ -216,6 +216,7 @@ public static void register() { public static Material Phosphorus; public static Material Polonium; public static Material Platinum; + public static Material Plutonium; public static Material Plutonium238; public static Material Plutonium239; public static Material Plutonium240; diff --git a/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java b/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java index 9bb91da86ee..4e21ec2ada0 100644 --- a/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/ElementMaterials.java @@ -874,7 +874,6 @@ public static void register() { .color(0x32F032).iconSet(METALLIC) .flags(EXT_METAL) .element(Elements.U) - // .fissionFuelProperties(1600, 40, 1.2, 0.1, 0.1, 0.5) .build(); Uranium235 = new Material.Builder(117, gregtechId("uranium_235")) @@ -1022,10 +1021,7 @@ public static void register() { .build(); Uranium239 = new Material.Builder(132, gregtechId("uranium_239")) - .ingot(3) - .liquid(new FluidBuilder().temperature(1405)) .color(0x46FA46).iconSet(SHINY) - .flags(EXT_METAL) .element(Elements.U239) .build(); @@ -1076,5 +1072,10 @@ public static void register() { .color(0xF03232).iconSet(METALLIC) .element(Elements.Pu244) .build(); + + Plutonium = new Material.Builder(141, gregtechId("plutonium")) + .color(0xF03232).iconSet(METALLIC) + .element(Elements.Pu) + .build(); } } diff --git a/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java b/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java index c221d394f3a..ecd34acbebc 100644 --- a/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java @@ -514,7 +514,9 @@ public static void register() { .build(); Salt = new Material.Builder(312, gregtechId("salt")) - .gem(1).ore(2, 1).fluid() + .gem(1).ore(2, 1) + .liquid(new FluidBuilder() + .translation("gregtech.fluid.molten")) .color(0xFAFAFA).iconSet(FINE) .flags(NO_SMASHING) .components(Sodium, 1, Chlorine, 1) @@ -1573,7 +1575,7 @@ public static void register() { HighPressureSteam = new Material.Builder(454, gregtechId("high_pressure_steam")) .gas(new FluidBuilder() .temperature(500) - /* .customStill() */) + .customStill()) .color(0xC4C4C4) .flags(DISABLE_DECOMPOSITION) .components(Hydrogen, 2, Oxygen, 1) @@ -1583,9 +1585,8 @@ public static void register() { .dust(3) .color(0xF03232).iconSet(DULL) .flags(DISABLE_DECOMPOSITION) - .components(Plutonium239, 1, Oxygen, 2) - .build() - .setFormula("PuO2", true); + .components(Plutonium, 1, Oxygen, 2) + .build(); Zircaloy = new Material.Builder(456, gregtechId("zircaloy")) .ingot() @@ -1604,10 +1605,11 @@ public static void register() { .setFormula("UO2", true); Zircon = new Material.Builder(458, gregtechId("zircon")) - .ore() - .color(0x386F6F) + .gem().ore() + .color(0x6E0909) .flags(DISABLE_DECOMPOSITION) .components(Zirconium, 1, Silicon, 1, Oxygen, 4) + .iconSet(SHINY) .build(); ZirconiumDioxide = new Material.Builder(459, gregtechId("zirconium_dioxide")) @@ -1622,6 +1624,7 @@ public static void register() { .color(0x689FBF) .flags(DISABLE_DECOMPOSITION) .components(Zirconium, 1, Chlorine, 4) + .iconSet(SHINY) .build(); HafniumDioxide = new Material.Builder(461, gregtechId("hafnium_dioxide")) @@ -1636,6 +1639,7 @@ public static void register() { .color(0x69699A) .flags(DISABLE_DECOMPOSITION) .components(Hafnium, 1, Chlorine, 4) + .iconSet(SHINY) .build(); Inconel = new Material.Builder(463, gregtechId("inconel")) @@ -1645,21 +1649,20 @@ public static void register() { .components(Nickel, 5, Chrome, 2, Iron, 2, Niobium, 1, Molybdenum, 1) .blastTemp(1610, GasTier.MID, GTValues.VA[EV], 200) .fluidPipeProperties(2010, 175, true, true, true, false) - .build() - .setFormula("Ni5Cr2Fe2NbMo", true); + .build(); HighEnrichedUraniumHexafluoride = new Material.Builder(464, gregtechId("high_enriched_uranium_hexafluoride")) .gas() .color(0x5BF93A) .flags(DISABLE_DECOMPOSITION) .components(Uranium235, 1, Fluorine, 6) - .build() - .setFormula("UF6", true); + .build(); BoronTrioxide = new Material.Builder(465, gregtechId("boron_trioxide")) .dust() .color(0xC1E9E1) .components(Boron, 2, Oxygen, 3) + .iconSet(METALLIC) .build(); BoronCarbide = new Material.Builder(466, gregtechId("boron_carbide")) @@ -1668,6 +1671,7 @@ public static void register() { .blast(2620) .color(0xC1E9C1) .components(Boron, 4, Carbon, 1) + .iconSet(METALLIC) .build(); } } diff --git a/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java b/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java index 29aea6c2d6d..a9e3307ba40 100644 --- a/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/SecondDegreeMaterials.java @@ -509,16 +509,16 @@ public static void register() { .color(0x232323).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(HighEnrichedUraniumDioxide, 1, DepletedUraniumDioxide, 19) - .fissionFuelProperties(1500, 750, 55., 1., 2500., 0., 3.5) + .fissionFuel(1500, 750, 55., 1., 2500., 0., 3.5) .build() .setFormula("UO2", true); HEU235 = new Material.Builder(2066, gregtechId("heu_235")) .dust(3) - .color(0x242826).iconSet(METALLIC) + .color(0x424845).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(HighEnrichedUraniumDioxide, 1, DepletedUraniumDioxide, 4) - .fissionFuelProperties(1800, 600, 40., 1., 3000., 0., 2.5) + .fissionFuel(1800, 600, 40., 1., 3000., 0., 2.5) .build() .setFormula("UO2", true); @@ -527,7 +527,7 @@ public static void register() { .color(0x62C032).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(FissilePlutoniumDioxide, 1, Uraninite, 19) - .fissionFuelProperties(1600, 1000, 50., 10., 4000., 10., 1.5) + .fissionFuel(1600, 1000, 50., 10., 4000., 10., 1.5) .build() .setFormula("(U,Pu)O2", true); @@ -536,7 +536,7 @@ public static void register() { .color(0x7EA432).iconSet(METALLIC) .flags(DISABLE_DECOMPOSITION) .components(FissilePlutoniumDioxide, 1, Uraninite, 4) - .fissionFuelProperties(2000, 800, 35., 25., 5500., 0., 1) + .fissionFuel(2000, 800, 35., 25., 5500., 0., 1) .build() .setFormula("(U,Pu)O2", true); } diff --git a/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java b/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java index c317d921342..c48dda1f2b4 100644 --- a/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java +++ b/src/main/java/gregtech/api/unification/material/materials/UnknownCompositionMaterials.java @@ -6,8 +6,6 @@ import gregtech.api.fluids.store.FluidStorageKeys; import gregtech.api.unification.material.Material; -import gregtech.api.unification.material.info.MaterialIconSet; - import net.minecraftforge.fluids.FluidRegistry; import static gregtech.api.unification.material.Materials.*; diff --git a/src/main/java/gregtech/api/util/FluidTooltipUtil.java b/src/main/java/gregtech/api/util/FluidTooltipUtil.java index 4fcacbacec3..96684bb6bfd 100644 --- a/src/main/java/gregtech/api/util/FluidTooltipUtil.java +++ b/src/main/java/gregtech/api/util/FluidTooltipUtil.java @@ -3,6 +3,7 @@ import gregtech.api.fluids.FluidState; import gregtech.api.fluids.GTFluid; import gregtech.api.unification.material.Material; +import gregtech.api.unification.material.properties.CoolantProperty; import gregtech.api.unification.material.properties.PropertyKey; import net.minecraft.client.resources.I18n; @@ -108,20 +109,22 @@ public static Supplier> createFluidTooltip(@Nullable Material mater tooltip.add(I18n.format("gregtech.fluid.temperature.cryogenic")); } - if (material.hasProperty(PropertyKey.COOLANT) && - material.getProperty(PropertyKey.COOLANT).isCorrectFluid(material, fluid)) { - tooltip.add(I18n.format("gregtech.coolant.general")); - tooltip.add(I18n.format("gregtech.coolant.boiling_point", - material.getProperty(PropertyKey.COOLANT).getBoilingPoint(), - material.getProperty(PropertyKey.COOLANT).getHotHPCoolant().getFluid().getTemperature())); - tooltip.add(I18n.format("gregtech.coolant.heat_capacity", - material.getProperty(PropertyKey.COOLANT).getSpecificHeatCapacity())); - tooltip.add(I18n.format("gregtech.coolant.cooling_factor", - material.getProperty(PropertyKey.COOLANT).getCoolingFactor())); - tooltip.add(I18n.format("gregtech.coolant.moderation_factor", - material.getProperty(PropertyKey.COOLANT).getModeratorFactor())); - if (material.getProperty(PropertyKey.COOLANT).accumulatesHydrogen()) { - tooltip.add(I18n.format("gregtech.coolant.accumulates_hydrogen")); + if (material.hasProperty(PropertyKey.COOLANT)) { + CoolantProperty coolant = material.getProperty(PropertyKey.COOLANT); + if (coolant.isCorrectFluid(material, fluid)) { + tooltip.add(I18n.format("gregtech.coolant.general")); + tooltip.add(I18n.format("gregtech.coolant.boiling_point", + coolant.getBoilingPoint(), + coolant.getHotHPCoolant().getFluid().getTemperature())); + tooltip.add(I18n.format("gregtech.coolant.heat_capacity", + coolant.getSpecificHeatCapacity())); + tooltip.add(I18n.format("gregtech.coolant.cooling_factor", + coolant.getCoolingFactor())); + tooltip.add(I18n.format("gregtech.coolant.moderation_factor", + coolant.getModeratorFactor())); + if (coolant.accumulatesHydrogen()) { + tooltip.add(I18n.format("gregtech.coolant.accumulates_hydrogen")); + } } } return tooltip; diff --git a/src/main/java/gregtech/api/util/function/FloatSupplier.java b/src/main/java/gregtech/api/util/function/FloatSupplier.java index 68e56818b63..5caaef63c20 100644 --- a/src/main/java/gregtech/api/util/function/FloatSupplier.java +++ b/src/main/java/gregtech/api/util/function/FloatSupplier.java @@ -2,5 +2,6 @@ @FunctionalInterface public interface FloatSupplier { + float get(); } diff --git a/src/main/java/gregtech/common/ConfigHolder.java b/src/main/java/gregtech/common/ConfigHolder.java index 4ad9a13c12d..1172ba10f49 100644 --- a/src/main/java/gregtech/common/ConfigHolder.java +++ b/src/main/java/gregtech/common/ConfigHolder.java @@ -45,6 +45,8 @@ public class ConfigHolder { public static class MachineOptions { + public NuclearOptions nuclear = new NuclearOptions(); + @Config.Comment({ "Whether insufficient energy supply should reset Machine recipe progress to zero.", "If true, progress will reset.", "If false, progress will decrease to zero with 2x speed", "Default: false" }) @@ -90,10 +92,6 @@ public static class MachineOptions { "1.0 means 1L Steam -> 1 EU. 0.5 means 2L Steam -> 1 EU.", "Default: 0.5" }) public double multiblockSteamToEU = 0.5; - @Config.Comment({ "Nuclear Max Power multiplier for balancing purposes", "Default: 0.1" }) - @Config.RangeDouble(min = 0, max = 10000) - public double nuclearPowerMultiplier = 0.1; - @Config.Comment({ "Whether machines or boilers damage the terrain when they explode.", "Note machines and boilers always explode when overloaded with power or met with special conditions, regardless of this config.", "Default: true" }) @@ -166,14 +164,21 @@ public static class MachineOptions { "Default: true" }) public boolean allowTickAcceleration = true; - @Config.Comment({ "How much the amount of power required to boil a coolant is divided by." }) - @Config.RangeDouble(min = 0.1, max = 1000) - public double fissionCoolantDivisor = 14; + public static class NuclearOptions { - @Config.Comment({ - "The level of detail to which fission reactors are analyzed. May cause more lag at higher values." }) - @Config.RangeInt(min = 5, max = 10000) - public double fissionReactorResolution = 100; + @Config.Comment({ "Nuclear Max Power multiplier for balancing purposes", "Default: 0.1" }) + @Config.RangeDouble(min = 0, max = 10000) + public double nuclearPowerMultiplier = 0.1; + + @Config.Comment({ "How much the amount of power required to boil a coolant is divided by." }) + @Config.RangeDouble(min = 0.1, max = 1000) + public double fissionCoolantDivisor = 14; + + @Config.Comment({ + "The level of detail to which fission reactors are analyzed. May cause more lag at higher values." }) + @Config.RangeInt(min = 5, max = 10000) + public double fissionReactorResolution = 100; + } } public static class WorldGenOptions { diff --git a/src/main/java/gregtech/common/blocks/BlockPanelling.java b/src/main/java/gregtech/common/blocks/BlockPanelling.java index c8219f3e912..2a732ede1e5 100644 --- a/src/main/java/gregtech/common/blocks/BlockPanelling.java +++ b/src/main/java/gregtech/common/blocks/BlockPanelling.java @@ -13,43 +13,38 @@ public BlockPanelling() { setHardness(2.0f); setResistance(5.0f); setSoundType(SoundType.METAL); + setHarvestLevel("wrench", 2); setDefaultState(getState(PanellingType.WHITE)); } public enum PanellingType implements IStringSerializable { - WHITE("white", 2), - ORANGE("orange", 2), - MAGENTA("magenta", 2), - LIGHT_BLUE("light_blue", 2), - YELLOW("yellow", 2), - LIME("lime", 2), - PINK("pink", 2), - GRAY("gray", 2), - LIGHT_GRAY("light_gray", 2), - CYAN("cyan", 2), - PURPLE("purple", 2), - BLUE("blue", 2), - BROWN("brown", 2), - GREEN("green", 2), - RED("red", 2), - BLACK("black", 2); + WHITE("white"), + ORANGE("orange"), + MAGENTA("magenta"), + LIGHT_BLUE("light_blue"), + YELLOW("yellow"), + LIME("lime"), + PINK("pink"), + GRAY("gray"), + LIGHT_GRAY("light_gray"), + CYAN("cyan"), + PURPLE("purple"), + BLUE("blue"), + BROWN("brown"), + GREEN("green"), + RED("red"), + BLACK("black"); private final String name; - private final int harvestLevel; - PanellingType(String name, int harvestLevel) { + PanellingType(String name) { this.name = name; - this.harvestLevel = harvestLevel; } @Override public String getName() { return this.name; } - - public int getHarvestLevel() { - return this.harvestLevel; - } } } diff --git a/src/main/java/gregtech/common/metatileentities/MetaTileEntities.java b/src/main/java/gregtech/common/metatileentities/MetaTileEntities.java index 43c265fb5c4..845f3eb4f37 100644 --- a/src/main/java/gregtech/common/metatileentities/MetaTileEntities.java +++ b/src/main/java/gregtech/common/metatileentities/MetaTileEntities.java @@ -155,81 +155,53 @@ public class MetaTileEntities { // HULLS public static final MetaTileEntityHull[] HULL = new MetaTileEntityHull[GTValues.V.length]; - public static final MetaTileEntityTransformer[] TRANSFORMER = new MetaTileEntityTransformer[GTValues.V.length - - 1]; // no MAX - public static final MetaTileEntityTransformer[] HI_AMP_TRANSFORMER = new MetaTileEntityTransformer[ - GTValues.V.length - 1]; /// no MAX - public static final MetaTileEntityTransformer[] POWER_TRANSFORMER = new MetaTileEntityTransformer[ - GTValues.V.length - 1]; // no MAX + public static final MetaTileEntityTransformer[] TRANSFORMER = new MetaTileEntityTransformer[GTValues.V.length - 1]; // no MAX + public static final MetaTileEntityTransformer[] HI_AMP_TRANSFORMER = new MetaTileEntityTransformer[GTValues.V.length - 1]; /// no MAX + public static final MetaTileEntityTransformer[] POWER_TRANSFORMER = new MetaTileEntityTransformer[GTValues.V.length - 1]; // no MAX public static final MetaTileEntityDiode[] DIODES = new MetaTileEntityDiode[GTValues.V.length]; public static final MetaTileEntityBatteryBuffer[][] BATTERY_BUFFER = new MetaTileEntityBatteryBuffer[3][GTValues.V.length]; public static final MetaTileEntityCharger[] CHARGER = new MetaTileEntityCharger[GTValues.V.length]; // SIMPLE MACHINES SECTION - public static final SimpleMachineMetaTileEntity[] ELECTRIC_FURNACE = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] MACERATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] ALLOY_SMELTER = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] ARC_FURNACE = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] ASSEMBLER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] AUTOCLAVE = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; + public static final SimpleMachineMetaTileEntity[] ELECTRIC_FURNACE = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] MACERATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] ALLOY_SMELTER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] ARC_FURNACE = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] ASSEMBLER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] AUTOCLAVE = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] BENDER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] BREWERY = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] CANNER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] CENTRIFUGE = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] CHEMICAL_BATH = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] CHEMICAL_REACTOR = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] COMPRESSOR = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; + public static final SimpleMachineMetaTileEntity[] CENTRIFUGE = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] CHEMICAL_BATH = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] CHEMICAL_REACTOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] COMPRESSOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] CUTTER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] DISTILLERY = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] ELECTROLYZER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] ELECTROMAGNETIC_SEPARATOR = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] EXTRACTOR = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; + public static final SimpleMachineMetaTileEntity[] DISTILLERY = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] ELECTROLYZER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] ELECTROMAGNETIC_SEPARATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] EXTRACTOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] EXTRUDER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] FERMENTER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] FLUID_HEATER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] FLUID_SOLIDIFIER = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] FORGE_HAMMER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] FORMING_PRESS = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] FERMENTER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] FLUID_HEATER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] FLUID_SOLIDIFIER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] FORGE_HAMMER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] FORMING_PRESS = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] LATHE = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] MIXER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] ORE_WASHER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; + public static final SimpleMachineMetaTileEntity[] ORE_WASHER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] PACKER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] UNPACKER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] POLARIZER = new SimpleMachineMetaTileEntity[GTValues.V.length - - 1]; - public static final SimpleMachineMetaTileEntity[] LASER_ENGRAVER = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] POLARIZER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] LASER_ENGRAVER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] SIFTER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] THERMAL_CENTRIFUGE = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] THERMAL_CENTRIFUGE = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; public static final SimpleMachineMetaTileEntity[] WIREMILL = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] CIRCUIT_ASSEMBLER = new SimpleMachineMetaTileEntity[ - GTValues.V.length - 1]; + public static final SimpleMachineMetaTileEntity[] CIRCUIT_ASSEMBLER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; // public static final SimpleMachineMetaTileEntity[] MASS_FABRICATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; // TODO Replication // public static final SimpleMachineMetaTileEntity[] REPLICATOR = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; // TODO Replication public static final SimpleMachineMetaTileEntity[] SCANNER = new SimpleMachineMetaTileEntity[GTValues.V.length - 1]; - public static final SimpleMachineMetaTileEntity[] GAS_COLLECTOR = new MetaTileEntityGasCollector[GTValues.V.length - - 1]; + public static final SimpleMachineMetaTileEntity[] GAS_COLLECTOR = new MetaTileEntityGasCollector[GTValues.V.length - 1]; public static final MetaTileEntityRockBreaker[] ROCK_BREAKER = new MetaTileEntityRockBreaker[GTValues.V.length - 1]; public static final MetaTileEntityMiner[] MINER = new MetaTileEntityMiner[GTValues.V.length - 1]; @@ -239,8 +211,7 @@ public class MetaTileEntities { public static final SimpleGeneratorMetaTileEntity[] GAS_TURBINE = new SimpleGeneratorMetaTileEntity[4]; // MULTIBLOCK PARTS SECTION - public static final MetaTileEntityItemBus[] ITEM_IMPORT_BUS = new MetaTileEntityItemBus[GTValues.UHV + - 1]; // ULV-UHV + public static final MetaTileEntityItemBus[] ITEM_IMPORT_BUS = new MetaTileEntityItemBus[GTValues.UHV + 1]; // ULV-UHV public static final MetaTileEntityItemBus[] ITEM_EXPORT_BUS = new MetaTileEntityItemBus[GTValues.UHV + 1]; public static final MetaTileEntityFluidHatch[] FLUID_IMPORT_HATCH = new MetaTileEntityFluidHatch[GTValues.UHV + 1]; public static final MetaTileEntityFluidHatch[] FLUID_EXPORT_HATCH = new MetaTileEntityFluidHatch[GTValues.UHV + 1]; @@ -257,8 +228,7 @@ public class MetaTileEntities { public static final MetaTileEntitySubstationEnergyHatch[] SUBSTATION_ENERGY_INPUT_HATCH = new MetaTileEntitySubstationEnergyHatch[5]; // IV, LuV, ZPM, UV, UHV public static final MetaTileEntitySubstationEnergyHatch[] SUBSTATION_ENERGY_OUTPUT_HATCH = new MetaTileEntitySubstationEnergyHatch[5]; // IV, LuV, ZPM, UV, UHV public static final MetaTileEntityRotorHolder[] ROTOR_HOLDER = new MetaTileEntityRotorHolder[6]; // HV, EV, IV, LuV, ZPM, UV - public static final MetaTileEntityMufflerHatch[] MUFFLER_HATCH = new MetaTileEntityMufflerHatch[GTValues.UV + - 1]; // LV-UV + public static final MetaTileEntityMufflerHatch[] MUFFLER_HATCH = new MetaTileEntityMufflerHatch[GTValues.UV + 1]; // LV-UV public static final MetaTileEntityFusionReactor[] FUSION_REACTOR = new MetaTileEntityFusionReactor[3]; public static final MetaTileEntityQuantumChest[] QUANTUM_CHEST = new MetaTileEntityQuantumChest[10]; public static final MetaTileEntityQuantumTank[] QUANTUM_TANK = new MetaTileEntityQuantumTank[10]; diff --git a/src/main/java/gregtech/common/metatileentities/MetaTileEntityHeatExchanger.java b/src/main/java/gregtech/common/metatileentities/MetaTileEntityHeatExchanger.java index 6a8cf33d251..c6054ac252a 100644 --- a/src/main/java/gregtech/common/metatileentities/MetaTileEntityHeatExchanger.java +++ b/src/main/java/gregtech/common/metatileentities/MetaTileEntityHeatExchanger.java @@ -35,16 +35,10 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti protected @NotNull BlockPattern createStructurePattern() { return FactoryBlockPattern.start() .aisle("CCC", "BCB", "ACA") - .aisle("CCC", "CDC", "ACA") - .aisle("CCC", "CDC", "ACA") - .aisle("CCC", "CDC", "ACA") - .aisle("CCC", "CDC", "ACA") - .aisle("CCC", "CDC", "ACA") - .aisle("CCC", "CDC", "ACA") - .aisle("CCC", "CDC", "ACA") + .aisle("CCC", "CDC", "ACA").setRepeatable(7) .aisle("CCC", "BSB", "AEA") .where('S', selfPredicate()) - .where('A', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel))) + .where('A', frames(Materials.Steel)) .where('B', autoAbilities(false, false, false, false, false, true, false).setMinGlobalLimited(2) .or(autoAbilities(false, false, false, false, true, false, false).setMinGlobalLimited(2))) .where('C', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID)) diff --git a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java index 8962f8cbb7f..96abbb2f26b 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java +++ b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java @@ -254,15 +254,18 @@ private boolean isLocked() { } private TextFormatting getLockedTextColor() { - if (lockingState == LockingState.LOCKED) - return TextFormatting.GREEN; - if (lockingState == LockingState.INVALID_COMPONENT) - return TextFormatting.RED; - if (lockingState == LockingState.UNLOCKED) - return TextFormatting.DARK_AQUA; - if (lockingState == LockingState.SHOULD_LOCK) - return TextFormatting.BLACK; - return getWorld().getWorldTime() % 4 >= 2 ? TextFormatting.RED : TextFormatting.YELLOW; + switch (lockingState) { + case LOCKED: + return TextFormatting.GREEN; + case UNLOCKED: + return TextFormatting.DARK_AQUA; + case INVALID_COMPONENT: + return TextFormatting.RED; + case SHOULD_LOCK: + return TextFormatting.BLACK; + default: + return getWorld().getWorldTime() % 4 >= 2 ? TextFormatting.RED : TextFormatting.YELLOW; + } } private void tryLocking(boolean lock) { @@ -294,15 +297,17 @@ protected void addDisplayText(List list) { String.format("%.2f", this.fuelDepletionPercent * 100))); } - protected boolean isBlockEdge(@NotNull World world, @NotNull BlockPos pos, @NotNull EnumFacing direction, + protected boolean isBlockEdge(@NotNull World world, @NotNull BlockPos.MutableBlockPos pos, @NotNull EnumFacing direction, int steps) { - BlockPos test = pos.offset(direction, steps); + pos.move(direction, steps); - if (world.getBlockState(test).getBlock() == MetaBlocks.FISSION_CASING) { + if (world.getBlockState(pos).getBlock() == MetaBlocks.FISSION_CASING) { + pos.move(direction.getOpposite(), steps); return false; } - MetaTileEntity potentialTile = GTUtility.getMetaTileEntity(world, test); + MetaTileEntity potentialTile = GTUtility.getMetaTileEntity(world, pos); + pos.move(direction.getOpposite(), steps); if (potentialTile == null) { return true; } @@ -321,10 +326,11 @@ protected EnumFacing getRight() { /** * Uses the upper layer to determine the diameter of the structure */ - protected int findDiameter(int heightAbove) { + protected int findDiameter() { int i = 1; + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(this.getPos()); while (i <= 15) { - if (this.isBlockEdge(this.getWorld(), this.getPos().offset(getUp(), heightAbove), + if (this.isBlockEdge(this.getWorld(), pos.move(getUp()), this.getFrontFacing().getOpposite(), i)) break; @@ -338,8 +344,9 @@ protected int findDiameter(int heightAbove) { */ protected int findHeight(boolean top) { int i = 1; + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(this.getPos()); while (i <= 15) { - if (this.isBlockEdge(this.getWorld(), this.getPos(), top ? getUp() : getUp().getOpposite(), i)) + if (this.isBlockEdge(this.getWorld(), pos, top ? getUp() : getUp().getOpposite(), i)) break; i++; } @@ -478,7 +485,7 @@ protected BlockPattern createStructurePattern() { this.height = heightTop + heightBottom + 1; - this.diameter = this.getWorld() != null ? Math.max(Math.min(this.findDiameter(heightTop), 15), 5) : 5; + this.diameter = this.getWorld() != null ? Math.max(Math.min(this.findDiameter(), 15), 5) : 5; int radius = this.diameter % 2 == 0 ? (int) Math.floor(this.diameter / 2.f) : Math.round((this.diameter - 1) / 2.f); @@ -926,13 +933,13 @@ protected void setLockingState(LockingState lockingState) { @Override public long getCoverCapacity() { // power is in MW - return (int) (this.maxPower * 1e6); + return (long) (this.maxPower * 1e6); } @Override public long getCoverStored() { // power is in MW - return (int) (this.power * 1e6); + return (long) (this.power * 1e6); } private enum LockingState { @@ -954,6 +961,7 @@ private enum LockingState { INVALID_COMPONENT } + @Override public List getMatchingShapes() { List shapes = new ArrayList<>(); diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityControlRodPort.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityControlRodPort.java index 1633501d497..92d21da7789 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityControlRodPort.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityControlRodPort.java @@ -53,14 +53,14 @@ protected boolean openGUIOnRightClick() { @Override public boolean checkValidity(int depth) { - BlockPos pos = this.getPos(); + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(this.getPos()); for (int i = 1; i < depth; i++) { - if (getWorld().getBlockState(pos.offset(this.frontFacing.getOpposite(), i)) != + if (getWorld().getBlockState(pos.move(this.frontFacing.getOpposite())) != MetaBlocks.FISSION_CASING.getState(BlockFissionCasing.FissionCasingType.CONTROL_ROD_CHANNEL)) { return false; } } - return getWorld().getBlockState(pos.offset(this.frontFacing.getOpposite(), depth)) == + return getWorld().getBlockState(pos.move(this.frontFacing.getOpposite())) == MetaBlocks.FISSION_CASING.getState(BlockFissionCasing.FissionCasingType.REACTOR_VESSEL); } diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java index 4ca2dea5d93..6caf7bbb38b 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityCoolantImportHatch.java @@ -113,15 +113,15 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, @Override public boolean checkValidity(int depth) { - BlockPos pos = this.getPos(); + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(this.getPos()); for (int i = 1; i < depth; i++) { - if (getWorld().getBlockState(pos.offset(this.frontFacing.getOpposite(), i)) != + if (getWorld().getBlockState(pos.move(this.frontFacing.getOpposite())) != MetaBlocks.FISSION_CASING.getState(BlockFissionCasing.FissionCasingType.COOLANT_CHANNEL)) { return false; } } if (getWorld() - .getTileEntity(pos.offset(this.frontFacing.getOpposite(), depth)) instanceof IGregTechTileEntity gtTe) { + .getTileEntity(pos.move(this.frontFacing.getOpposite())) instanceof IGregTechTileEntity gtTe) { return gtTe.getMetaTileEntity().metaTileEntityId.equals(MetaTileEntities.COOLANT_OUTPUT.metaTileEntityId); } return false; diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java index 5474ee1e27e..fe5edd5c762 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityFuelRodImportBus.java @@ -225,15 +225,15 @@ public LockableItemStackHandler getStackHandler() { } public MetaTileEntityFuelRodExportBus getExportHatch(int depth) { - BlockPos pos = this.getPos(); + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(this.getPos()); for (int i = 1; i < depth; i++) { - if (getWorld().getBlockState(pos.offset(this.frontFacing.getOpposite(), i)) != + if (getWorld().getBlockState(pos.move(this.frontFacing.getOpposite())) != MetaBlocks.FISSION_CASING.getState(BlockFissionCasing.FissionCasingType.FUEL_CHANNEL)) { return null; } } if (getWorld() - .getTileEntity(pos.offset(this.frontFacing.getOpposite(), depth)) instanceof IGregTechTileEntity gtTe) { + .getTileEntity(pos.move(this.frontFacing.getOpposite())) instanceof IGregTechTileEntity gtTe) { MetaTileEntity mte = gtTe.getMetaTileEntity(); if (mte instanceof MetaTileEntityFuelRodExportBus) { return (MetaTileEntityFuelRodExportBus) mte; diff --git a/src/main/java/gregtech/integration/jei/utils/render/ItemStackTextRenderer.java b/src/main/java/gregtech/integration/jei/utils/render/ItemStackTextRenderer.java index a9d2a88c316..09b42d041b9 100644 --- a/src/main/java/gregtech/integration/jei/utils/render/ItemStackTextRenderer.java +++ b/src/main/java/gregtech/integration/jei/utils/render/ItemStackTextRenderer.java @@ -60,7 +60,7 @@ public void render(@NotNull Minecraft minecraft, int xPosition, int yPosition, @ if (chanceBase >= 100 || chanceBase == 0) { s = (this.chanceBase / 100) + "%"; } else { - s = "." + this.chanceBase + "%"; + s = "0." + this.chanceBase + "%"; } if (this.chanceLogic != null && this.chanceLogic != ChancedOutputLogic.NONE && this.chanceLogic != ChancedOutputLogic.OR) { diff --git a/src/main/resources/assets/gregtech/lang/en_us.lang b/src/main/resources/assets/gregtech/lang/en_us.lang index 4f0f3b4d612..5f74fcf1fd5 100644 --- a/src/main/resources/assets/gregtech/lang/en_us.lang +++ b/src/main/resources/assets/gregtech/lang/en_us.lang @@ -5523,6 +5523,7 @@ gregtech.fluid.liquid_generic=Liquid %s gregtech.fluid.gas_generic=%s Gas gregtech.fluid.gas_vapor=%s Vapor gregtech.fluid.plasma=%s Plasma +gregtech.fluid.molten=Molten %s gregtech.fluid.empty=Empty gregtech.fluid.amount=§9Amount: %,d/%,d L gregtech.fluid.temperature=§cTemperature: %,d K diff --git a/src/main/resources/assets/gregtech/textures/blocks/fluids/fluid.high_pressure_steam.png b/src/main/resources/assets/gregtech/textures/blocks/fluids/fluid.high_pressure_steam.png new file mode 100644 index 0000000000000000000000000000000000000000..4ef78c9f0299cae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tech/textures/blocks/fluids/fluid.high_pressure_steam.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/fluids/fluid.high_pressure_steam.png.mcmeta new file mode 100644 index 00000000000..87c542d2956 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/fluids/fluid.high_pressure_steam.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":1 + } +} \ No newline at end of file