Minor API corrections
This commit is contained in:
parent
80a4ff8319
commit
5df6fefcb9
3 changed files with 20 additions and 20 deletions
|
@ -79,20 +79,16 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
this.damage = damage;
|
||||
}
|
||||
|
||||
static Builder create(String id) {
|
||||
return create(BCLib.makeID(id));
|
||||
}
|
||||
|
||||
static Builder create(ResourceLocation id) {
|
||||
static Builder create(ResourceLocation id, ItemLike output) {
|
||||
Builder.INSTANCE.id = id;
|
||||
Builder.INSTANCE.input = null;
|
||||
Builder.INSTANCE.output = null;
|
||||
Builder.INSTANCE.output = output;
|
||||
Builder.INSTANCE.inputCount = 1;
|
||||
Builder.INSTANCE.toolLevel = 1;
|
||||
Builder.INSTANCE.anvilLevel = 1;
|
||||
Builder.INSTANCE.damage = 1;
|
||||
Builder.INSTANCE.alright = true;
|
||||
Builder.INSTANCE.exist = true;
|
||||
Builder.INSTANCE.exist &= RecipeHelper.exists(output);
|
||||
|
||||
return Builder.INSTANCE;
|
||||
}
|
||||
|
@ -267,8 +263,9 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
|
||||
private ResourceLocation id;
|
||||
private Ingredient input;
|
||||
private ItemStack output;
|
||||
private ItemLike output;
|
||||
private int inputCount = 1;
|
||||
private int outputCount = 1;
|
||||
private int toolLevel = 1;
|
||||
private int anvilLevel = 1;
|
||||
private int damage = 1;
|
||||
|
@ -299,13 +296,8 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemLike output) {
|
||||
return this.setOutput(output, 1);
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemLike output, int amount) {
|
||||
this.alright &= RecipeHelper.exists(output);
|
||||
this.output = new ItemStack(output, amount);
|
||||
public Builder setOutputCount(int count) {
|
||||
this.outputCount = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -352,7 +344,15 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
}
|
||||
BCLRecipeManager.addRecipe(
|
||||
TYPE,
|
||||
new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage)
|
||||
new AnvilRecipe(
|
||||
id,
|
||||
input,
|
||||
new ItemStack(output, outputCount),
|
||||
inputCount,
|
||||
toolLevel,
|
||||
anvilLevel,
|
||||
damage
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ public class BCLRecipeBuilder {
|
|||
return AlloyingRecipe.Builder.create(id, output);
|
||||
}
|
||||
|
||||
public static AnvilRecipe.Builder anvil(ResourceLocation id) {
|
||||
return AnvilRecipe.create(id);
|
||||
public static AnvilRecipe.Builder anvil(ResourceLocation id, ItemLike output) {
|
||||
return AnvilRecipe.create(id, output);
|
||||
}
|
||||
|
||||
public static BlastFurnaceRecipe blasting(ResourceLocation id, ItemLike output) {
|
||||
|
|
|
@ -34,14 +34,14 @@ public class SmithingTableRecipe extends AbstractSimpleRecipe<SmithingTableRecip
|
|||
return super.setInput(in);
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setAddon(ItemLike in) {
|
||||
public SmithingTableRecipe setAddition(ItemLike in) {
|
||||
this.exist &= BCLRecipeManager.exists(in);
|
||||
this.addon = Ingredient.of(in);
|
||||
unlockedBy(in);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setAddon(TagKey<Item> in) {
|
||||
public SmithingTableRecipe setAddition(TagKey<Item> in) {
|
||||
this.addon = Ingredient.of(in);
|
||||
unlockedBy(in);
|
||||
return this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue