From c4dd79cf66ebe4e659fe5ab6f7cdd0b6bc868d4f Mon Sep 17 00:00:00 2001 From: TechLord22 <37029404+TechLord22@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:38:53 -0400 Subject: [PATCH] Allow material fluid name overrides (#1934) --- src/main/java/gregtech/api/fluids/MaterialFluid.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/fluids/MaterialFluid.java b/src/main/java/gregtech/api/fluids/MaterialFluid.java index 2084f97b4c0..6d128d366ce 100644 --- a/src/main/java/gregtech/api/fluids/MaterialFluid.java +++ b/src/main/java/gregtech/api/fluids/MaterialFluid.java @@ -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); }