diff options
author | Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> | 2022-10-18 01:38:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 19:38:47 +0200 |
commit | 4ed98b32a3075a8c503a6819896e99e012cf3d17 (patch) | |
tree | 016bf1dcebfb9d52707edf2d72551e4cc68c6322 /src/main/java/gregtech/common/fluid/GT_Fluid.java | |
parent | 4bcf8abf671020ff1ed07632af010c367509ab31 (diff) | |
download | GT5-Unofficial-4ed98b32a3075a8c503a6819896e99e012cf3d17.tar.gz GT5-Unofficial-4ed98b32a3075a8c503a6819896e99e012cf3d17.tar.bz2 GT5-Unofficial-4ed98b32a3075a8c503a6819896e99e012cf3d17.zip |
allow reload the fluid texture (#1477)
fix fluid texture corruption after resource reload. e.g. switch language in game
https://cdn.discordapp.com/attachments/522098956491030558/1031599367116836965/unknown.png
Diffstat (limited to 'src/main/java/gregtech/common/fluid/GT_Fluid.java')
-rw-r--r-- | src/main/java/gregtech/common/fluid/GT_Fluid.java | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/main/java/gregtech/common/fluid/GT_Fluid.java b/src/main/java/gregtech/common/fluid/GT_Fluid.java index e768358503..dc40d35024 100644 --- a/src/main/java/gregtech/common/fluid/GT_Fluid.java +++ b/src/main/java/gregtech/common/fluid/GT_Fluid.java @@ -24,7 +24,6 @@ public class GT_Fluid extends Fluid implements IGT_Fluid, IGT_RegisteredFluid, R private final FluidState fluidState; private final Fluid iconsFrom; private Fluid registeredFluid; - private boolean hasRun = false; /** * Constructs this {@link IGT_Fluid} implementation from an {@link GT_FluidBuilder} instance @@ -186,21 +185,18 @@ public class GT_Fluid extends Fluid implements IGT_Fluid, IGT_RegisteredFluid, R */ @Override public void run() { - if (!hasRun) { - if (iconsFrom instanceof GT_Fluid) { - // Needs the GT_Fluid to have registered its icons - ((GT_Fluid) iconsFrom).run(); - stillIcon = iconsFrom.getStillIcon(); - flowingIcon = iconsFrom.getFlowingIcon(); - } else { - if (stillIconResourceLocation != null) { - stillIcon = GregTech_API.sBlockIcons.registerIcon(stillIconResourceLocation.toString()); - } - if (flowingIconResourceLocation != null) { - flowingIcon = GregTech_API.sBlockIcons.registerIcon(flowingIconResourceLocation.toString()); - } + if (iconsFrom instanceof GT_Fluid) { + // Needs the GT_Fluid to have registered its icons + ((GT_Fluid) iconsFrom).run(); + stillIcon = iconsFrom.getStillIcon(); + flowingIcon = iconsFrom.getFlowingIcon(); + } else { + if (stillIconResourceLocation != null) { + stillIcon = GregTech_API.sBlockIcons.registerIcon(stillIconResourceLocation.toString()); + } + if (flowingIconResourceLocation != null) { + flowingIcon = GregTech_API.sBlockIcons.registerIcon(flowingIconResourceLocation.toString()); } - hasRun = true; } } } |