cn.nukkit.inventory.CampfireRecipe Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.inventory;
import cn.nukkit.item.Item;
public class CampfireRecipe implements SmeltingRecipe {
private final Item output;
private Item ingredient;
public CampfireRecipe(Item result, Item ingredient) {
this.output = result.clone();
this.ingredient = ingredient.clone();
}
public void setInput(Item item) {
this.ingredient = item.clone();
}
@Override
public Item getInput() {
return this.ingredient.clone();
}
@Override
public Item getResult() {
return this.output.clone();
}
@Override
public void registerToCraftingManager(CraftingManager manager) {
manager.registerCampfireRecipe(this);
}
@Override
public RecipeType getType() {
return this.ingredient.hasMeta() ? RecipeType.CAMPFIRE_DATA : RecipeType.CAMPFIRE;
}
}