-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from ldtteam/feature/speed-up
Improve performance of cycle detection and analysis
- Loading branch information
Showing
39 changed files
with
845 additions
and
252 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,4 +1,5 @@ | ||
# Aequivaleo | ||
|
||
Library and mediator mod which allows for high-speed recipe and equivalency analysis in alchemy mods. | ||
More documentation to follow, please join our discord for more information: https://discord.gg/7KxvDa86jW | ||
More documentation to follow, please join our discord for more information: https://discord.gg/7KxvDa86jW | ||
We will be adding a dedicated wiki for this mod soon. |
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
37 changes: 37 additions & 0 deletions
37
src/api/java/com/ldtteam/aequivaleo/api/tag/ITagContentsRetriever.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,37 @@ | ||
package com.ldtteam.aequivaleo.api.tag; | ||
|
||
import com.ldtteam.aequivaleo.api.IAequivaleoAPI; | ||
import com.ldtteam.aequivaleo.api.compound.container.ICompoundContainer; | ||
import net.minecraft.core.RegistryAccess; | ||
import net.minecraft.tags.TagKey; | ||
|
||
import java.util.Set; | ||
import java.util.function.BiFunction; | ||
import java.util.function.Predicate; | ||
|
||
/** | ||
* Allows for the retrieval of tag contents. | ||
*/ | ||
public interface ITagContentsRetriever { | ||
|
||
/** | ||
* Gets the instance of the tag contents retriever. | ||
* | ||
* @return The instance of the tag contents retriever. | ||
*/ | ||
static ITagContentsRetriever getInstance() { | ||
return IAequivaleoAPI.getInstance().getTagContentsRetriever(); | ||
} | ||
|
||
/** | ||
* Registers a handler for a tag. | ||
* Of all registered handlers: The first one that returns a non-empty set of contents will be used. | ||
* <p> | ||
* If no handler is registered for a tag, the tag will be considered empty. | ||
* | ||
* @param selector The selector for the tag. | ||
* @param retriever The retriever for the tag. | ||
* @param <T> The type of the tag. | ||
*/ | ||
<T> void registerHandler(final Predicate<TagKey<T>> selector, final BiFunction<RegistryAccess, TagKey<T>, Set<ICompoundContainer<?>>> retriever); | ||
} |
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.