generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added IncubusRecipe and IncubusRecipeType
- Loading branch information
Dragonoidzero
committed
Mar 16, 2021
1 parent
bbd0528
commit 4842298
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/azzy/fabric/incubus_core/recipe/IncubusRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package azzy.fabric.incubus_core.recipe; | ||
|
||
import net.minecraft.inventory.Inventory; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.recipe.Recipe; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@SuppressWarnings("unused") | ||
public interface IncubusRecipe<C extends Inventory> extends Recipe<C> { | ||
|
||
boolean isEmpty(); | ||
|
||
@Override | ||
IncubusRecipeType<?> getType(); | ||
|
||
List<IngredientStack> getInputs(); | ||
|
||
@Override | ||
default String getGroup() { | ||
return "incubus_core:undefined"; | ||
} | ||
|
||
default List<ItemStack> getOutputs() { | ||
return Collections.singletonList(getOutput()); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/azzy/fabric/incubus_core/recipe/IncubusRecipeType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package azzy.fabric.incubus_core.recipe; | ||
|
||
import net.minecraft.recipe.Recipe; | ||
import net.minecraft.recipe.RecipeType; | ||
import net.minecraft.util.Identifier; | ||
|
||
@SuppressWarnings("unused") | ||
public class IncubusRecipeType<T extends Recipe<?>> implements RecipeType<T> { | ||
|
||
private final Identifier id; | ||
|
||
public IncubusRecipeType(Identifier id) { | ||
this.id = id; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return id.toString(); | ||
} | ||
|
||
public Identifier getId() { | ||
return id; | ||
} | ||
} |