Skip to content

Commit

Permalink
fix most gases using the wrong translation key (GregTechCEu#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Jul 20, 2024
1 parent 75735fa commit bee5a11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/main/java/gregtech/api/fluids/store/FluidStorageKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class FluidStorageKeys {
}

FluidProperty property = m.getProperty(PropertyKey.FLUID);
if (m.isElement() || (property != null && property.getPrimaryKey() != FluidStorageKeys.LIQUID)) {
if (m.isElement() || property == null || property.getPrimaryKey() != FluidStorageKeys.GAS) {
return "gregtech.fluid.gas_generic";
}
return "gregtech.fluid.generic";
Expand All @@ -43,13 +43,15 @@ public final class FluidStorageKeys {
private FluidStorageKeys() {}

/**
* Used to create registry names for fluids that only have a prefix when not stored by the primary key.
*
* @param prefix the prefix string for the registry name
* @param key the key which does not require the prefix
* @param material the material to create a registry name for
* @return the registry name
*/
private static @NotNull String prefixedRegistryName(@NotNull String prefix, @NotNull FluidStorageKey key,
@NotNull Material material) {
public static @NotNull String prefixedRegistryName(@NotNull String prefix, @NotNull FluidStorageKey key,
@NotNull Material material) {
FluidProperty property = material.getProperty(PropertyKey.FLUID);
if (property != null && property.getPrimaryKey() != key) {
return prefix + material.getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ public static void register() {

Krypton = new Material.Builder(52, gregtechId("krypton"))
.gas(new FluidBuilder()
.customStill()
.translation("gregtech.fluid.generic"))
.customStill())
.color(0x80FF80)
.element(Elements.Kr)
.build();
Expand Down

0 comments on commit bee5a11

Please sign in to comment.