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;
|
this.damage = damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Builder create(String id) {
|
static Builder create(ResourceLocation id, ItemLike output) {
|
||||||
return create(BCLib.makeID(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
static Builder create(ResourceLocation id) {
|
|
||||||
Builder.INSTANCE.id = id;
|
Builder.INSTANCE.id = id;
|
||||||
Builder.INSTANCE.input = null;
|
Builder.INSTANCE.input = null;
|
||||||
Builder.INSTANCE.output = null;
|
Builder.INSTANCE.output = output;
|
||||||
Builder.INSTANCE.inputCount = 1;
|
Builder.INSTANCE.inputCount = 1;
|
||||||
Builder.INSTANCE.toolLevel = 1;
|
Builder.INSTANCE.toolLevel = 1;
|
||||||
Builder.INSTANCE.anvilLevel = 1;
|
Builder.INSTANCE.anvilLevel = 1;
|
||||||
Builder.INSTANCE.damage = 1;
|
Builder.INSTANCE.damage = 1;
|
||||||
Builder.INSTANCE.alright = true;
|
Builder.INSTANCE.alright = true;
|
||||||
Builder.INSTANCE.exist = true;
|
Builder.INSTANCE.exist &= RecipeHelper.exists(output);
|
||||||
|
|
||||||
return Builder.INSTANCE;
|
return Builder.INSTANCE;
|
||||||
}
|
}
|
||||||
|
@ -267,8 +263,9 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
||||||
|
|
||||||
private ResourceLocation id;
|
private ResourceLocation id;
|
||||||
private Ingredient input;
|
private Ingredient input;
|
||||||
private ItemStack output;
|
private ItemLike output;
|
||||||
private int inputCount = 1;
|
private int inputCount = 1;
|
||||||
|
private int outputCount = 1;
|
||||||
private int toolLevel = 1;
|
private int toolLevel = 1;
|
||||||
private int anvilLevel = 1;
|
private int anvilLevel = 1;
|
||||||
private int damage = 1;
|
private int damage = 1;
|
||||||
|
@ -299,13 +296,8 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setOutput(ItemLike output) {
|
public Builder setOutputCount(int count) {
|
||||||
return this.setOutput(output, 1);
|
this.outputCount = count;
|
||||||
}
|
|
||||||
|
|
||||||
public Builder setOutput(ItemLike output, int amount) {
|
|
||||||
this.alright &= RecipeHelper.exists(output);
|
|
||||||
this.output = new ItemStack(output, amount);
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +344,15 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
||||||
}
|
}
|
||||||
BCLRecipeManager.addRecipe(
|
BCLRecipeManager.addRecipe(
|
||||||
TYPE,
|
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);
|
return AlloyingRecipe.Builder.create(id, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AnvilRecipe.Builder anvil(ResourceLocation id) {
|
public static AnvilRecipe.Builder anvil(ResourceLocation id, ItemLike output) {
|
||||||
return AnvilRecipe.create(id);
|
return AnvilRecipe.create(id, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlastFurnaceRecipe blasting(ResourceLocation id, ItemLike output) {
|
public static BlastFurnaceRecipe blasting(ResourceLocation id, ItemLike output) {
|
||||||
|
|
|
@ -34,14 +34,14 @@ public class SmithingTableRecipe extends AbstractSimpleRecipe<SmithingTableRecip
|
||||||
return super.setInput(in);
|
return super.setInput(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SmithingTableRecipe setAddon(ItemLike in) {
|
public SmithingTableRecipe setAddition(ItemLike in) {
|
||||||
this.exist &= BCLRecipeManager.exists(in);
|
this.exist &= BCLRecipeManager.exists(in);
|
||||||
this.addon = Ingredient.of(in);
|
this.addon = Ingredient.of(in);
|
||||||
unlockedBy(in);
|
unlockedBy(in);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SmithingTableRecipe setAddon(TagKey<Item> in) {
|
public SmithingTableRecipe setAddition(TagKey<Item> in) {
|
||||||
this.addon = Ingredient.of(in);
|
this.addon = Ingredient.of(in);
|
||||||
unlockedBy(in);
|
unlockedBy(in);
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue