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

38 lines
943 B
Java
Raw Normal View History

2020-04-29 16:38:50 +02:00
package de.ellpeck.naturesaura.recipes;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
2021-12-04 15:40:09 +01:00
import net.minecraft.level.Level;
2020-04-29 16:38:50 +02:00
import net.minecraftforge.items.wrapper.RecipeWrapper;
public abstract class ModRecipe implements IRecipe<RecipeWrapper> {
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
public ItemStack getCraftingResult(RecipeWrapper inv) {
return ItemStack.EMPTY;
}
@Override
public boolean canFit(int width, int height) {
return false;
}
@Override
public ResourceLocation getId() {
return this.name;
}
}