Skip to content

Commit

Permalink
Allow material fluid name overrides (#1934)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Aug 10, 2023
1 parent 33c3fa4 commit c4dd79c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/gregtech/api/fluids/MaterialFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ public String getUnlocalizedName() {
@Override
@SideOnly(Side.CLIENT)
public String getLocalizedName(FluidStack stack) {
String localizedName = I18n.format(getUnlocalizedName());
String localizedName;
String customTranslationKey = "fluid." + material.getUnlocalizedName();

if (I18n.hasKey(customTranslationKey)) {
localizedName = I18n.format(customTranslationKey);
} else {
localizedName = I18n.format(getUnlocalizedName());
}

if (fluidType != null) {
return I18n.format(fluidType.getLocalization(), localizedName);
}
Expand Down

0 comments on commit c4dd79c

Please sign in to comment.