-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed server script load order. Still need to fix tags in recipes
- Loading branch information
1 parent
fd04041
commit 62a378e
Showing
20 changed files
with
159 additions
and
96 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
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
33 changes: 0 additions & 33 deletions
33
src/main/java/dev/latvian/mods/kubejs/integration/jei/InformationJEIKubeEvent.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/main/java/dev/latvian/mods/kubejs/integration/jei/JEIAddInformationKubeEvent.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,40 @@ | ||
package dev.latvian.mods.kubejs.integration.jei; | ||
|
||
import dev.latvian.mods.kubejs.recipe.viewer.AddInformationKubeEvent; | ||
import dev.latvian.mods.kubejs.recipe.viewer.RecipeViewerEntryType; | ||
import dev.latvian.mods.rhino.Context; | ||
import mezz.jei.api.ingredients.IIngredientType; | ||
import mezz.jei.api.registration.IRecipeRegistration; | ||
import net.minecraft.network.chat.Component; | ||
|
||
import java.util.Collection; | ||
import java.util.function.Predicate; | ||
|
||
public class JEIAddInformationKubeEvent implements AddInformationKubeEvent { | ||
private final RecipeViewerEntryType type; | ||
private final IIngredientType ingredientType; | ||
private final IRecipeRegistration registration; | ||
private Collection allIngredients; | ||
|
||
public JEIAddInformationKubeEvent(RecipeViewerEntryType type, IIngredientType<?> ingredientType, IRecipeRegistration registration) { | ||
this.type = type; | ||
this.ingredientType = ingredientType; | ||
this.registration = registration; | ||
} | ||
|
||
@Override | ||
public void add(Context cx, Object filter, Component[] info) { | ||
var in = (Predicate) type.wrapPredicate(cx, filter); | ||
|
||
if (allIngredients == null) { | ||
var manager = registration.getIngredientManager(); | ||
allIngredients = manager.getAllIngredients(ingredientType); | ||
} | ||
|
||
for (var v : allIngredients) { | ||
if (in.test(v)) { | ||
registration.addIngredientInfo(v, ingredientType, info); | ||
} | ||
} | ||
} | ||
} |
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.