Skip to content

Commit

Permalink
Rename translation strings for Ethylene to match the internal name an…
Browse files Browse the repository at this point in the history
…d the IUPAC standard of Ethene. Also add aliases to search to help ease transition, and make EMI chemical serializers use the registry name as the prefix
  • Loading branch information
pupnewfster committed May 10, 2024
1 parent 5a342c9 commit 216cf0d
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 55 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/datagen/generated/mekanism/assets/mekanism/lang/en_ud.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/datagen/generated/mekanism/assets/mekanism/lang/en_us.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void addAdvancements() {
add(GeneratorsAdvancements.HEAT_GENERATOR, "Your First Generator", "Craft a Heat Generator to start making power");
add(GeneratorsAdvancements.SOLAR_GENERATOR, "Power of the Sun", "Renewable daytime energy");
add(GeneratorsAdvancements.WIND_GENERATOR, "Spin Baby Spin", "Hopefully there is some wind nearby");
add(GeneratorsAdvancements.BURN_THE_GAS, "Burn the Gas", "Craft a Gas-Burning Generator to burn Ethylene");
add(GeneratorsAdvancements.BURN_THE_GAS, "Burn the Gas", "Craft a Gas-Burning Generator to burn Ethene");
}

private void addMisc() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void addTags() {

addTag(MekanismTags.Fluids.BRINE, "Brine");
addTag(MekanismTags.Fluids.CHLORINE, "Chlorine");
addTag(MekanismTags.Fluids.ETHENE, "Ethylene");
addTag(MekanismTags.Fluids.ETHENE, "Ethene");
addTag(MekanismTags.Fluids.HEAVY_WATER, "Heavy Water");
addTag(MekanismTags.Fluids.HYDROGEN, "Hydrogen");
addTag(MekanismTags.Fluids.HYDROGEN_CHLORIDE, "Hydrogen Chloride");
Expand Down Expand Up @@ -512,7 +512,7 @@ private void addFluids() {
addFluid(MekanismFluids.HYDROFLUORIC_ACID, "Liquid Hydrofluoric Acid");
addFluid(MekanismFluids.URANIUM_OXIDE, "Liquid Uranium Oxide");
addFluid(MekanismFluids.URANIUM_HEXAFLUORIDE, "Liquid Uranium Hexafluoride");
addFluid(MekanismFluids.ETHENE, "Liquid Ethylene");
addFluid(MekanismFluids.ETHENE, "Liquid Ethene");
addFluid(MekanismFluids.SODIUM, "Liquid Sodium");
addFluid(MekanismFluids.SUPERHEATED_SODIUM, "Liquid Superheated Sodium");
addFluid(MekanismFluids.BRINE, "Brine");
Expand Down Expand Up @@ -541,7 +541,7 @@ private void addGases() {
add(MekanismGases.HYDROFLUORIC_ACID, "Hydrofluoric Acid");
add(MekanismGases.URANIUM_OXIDE, "Uranium Oxide");
add(MekanismGases.URANIUM_HEXAFLUORIDE, "Uranium Hexafluoride");
add(MekanismGases.ETHENE, "Ethylene");
add(MekanismGases.ETHENE, "Ethene");
add(MekanismGases.SODIUM, "Sodium");
add(MekanismGases.SUPERHEATED_SODIUM, "Superheated Sodium");
add(MekanismGases.BRINE, "Gaseous Brine");
Expand Down Expand Up @@ -1033,6 +1033,9 @@ private void addMisc() {
add(MekanismLang.PROCESS_RATE_MB, "Process Rate: %1$s mB/t");
add(MekanismLang.TICKS_REQUIRED, "Ticks Required: %1$s");
add(MekanismLang.DECAY_IMMUNE, "Will not decay inside a Radioactive Waste Barrel");
//Alias stuff
add(MekanismLang.ALSO_KNOWN_AS, "Also known as %1$s");
add(MekanismLang.ETHENE_ETHYLENE_ALIAS, "Ethylene");
//Gui stuff
add(MekanismLang.WIDTH, "Width");
add(MekanismLang.HEIGHT, "Height");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class MekanismGenerators implements IModModule {
public static final String MODID = "mekanismgenerators";
private static final ConfigBasedCachedFLSupplier ETHENE_ENERGY_DENSITY = new ConfigBasedCachedFLSupplier(() -> {
FloatingLong energy = MekanismGeneratorsConfig.generators.bioGeneration.get().multiply(2)
.timesEqual(MekanismGeneratorsConfig.generators.ethyleneDensityMultiplier.get());
.timesEqual(MekanismGeneratorsConfig.generators.etheneDensityMultiplier.get());
return energy.plusEqual(MekanismConfig.general.FROM_H2.get());
}, MekanismConfig.general.FROM_H2, MekanismGeneratorsConfig.generators.bioGeneration, MekanismGeneratorsConfig.generators.ethyleneDensityMultiplier);
}, MekanismConfig.general.FROM_H2, MekanismGeneratorsConfig.generators.bioGeneration, MekanismGeneratorsConfig.generators.etheneDensityMultiplier);

public static MekanismGenerators instance;

Expand Down Expand Up @@ -106,7 +106,7 @@ public static ResourceLocation rl(String path) {
private void commonSetup(FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
//Add fuel attribute to ethene
MekanismGases.ETHENE.get().addAttribute(new Fuel(MekanismGeneratorsConfig.generators.ethyleneBurnTicks, ETHENE_ENERGY_DENSITY));
MekanismGases.ETHENE.get().addAttribute(new Fuel(MekanismGeneratorsConfig.generators.etheneBurnTicks, ETHENE_ENERGY_DENSITY));
//Register dispenser behaviors
GeneratorsFluids.FLUIDS.registerBucketDispenserBehavior();
//Register extended build commands (in enqueue as it is not thread safe)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public class GeneratorsConfig extends BaseMekanismConfig {
public final CachedIntValue heatGenerationFluidRate;

public final CachedLongValue gbgTankCapacity;
public final CachedIntValue ethyleneBurnTicks;
public final CachedFloatingLongValue ethyleneDensityMultiplier;
public final CachedIntValue etheneBurnTicks;
public final CachedFloatingLongValue etheneDensityMultiplier;

public final CachedFloatingLongValue solarGeneration;
public final CachedIntValue turbineBladesPerCoil;
Expand Down Expand Up @@ -120,10 +120,10 @@ public class GeneratorsConfig extends BaseMekanismConfig {
builder.comment("Gas-Burning Generator Settings").push(GAS_CATEGORY);
gbgTankCapacity = CachedLongValue.wrap(this, builder.comment("The capacity in mB of the gas tank in the Gas-Burning Generator.")
.defineInRange("tankCapacity", 18L * FluidType.BUCKET_VOLUME, 1, Long.MAX_VALUE));
ethyleneBurnTicks = CachedIntValue.wrap(this, builder.comment("The number of ticks each mB of Ethylene burns for in the Gas-Burning Generator.")
.defineInRange("ethyleneBurnTicks", 2 * SharedConstants.TICKS_PER_SECOND, 1, Integer.MAX_VALUE));
ethyleneDensityMultiplier = CachedFloatingLongValue.define(this, builder, "Multiplier for calculating the energy density of Ethylene (1 mB Hydrogen + 2 * bioGeneration * densityMultiplier).",
"ethyleneDensityMultiplier", FloatingLong.createConst(40), CachedFloatingLongValue.POSITIVE);
etheneBurnTicks = CachedIntValue.wrap(this, builder.comment("The number of ticks each mB of Ethene burns for in the Gas-Burning Generator.")
.defineInRange("etheneBurnTicks", 2 * SharedConstants.TICKS_PER_SECOND, 1, Integer.MAX_VALUE));
etheneDensityMultiplier = CachedFloatingLongValue.define(this, builder, "Multiplier for calculating the energy density of Ethene (1 mB Hydrogen + 2 * bioGeneration * densityMultiplier).",
"etheneDensityMultiplier", FloatingLong.createConst(40), CachedFloatingLongValue.POSITIVE);
builder.pop();

builder.comment("Turbine Settings").push(TURBINE_CATEGORY);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mekanism.client.recipe_viewer.emi;

import dev.emi.emi.api.EmiRegistry;
import dev.emi.emi.api.stack.EmiStack;
import dev.emi.emi.api.stack.serializer.EmiStackSerializer;
import java.util.Optional;
Expand All @@ -13,17 +14,13 @@
public class ChemicalEmiIngredientSerializer<CHEMICAL extends Chemical<CHEMICAL>, EMI_STACK extends ChemicalEmiStack<CHEMICAL>> implements EmiStackSerializer<EMI_STACK> {

private final EmiStackCreator<CHEMICAL, EMI_STACK> stackCreator;
final Registry<CHEMICAL> registry;
private final Registry<CHEMICAL> registry;
private final String type;

public ChemicalEmiIngredientSerializer(String type, Registry<CHEMICAL> registry, EmiStackCreator<CHEMICAL, EMI_STACK> stackCreator) {
this.type = type;
ChemicalEmiIngredientSerializer(Registry<CHEMICAL> registry, EmiStackCreator<CHEMICAL, EMI_STACK> stackCreator) {
this.registry = registry;
this.stackCreator = stackCreator;
}

public EmiStack create(CHEMICAL chemical) {
return stackCreator.create(chemical, 1);
this.type = registry.key().location().toString().replace(':', '_');
}

@Override
Expand All @@ -40,6 +37,14 @@ public String getType() {
return type;
}

void addEmiStacks(EmiRegistry emiRegistry) {
for (CHEMICAL chemical : registry) {
if (!chemical.isHidden()) {
emiRegistry.addEmiStack(stackCreator.create(chemical, 1));
}
}
}

@FunctionalInterface
public interface EmiStackCreator<CHEMICAL extends Chemical<CHEMICAL>, EMI_STACK extends ChemicalEmiStack<CHEMICAL>> {

Expand Down
Loading

0 comments on commit 216cf0d

Please sign in to comment.