-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
218 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
### Additions | ||
* Added visibility options for the EMI config and recipe tree buttons | ||
* EMI config button now is visible by default when toggled, to prevent people from accidentally hiding the mod without knowing how to undo it | ||
* Search sidebar target can be configured | ||
|
||
### Tweaks | ||
* EMI visibility toast is now only shown when help level is verbose, due to other features preventing accidental hiding | ||
* EMI config enum selection screen now is consistent with the rest of the config screen on later versions | ||
* Notable performance improvements to ingredient construction | ||
* Wrap packet sends with a check in later versions | ||
* Improved accuracy of EMI reloading errors | ||
|
||
### Fixes | ||
* Fixed JEI dependency on 1.19 versions #780 | ||
* Fixed stack default bind not toggling in recipe tree | ||
* #689 | ||
* Serialization of stacks with sizes other than 1 now serialize properly #803 | ||
* Fix tag ingredient rendering in Fabulous #811 | ||
* Fix stack batcher causing certain recipe tree categories to render at the wrong position #790 | ||
* Populate item groupps in correct order (fixing duplicate items) #774 #603 #621 | ||
* Pick which sidebar search targets #377 | ||
* Fix search baking hang #800 | ||
* Fix certain JEI integration breaking inconsistently on NeoForge | ||
|
||
### API | ||
* Added experimental API to get query if stack is disabled from EmiRegistry | ||
* Added experimental API to get EmiTooltipMetadata from composed tooltips being rendered for mod compatibility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
xplat/src/main/java/dev/emi/emi/api/render/EmiTooltipMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package dev.emi.emi.api.render; | ||
|
||
import java.util.List; | ||
|
||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
import dev.emi.emi.api.recipe.EmiRecipe; | ||
import dev.emi.emi.api.stack.EmiIngredient; | ||
import dev.emi.emi.api.stack.EmiStack; | ||
import dev.emi.emi.screen.tooltip.EmiTextTooltipWrapper; | ||
import dev.emi.emi.screen.tooltip.RecipeTooltipComponent; | ||
import net.minecraft.client.gui.tooltip.TooltipComponent; | ||
|
||
/** | ||
* Represents metadata about tooltips that EMI creates. | ||
* Context includes what stack is having its tooltip rendered. | ||
* This information can be useful for mods modifying the display of tooltips. | ||
*/ | ||
@ApiStatus.Experimental | ||
public class EmiTooltipMetadata { | ||
private static final EmiTooltipMetadata EMPTY = new EmiTooltipMetadata(EmiStack.EMPTY, null); | ||
private final EmiIngredient stack; | ||
private final EmiRecipe recipe; | ||
|
||
private EmiTooltipMetadata(EmiIngredient stack, EmiRecipe recipe) { | ||
this.stack = stack; | ||
this.recipe = recipe; | ||
} | ||
|
||
/** | ||
* @return The stack responsible for the tooltip, or {@link EmiStack#EMPTY} if not present. | ||
*/ | ||
public EmiIngredient getStack() { | ||
return stack; | ||
} | ||
|
||
/** | ||
* @return The recipe context for the tooltip, or {@code null} if not present. | ||
*/ | ||
public EmiRecipe getRecipe() { | ||
return recipe; | ||
} | ||
|
||
/** | ||
* Constructs an {@link EmiTooltipMetadata} object based on a list of tooltip components. | ||
* This can be useful for retrieving otherwised erased information, like the {@link EmiIngredient}, from a tooltip. | ||
*/ | ||
public static EmiTooltipMetadata of(List<TooltipComponent> tooltip) { | ||
if (!tooltip.isEmpty()) { | ||
TooltipComponent title = tooltip.get(0); | ||
EmiRecipe recipe = null; | ||
for (TooltipComponent comp : tooltip) { | ||
if (comp instanceof RecipeTooltipComponent rtc) { | ||
recipe = rtc.getRecipe(); | ||
break; | ||
} | ||
} | ||
if (title instanceof EmiTextTooltipWrapper ettw && !ettw.stack.isEmpty()) { | ||
return new EmiTooltipMetadata(ettw.stack, recipe); | ||
} | ||
} | ||
return EMPTY; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.