aboutsummaryrefslogtreecommitdiff
path: root/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-09-22 12:20:12 +0800
committershedaniel <daniel@shedaniel.me>2020-09-22 12:20:12 +0800
commit72e44a1432f831bdbd42f1c8a574bf22e8b4a481 (patch)
tree42ce881152e2dab8f4378612c45226ea9b0a773a /RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
parentb76420e3bd81886593587c295284b33e57b29cdf (diff)
downloadRoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.tar.gz
RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.tar.bz2
RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.zip
Fix #409 and more
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java')
-rw-r--r--RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
index 2d777869e..d114b46a5 100644
--- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
+++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java
@@ -38,8 +38,8 @@ import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.fractions.Fraction;
import me.shedaniel.rei.api.widgets.Tooltip;
import me.shedaniel.rei.utils.CollectionUtils;
-import me.shedaniel.rei.utils.FormattingUtils;
import me.shedaniel.rei.utils.ImmutableLiteralText;
+import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@@ -200,18 +200,12 @@ public class FluidEntryStack extends AbstractEntryStack {
if (amountTooltip != null)
toolTip.addAll(Stream.of(amountTooltip.split("\n")).map(TextComponent::new).collect(Collectors.toList()));
}
+ if (Minecraft.getInstance().options.advancedItemTooltips) {
+ toolTip.add((new TextComponent(Registry.FLUID.getKey(this.getFluid()).toString())).withStyle(ChatFormatting.DARK_GRAY));
+ }
toolTip.addAll(get(Settings.TOOLTIP_APPEND_EXTRA).apply(this));
if (get(Settings.TOOLTIP_APPEND_MOD).get() && ConfigObject.getInstance().shouldAppendModNames()) {
- ResourceLocation id = Registry.FLUID.getKey(fluid);
- final String modId = ClientHelper.getInstance().getModFromIdentifier(id);
- boolean alreadyHasMod = false;
- for (Component s : toolTip)
- if (FormattingUtils.stripFormatting(s.getString()).equalsIgnoreCase(modId)) {
- alreadyHasMod = true;
- break;
- }
- if (!alreadyHasMod)
- toolTip.add(ClientHelper.getInstance().getFormattedModFromIdentifier(id));
+ ClientHelper.getInstance().appendModIdToTooltips(toolTip, Registry.FLUID.getKey(getFluid()).getNamespace());
}
return Tooltip.create(toolTip);
}