229 - comment out all recipes as we can deal with these later + start thinking more about tags

This commit is contained in:
modmuss50 2019-02-22 14:27:22 +00:00
parent ab2ce91e39
commit 91994e5a01
17 changed files with 133 additions and 169 deletions

View file

@ -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;

View file

@ -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"));
}

View file

@ -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<Entry<ItemStack, ItemStack>> iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator();
Map.Entry<ItemStack, ItemStack> 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();
}
}

View file

@ -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<Block> FENCE_IRON = get("fence_iron");
private static <T> Tag<T> get(String name) {
return (Tag<T>) new BlockTags.Wrapper(new ResourceLocation("techreborn", name));
}
}

View file

@ -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));
}
*/
}
}

View file

@ -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);
}
*/
}

View file

@ -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));
}
*/
}

View file

@ -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));
}
*/
}

View file

@ -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);
}
*/
}

View file

@ -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);
}
}
*/
}

View file

@ -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 {
}
}
*/
}

View file

@ -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;
}
}

View file

@ -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){

View file

@ -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));

View file

@ -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);
}
}

View file

@ -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;
}

View file

@ -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");
}
}