-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a few small bugs, added EMI info integration
- Loading branch information
1 parent
f3e014f
commit cb75f61
Showing
19 changed files
with
109 additions
and
76 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
34 changes: 34 additions & 0 deletions
34
src/main/java/dev/latvian/mods/kubejs/integration/emi/EMIAddInformationKubeEvent.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,34 @@ | ||
package dev.latvian.mods.kubejs.integration.emi; | ||
|
||
import dev.emi.emi.api.EmiRegistry; | ||
import dev.emi.emi.api.recipe.EmiInfoRecipe; | ||
import dev.emi.emi.api.stack.EmiIngredient; | ||
import dev.latvian.mods.kubejs.recipe.viewer.AddInformationKubeEvent; | ||
import dev.latvian.mods.kubejs.recipe.viewer.RecipeViewerEntryType; | ||
import dev.latvian.mods.rhino.Context; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.neoforged.neoforge.fluids.crafting.FluidIngredient; | ||
|
||
import java.util.List; | ||
|
||
public class EMIAddInformationKubeEvent implements AddInformationKubeEvent { | ||
private final RecipeViewerEntryType type; | ||
private final EmiRegistry registry; | ||
|
||
public EMIAddInformationKubeEvent(RecipeViewerEntryType type, EmiRegistry registry) { | ||
this.type = type; | ||
this.registry = registry; | ||
} | ||
|
||
@Override | ||
public void add(Context cx, Object filter, List<Component> info) { | ||
var in = type.wrapPredicate(cx, filter); | ||
|
||
if (type == RecipeViewerEntryType.ITEM) { | ||
registry.addRecipe(new EmiInfoRecipe(List.of(EmiIngredient.of((Ingredient) in)), info, null)); | ||
} else if (type == RecipeViewerEntryType.FLUID) { | ||
registry.addRecipe(new EmiInfoRecipe(List.of(EMIIntegration.fluidIngredient((FluidIngredient) in)), info, null)); | ||
} | ||
} | ||
} |
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.