NaturesAura/src/main/java/de/ellpeck/naturesaura/recipes/ModRecipe.java

39 lines
970 B
Java
Raw Normal View History

2020-04-29 16:38:50 +02:00
package de.ellpeck.naturesaura.recipes;
2021-12-04 19:17:21 +01:00
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.level.Level;
2020-04-29 16:38:50 +02:00
import net.minecraftforge.items.wrapper.RecipeWrapper;
2021-12-04 19:17:21 +01:00
public abstract class ModRecipe implements Recipe<RecipeWrapper> {
2020-04-29 16:38:50 +02:00
public final ResourceLocation name;
public ModRecipe(ResourceLocation name) {
this.name = name;
}
@Override
2021-12-04 15:40:09 +01:00
public boolean matches(RecipeWrapper inv, Level levelIn) {
2020-04-29 16:38:50 +02:00
// return true here so that we can easily get all recipes of a type from the recipe manager
return true;
}
@Override
2021-12-04 19:17:21 +01:00
public ItemStack assemble(RecipeWrapper inv) {
2020-04-29 16:38:50 +02:00
return ItemStack.EMPTY;
}
@Override
2021-12-04 19:17:21 +01:00
public boolean canCraftInDimensions(int width, int height) {
2020-04-29 16:38:50 +02:00
return false;
}
@Override
public ResourceLocation getId() {
return this.name;
}
2021-12-04 19:17:21 +01:00
2020-04-29 16:38:50 +02:00
}