-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow MTEs / recipe map workables to directly control their JEI categ…
…ories (#2479)
- Loading branch information
Showing
4 changed files
with
91 additions
and
9 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
51 changes: 51 additions & 0 deletions
51
src/main/java/gregtech/api/recipes/category/ICategoryOverride.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,51 @@ | ||
package gregtech.api.recipes.category; | ||
|
||
import gregtech.api.recipes.RecipeMap; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* When a registered mte's class or recipe logic implements this interface, the mte is associated with the override's | ||
* recipe maps in JEI. | ||
*/ | ||
public interface ICategoryOverride { | ||
|
||
/** | ||
* Controls whether the override should be performed or not. | ||
* Useful to disable overrides if a class's parent implements this interface. | ||
* | ||
* @return whether the override should be performed or not | ||
*/ | ||
default boolean shouldOverride() { | ||
return true; | ||
} | ||
|
||
/** | ||
* Controls whether the normal logic for determining JEI category association should be completely replaced. | ||
* | ||
* @return whether to ignore normal logic or not | ||
*/ | ||
default boolean shouldReplace() { | ||
return true; | ||
} | ||
|
||
/** | ||
* The actual overrides for JEI recipe map category association. | ||
* | ||
* @return an array of recipe maps the mte should be associated with in JEI. Can be empty, but not null. | ||
*/ | ||
default @NotNull RecipeMap<?> @NotNull [] getJEIRecipeMapCategoryOverrides() { | ||
return new RecipeMap[] {}; | ||
} | ||
|
||
/** | ||
* Allows JEI category association using JEI's underlying API. | ||
* Use this to associate a multiblock with solid, burnable fuel recipes for example. | ||
* | ||
* @return an array of recipe category UUIDs that are valid for JEI's | ||
* {@link mezz.jei.api.IModRegistry#addRecipeCatalyst(Object, String...)} method. | ||
*/ | ||
default @NotNull String @NotNull [] getJEICategoryOverrides() { | ||
return new String[] {}; | ||
} | ||
} |
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