Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.19.3] JEI menus use creative TooltipFlags instead of non-creative ones to match with the Creative Menu. #3111

Open
wants to merge 1 commit into
base: 1.19.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static <V> List<Component> getMutableIngredientTooltipSafe(V ingredient,
try {
Minecraft minecraft = Minecraft.getInstance();
TooltipFlag.Default tooltipFlag = minecraft.options.advancedItemTooltips ? TooltipFlag.Default.ADVANCED : TooltipFlag.Default.NORMAL;
tooltipFlag = tooltipFlag.asCreative();
List<Component> tooltip = ingredientRenderer.getTooltip(ingredient, tooltipFlag);
return new ArrayList<>(tooltip);
} catch (RuntimeException | LinkageError e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Optional<String> getCreatorModId(ItemStack stack) {
@Override
public List<Component> getTestTooltip(@Nullable Player player, ItemStack itemStack) {
try {
return itemStack.getTooltipLines(player, TooltipFlag.Default.NORMAL);
return itemStack.getTooltipLines(player, TooltipFlag.Default.NORMAL.asCreative());
} catch (LinkageError | RuntimeException e) {
LOGGER.error("Error while Testing for mod name formatting", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public List<Component> getTestTooltip(@Nullable Player player, ItemStack itemSta
try {
List<Component> tooltip = new ArrayList<>();
tooltip.add(Component.literal("JEI Tooltip Testing for mod name formatting"));
ItemTooltipEvent tooltipEvent = ForgeEventFactory.onItemTooltip(itemStack, player, tooltip, TooltipFlag.Default.NORMAL);
ItemTooltipEvent tooltipEvent = ForgeEventFactory.onItemTooltip(itemStack, player, tooltip, TooltipFlag.Default.NORMAL.asCreative());
return tooltipEvent.getToolTip();
} catch (LinkageError | RuntimeException e) {
LOGGER.error("Error while Testing for mod name formatting", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void testConfigBlacklist() {
}

public static List<String> getTooltipStrings(IIngredientRenderer<TestIngredient> ingredientRenderer, TestIngredient testIngredient) {
List<Component> tooltip = ingredientRenderer.getTooltip(testIngredient, TooltipFlag.Default.NORMAL);
List<Component> tooltip = ingredientRenderer.getTooltip(testIngredient, TooltipFlag.Default.NORMAL.asCreative());
return tooltip.stream()
.map(Component::getString)
.map(Translator::toLowercaseWithLocale)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static <T> String getDisplayName(T ingredient, IIngredientHelper<T> ingre
@Unmodifiable
public static <T> List<String> getTooltipStrings(T ingredient, IIngredientRenderer<T> ingredientRenderer, Set<String> toRemove, IIngredientFilterConfig config) {
TooltipFlag.Default tooltipFlag = config.getSearchAdvancedTooltips() ? TooltipFlag.Default.ADVANCED : TooltipFlag.Default.NORMAL;
tooltipFlag = tooltipFlag.asCreative();
List<Component> tooltip = ingredientRenderer.getTooltip(ingredient, tooltipFlag);
return tooltip.stream()
.map(Component::getString)
Expand Down