[Feature] Builder for Blasting, Smelting and Smithing Recipes
This commit is contained in:
parent
cb4c8c4db3
commit
b0964cd30d
6 changed files with 258 additions and 52 deletions
42
src/main/java/org/betterx/bclib/recipes/CookingRecipe.java
Normal file
42
src/main/java/org/betterx/bclib/recipes/CookingRecipe.java
Normal file
|
@ -0,0 +1,42 @@
|
|||
package org.betterx.bclib.recipes;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
|
||||
public abstract class CookingRecipe<T extends AbstractSimpleRecipe, C extends Container, R extends Recipe<C>> extends AbstractSimpleRecipe<T, C, R> {
|
||||
protected float experience;
|
||||
protected int cookingTime;
|
||||
|
||||
CookingRecipe(ResourceLocation id, RecipeType<R> type, ItemLike output) {
|
||||
this(id, type, type.toString(), output);
|
||||
}
|
||||
|
||||
CookingRecipe(ResourceLocation id, RecipeType<R> type, String category, ItemLike output) {
|
||||
super(id, type, category, output);
|
||||
cookingTime = 1000;
|
||||
experience = 0;
|
||||
}
|
||||
|
||||
public T setInput(ItemLike in) {
|
||||
return super.setInput(in);
|
||||
}
|
||||
|
||||
public T setInput(TagKey<Item> in) {
|
||||
return super.setInput(in);
|
||||
}
|
||||
|
||||
public T setExperience(float xp) {
|
||||
experience = xp;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public T setCookingTime(int time) {
|
||||
cookingTime = time;
|
||||
return (T) this;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue