diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-09-23 17:12:42 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-09-23 17:12:42 +0800 |
| commit | 6532c032ca7823592b40b55ffb6723ee425ba329 (patch) | |
| tree | cfa26e874f63536d0a447b4620d28d1455b869e6 /RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java | |
| parent | 72e44a1432f831bdbd42f1c8a574bf22e8b4a481 (diff) | |
| download | RoughlyEnoughItems-6532c032ca7823592b40b55ffb6723ee425ba329.tar.gz RoughlyEnoughItems-6532c032ca7823592b40b55ffb6723ee425ba329.tar.bz2 RoughlyEnoughItems-6532c032ca7823592b40b55ffb6723ee425ba329.zip | |
Use Block#getName to get the fluid name, thanks Technici4n!
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.java | 9 |
1 files changed, 1 insertions, 8 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 d114b46a5..76f586b68 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 @@ -37,20 +37,16 @@ import me.shedaniel.rei.api.ConfigObject; 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.ImmutableLiteralText; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.resources.language.I18n; import net.minecraft.core.Registry; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluids; -import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -239,9 +235,6 @@ public class FluidEntryStack extends AbstractEntryStack { @NotNull @Override public Component asFormattedText() { - ResourceLocation id = Registry.FLUID.getKey(fluid); - if (I18n.exists("block." + id.toString().replaceFirst(":", "."))) - return new ImmutableLiteralText(I18n.get("block." + id.toString().replaceFirst(":", "."))); - return new ImmutableLiteralText(CollectionUtils.mapAndJoinToString(id.getPath().split("_"), StringUtils::capitalize, " ")); + return fluid.defaultFluidState().createLegacyBlock().getBlock().getName(); } } |
