End lily recipes
This commit is contained in:
parent
2d1fe18781
commit
3f9e524b54
33 changed files with 221 additions and 44 deletions
|
@ -2,6 +2,7 @@ package ru.betterend.recipe;
|
|||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Items;
|
||||
import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||
import ru.betterend.registry.ItemRegistry;
|
||||
|
||||
public class AlloyingRecipes {
|
||||
|
|
|
@ -3,6 +3,7 @@ package ru.betterend.recipe;
|
|||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import ru.betterend.recipe.builders.RecipeBuilder;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.registry.ItemRegistry;
|
||||
|
||||
|
@ -68,9 +69,8 @@ public class CraftingRecipes {
|
|||
RecipeBuilder.make("creeping_moss_dye", Items.CYAN_DYE).setList("#").addMaterial('#', BlockRegistry.CREEPING_MOSS).build();
|
||||
RecipeBuilder.make("umbrella_moss_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS).build();
|
||||
RecipeBuilder.make("umbrella_moss_tall_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS_TALL).build();
|
||||
|
||||
AlloyingRecipes.register();
|
||||
SmithingRecipes.register();
|
||||
|
||||
RecipeBuilder.make("paper", Items.PAPER).setShape("###").addMaterial('#', ItemRegistry.END_LILY_LEAF_DRIED).setOutputCount(3).build();
|
||||
}
|
||||
|
||||
private static void registerHelmet(String name, Item material, Item result) {
|
||||
|
|
10
src/main/java/ru/betterend/recipe/SmeltigRecipes.java
Normal file
10
src/main/java/ru/betterend/recipe/SmeltigRecipes.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package ru.betterend.recipe;
|
||||
|
||||
import ru.betterend.recipe.builders.FurnaceRecipe;
|
||||
import ru.betterend.registry.ItemRegistry;
|
||||
|
||||
public class SmeltigRecipes {
|
||||
public static void register() {
|
||||
FurnaceRecipe.make("end_lily_leaf_dried", ItemRegistry.END_LILY_LEAF, ItemRegistry.END_LILY_LEAF_DRIED).build();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package ru.betterend.recipe;
|
||||
|
||||
import net.minecraft.item.Items;
|
||||
import ru.betterend.recipe.builders.AnvilSmithingRecipe;
|
||||
import ru.betterend.registry.ItemRegistry;
|
||||
|
||||
public class SmithingRecipes {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package ru.betterend.recipe;
|
||||
package ru.betterend.recipe.builders;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
@ -21,6 +21,7 @@ import net.minecraft.util.collection.DefaultedList;
|
|||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.recipe.EndRecipeManager;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
|
||||
public class AlloyingRecipe implements Recipe<Inventory> {
|
|
@ -1,4 +1,4 @@
|
|||
package ru.betterend.recipe;
|
||||
package ru.betterend.recipe.builders;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
|
@ -22,6 +22,7 @@ import net.minecraft.util.collection.DefaultedList;
|
|||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.recipe.EndRecipeManager;
|
||||
import ru.betterend.registry.ItemTagRegistry;
|
||||
|
||||
public class AnvilSmithingRecipe implements Recipe<Inventory> {
|
|
@ -0,0 +1,69 @@
|
|||
package ru.betterend.recipe.builders;
|
||||
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.recipe.SmeltingRecipe;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.recipe.EndRecipeManager;
|
||||
import ru.betterend.util.RecipeHelper;
|
||||
|
||||
public class FurnaceRecipe {
|
||||
private static final FurnaceRecipe INSTANCE = new FurnaceRecipe();
|
||||
|
||||
private ItemConvertible input;
|
||||
private ItemConvertible output;
|
||||
private boolean exist = true;
|
||||
private String group;
|
||||
private String name;
|
||||
private int count;
|
||||
private int time;
|
||||
private float xp;
|
||||
|
||||
private FurnaceRecipe() {}
|
||||
|
||||
public static FurnaceRecipe make(String name, ItemConvertible input, ItemConvertible output) {
|
||||
INSTANCE.name = name;
|
||||
INSTANCE.group = "";
|
||||
INSTANCE.input = input;
|
||||
INSTANCE.output = output;
|
||||
INSTANCE.count = 1;
|
||||
INSTANCE.time = 200;
|
||||
INSTANCE.xp = 0;
|
||||
INSTANCE.exist = RecipeHelper.exists(output) && RecipeHelper.exists(input);
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public FurnaceRecipe setGroup(String group) {
|
||||
this.group = group;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FurnaceRecipe setOutputCount(int count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FurnaceRecipe setXP(float xp) {
|
||||
this.xp = xp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FurnaceRecipe setCookTime(int time) {
|
||||
this.time = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void build() {
|
||||
if (exist) {
|
||||
Identifier id = BetterEnd.makeID(name);
|
||||
SmeltingRecipe recipe = new SmeltingRecipe(id, group, Ingredient.ofItems(input), new ItemStack(output, count), xp, time);
|
||||
EndRecipeManager.addRecipe(RecipeType.SMELTING, recipe);
|
||||
}
|
||||
else {
|
||||
BetterEnd.LOGGER.debug("Smelting recipe {} couldn't be added", name);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ru.betterend.recipe;
|
||||
package ru.betterend.recipe.builders;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -16,6 +16,7 @@ import net.minecraft.tag.Tag;
|
|||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.recipe.EndRecipeManager;
|
||||
import ru.betterend.util.RecipeHelper;
|
||||
|
||||
public class RecipeBuilder {
|
Loading…
Add table
Add a link
Reference in a new issue