mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 11:53:29 +01:00
fixed patchouli
This commit is contained in:
parent
572a63fe20
commit
1337c48f41
9 changed files with 20 additions and 15 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.item.crafting.RecipeManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
|
@ -31,14 +32,13 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
import net.minecraftforge.fml.DeferredWorkQueue;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import vazkii.patchouli.api.BookDrawScreenEvent;
|
||||
import vazkii.patchouli.api.IVariable;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Month;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class PatchouliCompat implements ICompat {
|
||||
|
||||
|
@ -66,6 +66,11 @@ public class PatchouliCompat implements ICompat {
|
|||
return (T) manager.getRecipe(pre).orElse(null);
|
||||
}
|
||||
|
||||
public static IVariable ingredientVariable(Ingredient ingredient) {
|
||||
return IVariable.wrapList(Arrays.stream(ingredient.getMatchingStacks())
|
||||
.map(IVariable::from).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
DeferredWorkQueue.runLater(() -> {
|
||||
|
|
|
@ -25,12 +25,12 @@ public class ProcessorAltar implements IComponentProcessor {
|
|||
return null;
|
||||
switch (key) {
|
||||
case "input":
|
||||
return IVariable.from(this.recipe.input);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.input);
|
||||
case "output":
|
||||
return IVariable.from(this.recipe.output);
|
||||
case "catalyst":
|
||||
if (this.recipe.catalyst != Ingredient.EMPTY)
|
||||
return IVariable.from(this.recipe.catalyst);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.catalyst);
|
||||
else
|
||||
return null;
|
||||
case "type":
|
||||
|
|
|
@ -25,7 +25,7 @@ public class ProcessorAnimalSpawner implements IComponentProcessor {
|
|||
if (key.startsWith("input")) {
|
||||
int id = Integer.parseInt(key.substring(5)) - 1;
|
||||
if (this.recipe.ingredients.length > id)
|
||||
return IVariable.from(this.recipe.ingredients[id]);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.ingredients[id]);
|
||||
else
|
||||
return null;
|
||||
} else {
|
||||
|
|
|
@ -22,11 +22,11 @@ public class ProcessorOffering implements IComponentProcessor {
|
|||
return null;
|
||||
switch (key) {
|
||||
case "input":
|
||||
return IVariable.from(this.recipe.input);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.input);
|
||||
case "output":
|
||||
return IVariable.from(this.recipe.output);
|
||||
case "start":
|
||||
return IVariable.from(this.recipe.startItem);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.startItem);
|
||||
case "name":
|
||||
return IVariable.wrap(this.recipe.output.getDisplayName().getString());
|
||||
default:
|
||||
|
|
|
@ -23,7 +23,7 @@ public class ProcessorTreeRitual implements IComponentProcessor {
|
|||
if (key.startsWith("input")) {
|
||||
int id = Integer.parseInt(key.substring(5)) - 1;
|
||||
if (this.recipe.ingredients.length > id)
|
||||
return IVariable.from(this.recipe.ingredients[id]);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.ingredients[id]);
|
||||
else
|
||||
return null;
|
||||
} else {
|
||||
|
@ -31,7 +31,7 @@ public class ProcessorTreeRitual implements IComponentProcessor {
|
|||
case "output":
|
||||
return IVariable.from(this.recipe.result);
|
||||
case "sapling":
|
||||
return IVariable.from(this.recipe.saplingType);
|
||||
return PatchouliCompat.ingredientVariable(this.recipe.saplingType);
|
||||
case "name":
|
||||
return IVariable.wrap(this.recipe.result.getDisplayName().getString());
|
||||
default:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:item/book"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:item/color_changer"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:item/color_changer_fill_mode",
|
||||
"layer1": "naturesaura:item/color_changer_fill_mode_overlay"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:item/color_changer",
|
||||
"layer1": "naturesaura:item/color_changer_overlay"
|
||||
|
|
Loading…
Reference in a new issue