From 63fdcc76da7e2d7cbd79d327c6dd72404708f64f Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 5 Jan 2019 22:14:37 +0800 Subject: Buggy Autocrafting --- .../java/me/shedaniel/plugin/VanillaPlugin.java | 40 ++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'src/main/java/me/shedaniel/plugin/VanillaPlugin.java') diff --git a/src/main/java/me/shedaniel/plugin/VanillaPlugin.java b/src/main/java/me/shedaniel/plugin/VanillaPlugin.java index 5b0bb9e82..a9cebf134 100755 --- a/src/main/java/me/shedaniel/plugin/VanillaPlugin.java +++ b/src/main/java/me/shedaniel/plugin/VanillaPlugin.java @@ -30,8 +30,6 @@ import net.minecraft.recipe.smelting.SmeltingRecipe; import net.minecraft.recipe.smelting.SmokingRecipe; import net.minecraft.util.registry.Registry; -import java.lang.reflect.Array; -import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; @@ -39,13 +37,13 @@ import java.util.stream.Collectors; public class VanillaPlugin implements IREIPlugin, PotionCraftingAdder { private List potionRecipes = new LinkedList<>(); + private List recipes = new LinkedList<>(); + private List furnaceRecipes = new LinkedList<>(); + private List smokerRecipes = new LinkedList<>(); + private List blastFurnaceRecipes = new LinkedList<>(); @Override - public void register() { - List recipes = new LinkedList<>(); - List furnaceRecipes = new LinkedList<>(); - List smokerRecipes = new LinkedList<>(); - List blastFurnaceRecipes = new LinkedList<>(); + public void registerCategories() { REIRecipeManager.instance().addDisplayAdapter(new VanillaCraftingCategory()); REIRecipeManager.instance().addDisplayAdapter(new VanillaFurnaceCategory()); REIRecipeManager.instance().addDisplayAdapter(new VanillaSmokerCategory()); @@ -56,25 +54,21 @@ public class VanillaPlugin implements IREIPlugin, PotionCraftingAdder { // REIRecipeManager.instance().addDisplayAdapter(new TestRandomCategory("c", new ItemStack(Items.ITEM_FRAME))); // REIRecipeManager.instance().addDisplayAdapter(new TestRandomCategory("d", new ItemStack(Items.ITEM_FRAME))); // REIRecipeManager.instance().addDisplayAdapter(new TestRandomCategory("e", new ItemStack(Items.ITEM_FRAME))); - - - for(Recipe recipe : REIRecipeManager.instance().recipeManager.values()) { - if (recipe instanceof ShapelessRecipe) { + } + + @Override + public void registerRecipes() { + for(Recipe recipe : REIRecipeManager.instance().recipeManager.values()) + if (recipe instanceof ShapelessRecipe) recipes.add(new VanillaShapelessCraftingRecipe((ShapelessRecipe) recipe)); - } - if (recipe instanceof ShapedRecipe) { + else if (recipe instanceof ShapedRecipe) recipes.add(new VanillaShapedCraftingRecipe((ShapedRecipe) recipe)); - } - if (recipe instanceof SmeltingRecipe) { + else if (recipe instanceof SmeltingRecipe) furnaceRecipes.add(new VanillaFurnaceRecipe((SmeltingRecipe) recipe)); - } - if (recipe instanceof SmokingRecipe) { + else if (recipe instanceof SmokingRecipe) smokerRecipes.add(new VanillaSmokerRecipe((SmokingRecipe) recipe)); - } - if (recipe instanceof BlastingRecipe) { + else if (recipe instanceof BlastingRecipe) blastFurnaceRecipes.add(new VanillaBlastFurnaceRecipe((BlastingRecipe) recipe)); - } - } Registry.POTION.stream().filter(potion -> !potion.equals(Potions.EMPTY)).forEach(potion -> { ItemStack basePotion = PotionUtil.setPotion(new ItemStack(Items.POTION), potion), splashPotion = PotionUtil.setPotion(new ItemStack(Items.SPLASH_POTION), potion), @@ -97,6 +91,10 @@ public class VanillaPlugin implements IREIPlugin, PotionCraftingAdder { // REIRecipeManager.instance().addRecipe("e", Arrays.asList(new RandomRecipe("e"))); } + @Override + public void registerSpecialGuiExclusion() { + + } @Override public void addPotionRecipe(Potion inputType, Item reagent, Potion outputType) { -- cgit