From 91994e5a01d07587775926707e59d40fdf55a317 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 22 Feb 2019 14:27:22 +0000 Subject: [PATCH] 229 - comment out all recipes as we can deal with these later + start thinking more about tags --- .../techreborn/config/ConfigTechReborn.java | 2 - src/main/java/techreborn/init/ModFluids.java | 2 +- src/main/java/techreborn/init/ModRecipes.java | 134 ++++++++---------- src/main/java/techreborn/init/ModTags.java | 16 +++ .../init/recipes/AlloySmelterRecipes.java | 14 +- .../init/recipes/CraftingTableRecipes.java | 5 +- .../init/recipes/ExtractorRecipes.java | 3 + .../init/recipes/FluidReplicatorRecipes.java | 4 + .../IndustrialElectrolyzerRecipes.java | 4 + .../recipes/IndustrialGrinderRecipes.java | 4 + .../recipes/IndustrialSawmillRecipes.java | 5 +- .../init/recipes/IngredientCell.java | 46 ------ .../init/recipes/RecipeMethods.java | 36 ++--- .../init/recipes/ScrapboxRecipes.java | 12 +- .../init/recipes/SmeltingRecipes.java | 3 +- .../tiles/generator/TileLightningRod.java | 10 +- src/main/java/techreborn/utils/TagUtils.java | 2 + 17 files changed, 133 insertions(+), 169 deletions(-) create mode 100644 src/main/java/techreborn/init/ModTags.java delete mode 100644 src/main/java/techreborn/init/recipes/IngredientCell.java diff --git a/src/main/java/techreborn/config/ConfigTechReborn.java b/src/main/java/techreborn/config/ConfigTechReborn.java index 032ef6691..91b838415 100644 --- a/src/main/java/techreborn/config/ConfigTechReborn.java +++ b/src/main/java/techreborn/config/ConfigTechReborn.java @@ -30,8 +30,6 @@ import techreborn.TechReborn; @RebornRegister(TechReborn.MOD_ID) public class ConfigTechReborn { - @ConfigRegistry(config = "recipes", category = "railcraft", key = "disableRailcraftNugget", comment = "When true TechReborn will remove Railcraft's Iron Nugget to steel nugget recipe.") - public static boolean disableRailcraftSteelNuggetRecipe = false; @ConfigRegistry(config = "items", category = "general", key = "enableGemTools", comment = "Enable Gem armor and tools") public static boolean enableGemArmorAndTools = true; diff --git a/src/main/java/techreborn/init/ModFluids.java b/src/main/java/techreborn/init/ModFluids.java index bf5e334f0..bbd9d527e 100644 --- a/src/main/java/techreborn/init/ModFluids.java +++ b/src/main/java/techreborn/init/ModFluids.java @@ -68,7 +68,7 @@ public enum ModFluids { public String name; ModFluids() { - this.name = this.toString().replace("_", "").toLowerCase(); //Is this ok? + this.name = this.name().replace("_", "").toLowerCase(); //Is this ok? fluid = new Fluid(name, new ResourceLocation("techreborn", "fixme"), new ResourceLocation("techrebonr", "alsofixme")); } diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 1a5c3c66b..06c0d58af 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -27,7 +27,6 @@ package techreborn.init; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidUtil; @@ -35,7 +34,6 @@ import net.minecraftforge.oredict.OreDictionary; import reborncore.api.recipe.RecipeHandler; import reborncore.common.registration.RebornRegister; import reborncore.common.util.ItemUtils; -import reborncore.common.util.OreUtil; import techreborn.TechReborn; import techreborn.api.Reference; import techreborn.api.recipe.machines.GrinderRecipe; @@ -56,10 +54,14 @@ import static techreborn.utils.TagUtils.joinDictName; @RebornRegister(TechReborn.MOD_ID) public class ModRecipes { + + public static void init() { //Gonna rescan to make sure we have an uptodate list //OreUtil.scanForOres(); + /* + CraftingTableRecipes.init(); SmeltingRecipes.init(); ExtractorRecipes.init(); @@ -80,26 +82,12 @@ public class ModRecipes { addVacuumFreezerRecipes(); addGrinderRecipes(); addCompressorRecipes(); + + */ } public static void postInit() { - if (ConfigTechReborn.disableRailcraftSteelNuggetRecipe) { - Iterator> iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator(); - Map.Entry entry; - while (iterator.hasNext()) { - entry = iterator.next(); - if (entry.getValue() instanceof ItemStack && entry.getKey() instanceof ItemStack) { - ItemStack input = (ItemStack) entry.getKey(); - ItemStack output = (ItemStack) entry.getValue(); - if (ItemUtils.isInputEqual("nuggetSteel", output, true, true, false) && ItemUtils.isInputEqual("nuggetIron", input, true, true, false)) { - TechReborn.LOGGER.info("Removing a steelnugget smelting recipe"); - iterator.remove(); - } - } - } - } - - IndustrialSawmillRecipes.init(); + //IndustrialSawmillRecipes.init(); } private static void addCompressorRecipes() { @@ -164,10 +152,10 @@ public class ModRecipes { // int eutick = 2; // int ticktime = 300; - RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( - new ItemStack(Items.BONE), - new ItemStack(Items.DYE, 6, 15), - 170, 19)); +// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( +// new ItemStack(Items.BONE), +// new ItemStack(Items.DYE, 6, 15), +// 170, 19)); RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( new ItemStack(Blocks.COBBLESTONE), @@ -218,10 +206,10 @@ public class ModRecipes { // ItemDusts.getDustByName("ender_pearl", 2), // 200, 22)); - RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( - new ItemStack(Blocks.LAPIS_ORE), - new ItemStack(Items.DYE, 10, 4), - 170, 19)); +// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( +// new ItemStack(Blocks.LAPIS_ORE), +// new ItemStack(Items.DYE, 10, 4), +// 170, 19)); // RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( // new ItemStack(Blocks.OBSIDIAN), @@ -233,20 +221,20 @@ public class ModRecipes { new ItemStack(Items.BLAZE_POWDER, 4), 170, 19)); - if (OreUtil.doesOreExistAndValid("stoneMarble")) { +// if (OreUtil.doesOreExistAndValid("stoneMarble")) { // ItemStack marbleStack = getOre("stoneMarble"); // marbleStack.setCount(1); // RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( // marbleStack, ItemDusts.getDustByName("marble"), // 120, 10)); - } - if (OreUtil.doesOreExistAndValid("stoneBasalt")) { +// } +// if (OreUtil.doesOreExistAndValid("stoneBasalt")) { // ItemStack marbleStack = getOre("stoneBasalt"); // marbleStack.setCount(1); // RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( // marbleStack, ItemDusts.getDustByName("basalt"), // 120, 10)); - } +// } //See comments bellow, this allows the ore to go to the product when it sometimes goes straight to dust. RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe( @@ -270,45 +258,45 @@ public class ModRecipes { 270, 31)); - for (String oreDictionaryName : OreDictionary.getOreNames()) { - if (isDictPrefixed(oreDictionaryName, "ore", "gem", "ingot")) { - ItemStack oreStack = getDictOreOrEmpty(oreDictionaryName, 1); - String[] data = getDictData(oreDictionaryName); - - //High-level ores shouldn't grind here - if (data[0].equals("ore") && ( - data[1].equals("tungsten") || - data[1].equals("titanium") || - data[1].equals("aluminium") || - data[1].equals("iridium") || - data[1].equals("saltpeter")|| - data[1].equals("coal") || //Done here to skip going to dust so it can go to the output - data[1].equals("diamond") || //For example diamond ore should go to diamonds not the diamond dust - data[1].equals("emerald") || //TODO possibly remove this and make it a bit more dyamic? (Check for furnace recipes? and then the block drop?) - data[1].equals("redstone") || - data[1].equals("quartz") - ) || - oreStack.isEmpty()) - continue; - - boolean ore = data[0].equals("ore"); - TechReborn.LOGGER.debug("Ore: " + data[1]); - ItemStack dust = getDictOreOrEmpty(joinDictName("dust", data[1]), ore ? 2 : 1); - if (dust.isEmpty() || dust.getItem() == null) { - continue; - } - dust = dust.copy(); - if (ore) { - dust.setCount(2); - } - boolean useOreDict = true; - //Disables the ore dict for lapis, this is becuase it is oredict with dye. This may cause some other lapis ores to not be grindable, but we can fix that when that arrises. - if(data[1].equalsIgnoreCase("lapis")){ - useOreDict = false; - } - RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(oreStack, dust, ore ? 270 : 200, ore ? 31 : 22, useOreDict)); - } - } +// for (String oreDictionaryName : OreDictionary.getOreNames()) { +// if (isDictPrefixed(oreDictionaryName, "ore", "gem", "ingot")) { +// ItemStack oreStack = getDictOreOrEmpty(oreDictionaryName, 1); +// String[] data = getDictData(oreDictionaryName); +// +// //High-level ores shouldn't grind here +// if (data[0].equals("ore") && ( +// data[1].equals("tungsten") || +// data[1].equals("titanium") || +// data[1].equals("aluminium") || +// data[1].equals("iridium") || +// data[1].equals("saltpeter")|| +// data[1].equals("coal") || //Done here to skip going to dust so it can go to the output +// data[1].equals("diamond") || //For example diamond ore should go to diamonds not the diamond dust +// data[1].equals("emerald") || //TODO possibly remove this and make it a bit more dyamic? (Check for furnace recipes? and then the block drop?) +// data[1].equals("redstone") || +// data[1].equals("quartz") +// ) || +// oreStack.isEmpty()) +// continue; +// +// boolean ore = data[0].equals("ore"); +// TechReborn.LOGGER.debug("Ore: " + data[1]); +// ItemStack dust = getDictOreOrEmpty(joinDictName("dust", data[1]), ore ? 2 : 1); +// if (dust.isEmpty() || dust.getItem() == null) { +// continue; +// } +// dust = dust.copy(); +// if (ore) { +// dust.setCount(2); +// } +// boolean useOreDict = true; +// //Disables the ore dict for lapis, this is becuase it is oredict with dye. This may cause some other lapis ores to not be grindable, but we can fix that when that arrises. +// if(data[1].equalsIgnoreCase("lapis")){ +// useOreDict = false; +// } +// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(oreStack, dust, ore ? 270 : 200, ore ? 31 : 22, useOreDict)); +// } +// } } static void addVacuumFreezerRecipes() { @@ -379,10 +367,4 @@ public class ModRecipes { return FluidUtil.getFilledBucket(new FluidStack(fluid, Fluid.BUCKET_VOLUME)); } - public static ItemStack getOre(String name) { - if (OreDictionary.getOres(name).isEmpty()) { - throw new RuntimeException("Failed to get ore: " + name); - } - return OreDictionary.getOres(name).get(0).copy(); - } } diff --git a/src/main/java/techreborn/init/ModTags.java b/src/main/java/techreborn/init/ModTags.java new file mode 100644 index 000000000..8352a577b --- /dev/null +++ b/src/main/java/techreborn/init/ModTags.java @@ -0,0 +1,16 @@ +package techreborn.init; + +import net.minecraft.block.Block; +import net.minecraft.tags.BlockTags; +import net.minecraft.tags.Tag; +import net.minecraft.util.ResourceLocation; + +public class ModTags { + + public static Tag FENCE_IRON = get("fence_iron"); + + private static Tag get(String name) { + return (Tag) new BlockTags.Wrapper(new ResourceLocation("techreborn", name)); + } + +} diff --git a/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java b/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java index 73d8c5e78..66da7808f 100644 --- a/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java +++ b/src/main/java/techreborn/init/recipes/AlloySmelterRecipes.java @@ -28,8 +28,6 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import reborncore.api.recipe.RecipeHandler; -import reborncore.common.recipes.OreRecipeInput; -import reborncore.common.util.OreUtil; import techreborn.api.Reference; import techreborn.api.recipe.machines.AlloySmelterRecipe; @@ -41,6 +39,8 @@ public class AlloySmelterRecipes extends RecipeMethods { public static void init() { + /* + // OreRecipeInput ingotCopper3 = new OreRecipeInput("ingotCopper", 3); // OreRecipeInput dustCopper3 = new OreRecipeInput("dustCopper", 3); @@ -106,7 +106,7 @@ public class AlloySmelterRecipes extends RecipeMethods { // } // Red Alloy - if (OreUtil.doesOreExistAndValid("ingotRedAlloy")) { +// if (OreUtil.doesOreExistAndValid("ingotRedAlloy")) { ItemStack redAlloyStack = getOre("ingotRedAlloy"); redAlloyStack.setCount(1); // RecipeHandler.addRecipe(Reference.ALLOY_SMELTER_RECIPE, @@ -115,10 +115,10 @@ public class AlloySmelterRecipes extends RecipeMethods { RecipeHandler.addRecipe(Reference.ALLOY_SMELTER_RECIPE, new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 4), new ItemStack(Items.IRON_INGOT, 1), redAlloyStack, 200, 16)); - } +// } // Blue Alloy - if (oresExist("ingotBlueAlloy", "dustTeslatite")) { +// if (oresExist("ingotBlueAlloy", "dustTeslatite")) { // ItemStack blueAlloyStack = getOre("ingotBlueAlloy"); // blueAlloyStack.setCount(1); // RecipeHandler.addRecipe(Reference.ALLOY_SMELTER_RECIPE, new AlloySmelterRecipe(getOre("dustTeslatite", 4), @@ -126,7 +126,7 @@ public class AlloySmelterRecipes extends RecipeMethods { } // Blue Alloy - if (OreUtil.doesOreExistAndValid("ingotPurpleAlloy") && OreUtil.doesOreExistAndValid("dustInfusedTeslatite")) { +// if (OreUtil.doesOreExistAndValid("ingotPurpleAlloy") && OreUtil.doesOreExistAndValid("dustInfusedTeslatite")) { // ItemStack purpleAlloyStack = getOre("ingotPurpleAlloy"); // purpleAlloyStack.setCount(1); // ItemStack infusedTeslatiteStack = getOre("ingotPurpleAlloy"); @@ -219,6 +219,8 @@ public class AlloySmelterRecipes extends RecipeMethods { new AlloySmelterRecipe(new ItemStack(Blocks.SOUL_SAND, 1), new ItemStack(Items.GOLD_INGOT, 1), soulariumStack, 200, 16)); } + + */ } } diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index 084e8b525..472a93e0a 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -29,7 +29,6 @@ import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import reborncore.common.util.RebornCraftingHelper; import techreborn.TechReborn; import techreborn.config.ConfigTechReborn; import techreborn.init.TRContent; @@ -39,6 +38,8 @@ import techreborn.items.*; * Created by Prospector */ public class CraftingTableRecipes extends RecipeMethods { + /* TODO 1.13 :D + public static void init() { registerCompressionRecipes(); @@ -404,4 +405,6 @@ public class CraftingTableRecipes extends RecipeMethods { registerShaped(leggings, "GGG", "G G", "G G", 'G', material); registerShaped(boots, "G G", "G G", 'G', material); } + + */ } diff --git a/src/main/java/techreborn/init/recipes/ExtractorRecipes.java b/src/main/java/techreborn/init/recipes/ExtractorRecipes.java index bea681068..260dfb002 100644 --- a/src/main/java/techreborn/init/recipes/ExtractorRecipes.java +++ b/src/main/java/techreborn/init/recipes/ExtractorRecipes.java @@ -39,6 +39,7 @@ import techreborn.items.DynamicCell; * Created by Prospector */ public class ExtractorRecipes extends RecipeMethods { + /* TODO 1.13 :D public static void init() { register(getStack(TRContent.RUBBER_SAPLING), TRContent.Parts.RUBBER.getStack(), false); register(getStack(TRContent.RUBBER_LOG), TRContent.Parts.RUBBER.getStack(), false); @@ -75,4 +76,6 @@ public class ExtractorRecipes extends RecipeMethods { static void register(ItemStack input, ItemStack output, boolean oreDict) { RecipeHandler.addRecipe(Reference.EXTRACTOR_RECIPE, new ExtractorRecipe(input, output, 400, 2, oreDict)); } + + */ } diff --git a/src/main/java/techreborn/init/recipes/FluidReplicatorRecipes.java b/src/main/java/techreborn/init/recipes/FluidReplicatorRecipes.java index 94f1aefcb..3956d1351 100644 --- a/src/main/java/techreborn/init/recipes/FluidReplicatorRecipes.java +++ b/src/main/java/techreborn/init/recipes/FluidReplicatorRecipes.java @@ -36,6 +36,8 @@ import techreborn.init.ModFluids; */ public class FluidReplicatorRecipes { + /* TODO 1.13 :D + public static void init() { register(1, FluidRegistry.WATER, 40, 2); register(1, FluidRegistry.LAVA, 80, 2); @@ -57,4 +59,6 @@ public class FluidReplicatorRecipes { } FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(input, output, ticks, euPerTick)); } + + */ } diff --git a/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java index 9405f9ea3..a7e0b6a5b 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialElectrolyzerRecipes.java @@ -39,6 +39,8 @@ import java.security.InvalidParameterException; * Created by Prospector */ public class IndustrialElectrolyzerRecipes extends RecipeMethods { + /* TODO 1.13 :D + public static void init() { register(getMaterial("electrolyzedwater", 6, Type.CELL), 760, 120, getMaterial("hydrogen", 4, Type.CELL), getMaterial("compressedair", Type.CELL)); register(getMaterial("water", Type.CELL), 20, 50, getMaterial("electrolyzedwater", Type.CELL)); @@ -141,4 +143,6 @@ public class IndustrialElectrolyzerRecipes extends RecipeMethods { static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) { register(input, ticks, euPerTick, true, outputs); } + + */ } diff --git a/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java index b08d40b50..da168a31a 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java @@ -40,6 +40,8 @@ import java.security.InvalidParameterException; */ public class IndustrialGrinderRecipes extends RecipeMethods { + /* TODO 1.13 :D + static FluidStack WATER = new FluidStack(FluidRegistry.WATER, 1000); static FluidStack MERCURY = new FluidStack(ModFluids.MERCURY, 1000); static FluidStack SODIUM_PERSULFATE = new FluidStack(ModFluids.SODIUMPERSULFATE, 1000); @@ -214,4 +216,6 @@ public class IndustrialGrinderRecipes extends RecipeMethods { throw new InvalidParameterException("Invalid industrial grinder inputs: " + inputs); } } + + */ } diff --git a/src/main/java/techreborn/init/recipes/IndustrialSawmillRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialSawmillRecipes.java index 1ae52fa74..0d4c210e0 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialSawmillRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialSawmillRecipes.java @@ -29,7 +29,6 @@ import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -51,6 +50,8 @@ import java.util.stream.Collectors; @RebornRegister(TechReborn.MOD_ID) public class IndustrialSawmillRecipes extends RecipeMethods { + /* TODO 1.13 :D + static FluidStack WATER = new FluidStack(FluidRegistry.WATER, 1000); @ConfigRegistry(config = "recipes", category = "sawmill", key = "plankCount", comment = "Number of planks the saw mill will ouput") @@ -131,4 +132,6 @@ public class IndustrialSawmillRecipes extends RecipeMethods { } } + */ + } diff --git a/src/main/java/techreborn/init/recipes/IngredientCell.java b/src/main/java/techreborn/init/recipes/IngredientCell.java deleted file mode 100644 index 13ef2d662..000000000 --- a/src/main/java/techreborn/init/recipes/IngredientCell.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.init.recipes; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import techreborn.items.ItemCells; - -import javax.annotation.Nullable; - -public class IngredientCell extends Ingredient { - - public IngredientCell(ItemStack... stacks) { - super(stacks); - } - - @Override - public boolean apply(@Nullable ItemStack itemStack) { - if(super.apply(itemStack)){ - return ItemCells.isCellEqual(itemStack, this.getMatchingStacks()[0]); - } - return false; - } -} diff --git a/src/main/java/techreborn/init/recipes/RecipeMethods.java b/src/main/java/techreborn/init/recipes/RecipeMethods.java index 607b6394b..8e7ba9716 100644 --- a/src/main/java/techreborn/init/recipes/RecipeMethods.java +++ b/src/main/java/techreborn/init/recipes/RecipeMethods.java @@ -29,7 +29,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraftforge.oredict.OreDictionary; -import reborncore.common.util.OreUtil; import reborncore.common.util.StringUtils; import techreborn.items.*; @@ -89,9 +88,7 @@ public abstract class RecipeMethods { } if (object != null) { if (object instanceof String) { - if (OreUtil.doesOreExistAndValid((String) object)) { - return object; - } + throw new UnsupportedOperationException("Use tags"); } else { return object; } @@ -107,24 +104,19 @@ public abstract class RecipeMethods { return getMaterialObjectFromType(name, type); } + @Deprecated public static ItemStack getOre(String name, int count) { - return OreUtil.getStackFromName(name, count).copy(); + throw new UnsupportedOperationException("Use tags"); } + @Deprecated public static ItemStack getOre(String name) { - return getOre(name, 1); + throw new UnsupportedOperationException("Use tags"); } + @Deprecated public static boolean oresExist(String... names) { - for (String name : names) { - if (!OreDictionary.doesOreNameExist(name)) { - return false; - } - if(OreDictionary.getOres(name).isEmpty()){ - return false; - } - } - return true; + throw new UnsupportedOperationException("Use tags"); } public static ItemStack getStack(Item item) { @@ -135,12 +127,14 @@ public abstract class RecipeMethods { return new ItemStack(item, count); } + public static ItemStack getStack(Item item, boolean wildcard) { return getStack(item, 1, wildcard); } + @Deprecated public static ItemStack getStack(Item item, int count, boolean wildcard) { - return getStack(item, count, wildcard ? OreDictionary.WILDCARD_VALUE : 0); + throw new UnsupportedOperationException("Use tags"); } public static ItemStack getStack(Block block) { @@ -148,7 +142,7 @@ public abstract class RecipeMethods { } public static ItemStack getStack(Block block, int count) { - return getStack(block, count, 0); + return getStack(block, count); } public static ItemStack getStack(Block block, boolean wildcard) { @@ -156,15 +150,13 @@ public abstract class RecipeMethods { } public static ItemStack getStack(Block block, int count, boolean wildcard) { - return getStack(block, count, wildcard ? OreDictionary.WILDCARD_VALUE : 0); + throw new UnsupportedOperationException("Use tags"); } - public static ItemStack getStack(Block block, int count, int metadata) { - return getStack(Item.getItemFromBlock(block), count, metadata); - } public static Ingredient getCell(String name, int count){ - return new IngredientCell(ItemCells.getCellByName(name, count)); + throw new UnsupportedOperationException("fix me"); + //return new IngredientCell(ItemCells.getCellByName(name, count)); } public static Ingredient getCell(String name){ diff --git a/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java b/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java index c2f92e8e7..ab3fda31d 100644 --- a/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java +++ b/src/main/java/techreborn/init/recipes/ScrapboxRecipes.java @@ -149,10 +149,10 @@ public class ScrapboxRecipes extends RecipeMethods { register(getStack(Blocks.PUMPKIN)); register(getStack(Blocks.NETHERRACK)); register(getStack(Blocks.GRASS)); - register(getStack(Blocks.DIRT, 1, 0)); - register(getStack(Blocks.DIRT, 1, 1)); - register(getStack(Blocks.SAND, 1, 0)); - register(getStack(Blocks.SAND, 1, 1)); + register(getStack(Blocks.DIRT, 1)); + register(getStack(Blocks.DIRT, 1)); + register(getStack(Blocks.SAND, 1)); + register(getStack(Blocks.SAND, 1)); register(getStack(Blocks.GLOWSTONE)); register(getStack(Blocks.GRAVEL)); // register(getStack(Blocks.HARDENED_CLAY)); @@ -224,10 +224,6 @@ public class ScrapboxRecipes extends RecipeMethods { RecipeHandler.addRecipe(Reference.SCRAPBOX_RECIPE, new ScrapboxRecipe(output, 20, 2)); } - static void registerDyable(Item item) { - for (int i = 0; i < 16; i++) - register(getStack(item, 1, i)); - } static void registerDyable(Block block) { //registerDyable(Item.getItemFromBlock(block)); diff --git a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java index c99024896..afd8f110b 100644 --- a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java +++ b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java @@ -26,7 +26,6 @@ package techreborn.init.recipes; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import reborncore.common.util.RebornCraftingHelper; import techreborn.init.TRContent; /** @@ -66,6 +65,6 @@ public class SmeltingRecipes extends RecipeMethods { } static void register(ItemStack input, ItemStack output) { - RebornCraftingHelper.addSmelting(input, output); + //RebornCraftingHelper.addSmelting(input, output); } } diff --git a/src/main/java/techreborn/tiles/generator/TileLightningRod.java b/src/main/java/techreborn/tiles/generator/TileLightningRod.java index 8b6090df4..224be2998 100644 --- a/src/main/java/techreborn/tiles/generator/TileLightningRod.java +++ b/src/main/java/techreborn/tiles/generator/TileLightningRod.java @@ -24,6 +24,7 @@ package techreborn.tiles.generator; +import net.minecraft.block.Block; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -37,8 +38,10 @@ import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.registration.RebornRegister; import reborncore.common.registration.config.ConfigRegistry; import techreborn.TechReborn; +import techreborn.init.ModTags; import techreborn.init.TRContent; import techreborn.init.TRTileEntities; +import techreborn.utils.TagUtils; @RebornRegister(TechReborn.MOD_ID) public class TileLightningRod extends TilePowerAcceptor implements IToolDrop { @@ -111,10 +114,9 @@ public class TileLightningRod extends TilePowerAcceptor implements IToolDrop { } public boolean isValidIronFence(int y) { - final Item itemBlock = Item.getItemFromBlock(this.world.getBlockState(new BlockPos(pos.getX(), y, pos.getZ())).getBlock()); - for (final ItemStack fence : OreDictionary.getOres("fenceIron")) { - if (fence.getItem() == itemBlock) - return true; + Block block = this.world.getBlockState(new BlockPos(pos.getX(), y, pos.getZ())).getBlock(); + if(TagUtils.hasTag(block, ModTags.FENCE_IRON)){ + return true; } return false; } diff --git a/src/main/java/techreborn/utils/TagUtils.java b/src/main/java/techreborn/utils/TagUtils.java index 8885c8552..4d9566cb5 100644 --- a/src/main/java/techreborn/utils/TagUtils.java +++ b/src/main/java/techreborn/utils/TagUtils.java @@ -33,6 +33,7 @@ import net.minecraft.tags.Tag; import net.minecraft.tags.TagCollection; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; +import techreborn.init.ModTags; import javax.annotation.Nonnull; import java.util.List; @@ -118,4 +119,5 @@ public class TagUtils { ItemStack stack, String oreName) { throw new UnsupportedOperationException("Move to tags"); } + }