fixed recipes

This commit is contained in:
Ell 2024-03-12 20:09:56 +01:00
parent 5497de1f1d
commit fc6c376d37
7 changed files with 15 additions and 15 deletions

View file

@ -83,7 +83,7 @@ public class BlockEntityWoodStand extends BlockEntityImpl implements ITickableBl
var item = new ItemEntity(this.level, var item = new ItemEntity(this.level,
this.ritualPos.getX() + 0.5, this.ritualPos.getY() + 4.5, this.ritualPos.getZ() + 0.5, this.ritualPos.getX() + 0.5, this.ritualPos.getY() + 4.5, this.ritualPos.getZ() + 0.5,
this.recipe.value().result.copy()); this.recipe.value().output.copy());
this.level.addFreshEntity(item); this.level.addFreshEntity(item);
PacketHandler.sendToAllAround(this.level, this.worldPosition, 32, PacketHandler.sendToAllAround(this.level, this.worldPosition, 32,

View file

@ -45,7 +45,7 @@ public class TreeRitualCategory implements IRecipeCategory<TreeRitualRecipe> {
@Override @Override
public void setRecipe(IRecipeLayoutBuilder builder, TreeRitualRecipe recipe, IFocusGroup focuses) { public void setRecipe(IRecipeLayoutBuilder builder, TreeRitualRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.CATALYST, 35, 35).addItemStacks(Arrays.asList(recipe.saplingType.getItems())); builder.addSlot(RecipeIngredientRole.CATALYST, 35, 35).addItemStacks(Arrays.asList(recipe.saplingType.getItems()));
builder.addSlot(RecipeIngredientRole.OUTPUT, 125, 35).addItemStack(recipe.result); builder.addSlot(RecipeIngredientRole.OUTPUT, 125, 35).addItemStack(recipe.output);
var positions = new int[][]{{35, 1}, {35, 69}, {1, 35}, {69, 35}, {12, 12}, {58, 58}, {58, 12}, {12, 58}}; var positions = new int[][]{{35, 1}, {35, 69}, {1, 35}, {69, 35}, {12, 12}, {58, 58}, {58, 12}, {12, 58}};
for (var i = 0; i < recipe.ingredients.size(); i++) for (var i = 0; i < recipe.ingredients.size(); i++)

View file

@ -24,9 +24,9 @@ public class ProcessorTreeRitual implements IComponentProcessor {
return this.recipe.ingredients.size() > id ? PatchouliCompat.ingredientVariable(this.recipe.ingredients.get(id)) : null; return this.recipe.ingredients.size() > id ? PatchouliCompat.ingredientVariable(this.recipe.ingredients.get(id)) : null;
} else { } else {
return switch (key) { return switch (key) {
case "output" -> IVariable.from(this.recipe.result); case "output" -> IVariable.from(this.recipe.output);
case "sapling" -> PatchouliCompat.ingredientVariable(this.recipe.saplingType); case "sapling" -> PatchouliCompat.ingredientVariable(this.recipe.saplingType);
case "name" -> IVariable.wrap(this.recipe.result.getHoverName().getString()); case "name" -> IVariable.wrap(this.recipe.output.getHoverName().getString());
default -> null; default -> null;
}; };
} }

View file

@ -46,8 +46,8 @@ public class AltarRecipe extends ModRecipe {
private static final Codec<AltarRecipe> CODEC = RecordCodecBuilder.create(i -> i.group( private static final Codec<AltarRecipe> CODEC = RecordCodecBuilder.create(i -> i.group(
Ingredient.CODEC.fieldOf("input").forGetter(r -> r.input), Ingredient.CODEC.fieldOf("input").forGetter(r -> r.input),
ItemStack.CODEC.fieldOf("output").forGetter(r -> r.output), ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("output").forGetter(r -> r.output),
Ingredient.CODEC.fieldOf("catalyst").forGetter(r -> r.catalyst), Ingredient.CODEC.optionalFieldOf("catalyst", Ingredient.EMPTY).forGetter(r -> r.catalyst),
Codec.INT.fieldOf("aura").forGetter(r -> r.aura), Codec.INT.fieldOf("aura").forGetter(r -> r.aura),
Codec.INT.fieldOf("time").forGetter(r -> r.time) Codec.INT.fieldOf("time").forGetter(r -> r.time)
).apply(i, AltarRecipe::new)); ).apply(i, AltarRecipe::new));

View file

@ -43,7 +43,7 @@ public class OfferingRecipe extends ModRecipe {
private static final Codec<OfferingRecipe> CODEC = RecordCodecBuilder.create(i -> i.group( private static final Codec<OfferingRecipe> CODEC = RecordCodecBuilder.create(i -> i.group(
Ingredient.CODEC.fieldOf("input").forGetter(r -> r.input), Ingredient.CODEC.fieldOf("input").forGetter(r -> r.input),
Ingredient.CODEC.fieldOf("start_item").forGetter(r -> r.startItem), Ingredient.CODEC.fieldOf("start_item").forGetter(r -> r.startItem),
ItemStack.CODEC.fieldOf("output").forGetter(r -> r.output) ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("output").forGetter(r -> r.output)
).apply(i, OfferingRecipe::new)); ).apply(i, OfferingRecipe::new));
@Override @Override

View file

@ -17,19 +17,19 @@ public class TreeRitualRecipe extends ModRecipe {
public final Ingredient saplingType; public final Ingredient saplingType;
public final List<Ingredient> ingredients; public final List<Ingredient> ingredients;
public final ItemStack result; public final ItemStack output;
public final int time; public final int time;
public TreeRitualRecipe(Ingredient saplingType, ItemStack result, int time, List<Ingredient> ingredients) { public TreeRitualRecipe(Ingredient saplingType, ItemStack output, int time, List<Ingredient> ingredients) {
this.saplingType = saplingType; this.saplingType = saplingType;
this.ingredients = ingredients; this.ingredients = ingredients;
this.result = result; this.output = output;
this.time = time; this.time = time;
} }
@Override @Override
public ItemStack getResultItem(RegistryAccess access) { public ItemStack getResultItem(RegistryAccess access) {
return this.result; return this.output;
} }
@Override @Override
@ -46,7 +46,7 @@ public class TreeRitualRecipe extends ModRecipe {
private static final Codec<TreeRitualRecipe> CODEC = RecordCodecBuilder.create(i -> i.group( private static final Codec<TreeRitualRecipe> CODEC = RecordCodecBuilder.create(i -> i.group(
Ingredient.CODEC.fieldOf("sapling").forGetter(r -> r.saplingType), Ingredient.CODEC.fieldOf("sapling").forGetter(r -> r.saplingType),
ItemStack.CODEC.fieldOf("result").forGetter(r -> r.result), ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("output").forGetter(r -> r.output),
Codec.INT.fieldOf("time").forGetter(r -> r.time), Codec.INT.fieldOf("time").forGetter(r -> r.time),
Ingredient.CODEC.listOf().fieldOf("ingredients").forGetter(recipe -> recipe.ingredients) Ingredient.CODEC.listOf().fieldOf("ingredients").forGetter(recipe -> recipe.ingredients)
).apply(i, TreeRitualRecipe::new)); ).apply(i, TreeRitualRecipe::new));
@ -71,7 +71,7 @@ public class TreeRitualRecipe extends ModRecipe {
for (var ing : recipe.ingredients) for (var ing : recipe.ingredients)
ing.toNetwork(buffer); ing.toNetwork(buffer);
recipe.saplingType.toNetwork(buffer); recipe.saplingType.toNetwork(buffer);
buffer.writeItem(recipe.result); buffer.writeItem(recipe.output);
buffer.writeInt(recipe.time); buffer.writeInt(recipe.time);
} }

View file

@ -10,7 +10,7 @@
"tag": "forge:nuggets/gold" "tag": "forge:nuggets/gold"
}, },
"G": { "G": {
"item": "minecraft:grass" "item": "minecraft:grass_block"
}, },
"L": { "L": {
"tag": "minecraft:leaves" "tag": "minecraft:leaves"