Skip to content

Commit

Permalink
Add id to advanced fluid tooltips in neo
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyploszaj committed Sep 29, 2024
1 parent 41598a7 commit 2975b06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Tweaks
* NeoForge fluid tooltips now include ID with advanced tooltips on
* Added new JEI features to JEI/EMI compatibility

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import net.minecraft.recipe.Ingredient;
import net.minecraft.screen.PlayerScreenHandler;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions;
import net.neoforged.neoforge.common.brewing.BrewingRecipe;
Expand Down Expand Up @@ -261,7 +262,13 @@ protected Text getFluidNameAgnos(Fluid fluid, ComponentChanges componentChanges)

@Override
protected List<Text> getFluidTooltipAgnos(Fluid fluid, ComponentChanges componentChanges) {
return List.of(getFluidName(fluid, componentChanges));
List<Text> tooltip = Lists.newArrayList();
tooltip.add(getFluidName(fluid, componentChanges));
MinecraftClient client = MinecraftClient.getInstance();
if (client.options.advancedItemTooltips) {
tooltip.add(EmiPort.literal(EmiPort.getFluidRegistry().getId(fluid).toString()).formatted(Formatting.DARK_GRAY));
}
return tooltip;
}

@Override
Expand Down

0 comments on commit 2975b06

Please sign in to comment.