WIP: infusion
This commit is contained in:
parent
a1d2e0d9bf
commit
beab6ce10a
6 changed files with 191 additions and 20 deletions
18
src/main/java/ru/betterend/recipe/InfusionRecipes.java
Normal file
18
src/main/java/ru/betterend/recipe/InfusionRecipes.java
Normal file
|
@ -0,0 +1,18 @@
|
|||
package ru.betterend.recipe;
|
||||
|
||||
import ru.betterend.recipe.builders.InfusionRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
public class InfusionRecipes {
|
||||
public static void register() {
|
||||
InfusionRecipe.Builder.create("runed_flavolite")
|
||||
.setInput(EndBlocks.FLAVOLITE.polished)
|
||||
.setOutput(EndBlocks.FLAVOLITE_RUNED)
|
||||
.addCatalyst(0, EndItems.CRYSTAL_SHARDS)
|
||||
.addCatalyst(2, EndItems.CRYSTAL_SHARDS)
|
||||
.addCatalyst(4, EndItems.CRYSTAL_SHARDS)
|
||||
.addCatalyst(6, EndItems.CRYSTAL_SHARDS)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -55,8 +55,8 @@ public class InfusionRecipe implements Recipe<InfusionRitual> {
|
|||
public boolean matches(InfusionRitual inv, World world) {
|
||||
boolean valid = this.input.test(inv.getStack(0));
|
||||
if (!valid) return false;
|
||||
for (int i = 1; i < 9; i++) {
|
||||
valid &= this.catalysts[i].test(inv.getStack(i));
|
||||
for (int i = 0; i < 8; i++) {
|
||||
valid &= this.catalysts[i].test(inv.getStack(i + 1));
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class InfusionRecipe implements Recipe<InfusionRitual> {
|
|||
return TYPE;
|
||||
}
|
||||
|
||||
public InfusionRecipe fromTag(CompoundTag tag) {
|
||||
public static InfusionRecipe fromTag(CompoundTag tag) {
|
||||
return SERIALIZER.fromTag(tag);
|
||||
}
|
||||
|
||||
|
@ -132,8 +132,8 @@ public class InfusionRecipe implements Recipe<InfusionRitual> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemStack output) {
|
||||
this.output = output;
|
||||
public Builder setOutput(ItemConvertible output) {
|
||||
this.output = new ItemStack(output);
|
||||
this.output.setCount(1);
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue