diff --git a/src/main/java/emt/tile/TileEntityEtherealMacerator.java b/src/main/java/emt/tile/TileEntityEtherealMacerator.java index 1b229b2..baaf38d 100644 --- a/src/main/java/emt/tile/TileEntityEtherealMacerator.java +++ b/src/main/java/emt/tile/TileEntityEtherealMacerator.java @@ -2,13 +2,9 @@ package emt.tile; import emt.init.EMTBlocks; import emt.util.EMTConfigHandler; -import ic2.api.item.IC2Items; import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; @@ -118,7 +114,7 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided } public void updateEntity() { - if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) { + if (this.canSmelt() && !isOverLimit(1) && !isOverLimit(2) && isAllowed()) { ++this.cookTime; this.isOn = true; worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); @@ -226,18 +222,17 @@ public class TileEntityEtherealMacerator extends TileEntityEMT implements ISided } } - public boolean isOP() { - final int cobblestoneId = OreDictionary.getOreID("blockCobble"); + public boolean isAllowed() { - if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish - || this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem() - || (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm") - || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick") - || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) { - return true; - } else { - return false; + int[] oreDictIDs = OreDictionary.getOreIDs(this.slots[0]); + for (int oreDictID : oreDictIDs) { + String tName = OreDictionary.getOreName(oreDictID); + for (String allowed : EMTConfigHandler.etherealMaceratorWhiteList) { + if (tName.indexOf(allowed) == 0) return true; + } } + return false; + } @Override diff --git a/src/main/java/emt/util/EMTConfigHandler.java b/src/main/java/emt/util/EMTConfigHandler.java index bfd17e7..c1845c4 100644 --- a/src/main/java/emt/util/EMTConfigHandler.java +++ b/src/main/java/emt/util/EMTConfigHandler.java @@ -5,6 +5,9 @@ import gregtech.api.enums.GT_Values; import net.minecraftforge.common.config.Configuration; import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * TODO: Need to rewrite... @@ -72,6 +75,7 @@ public class EMTConfigHandler { public static boolean smoke; public static boolean oneRingSpawn; public static boolean removeAmberAndCinnabarMacerating; + public static List etherealMaceratorWhiteList = new ArrayList<>(); /** * Loot chance @@ -156,6 +160,7 @@ public class EMTConfigHandler { chanceOneRing = config.get(RANDOM, "One Ring spawning chance", 15, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt(); removeAmberAndCinnabarMacerating = config.get(RANDOM, "Clear Amber/Cinnabar Macerating", true, "This is here because of conflicts between mods that add the same input and different outputs").getBoolean(removeAmberAndCinnabarMacerating); impactOfRain = config.get(RANDOM, "Impact of rain", true, "The impact of rain on all wings").getBoolean(impactOfRain); + etherealMaceratorWhiteList.addAll(Arrays.asList(config.get(RANDOM, "White List for Ethereal Processor", new String[]{"ore", "cluster"}, "The allowed ore dictionary prefix for Ethereal Processor.").getStringList())); // DEFAULTS - Aer - 15,000 Aqua - 5,000 Ignis - 20,000 Ordo - 16,000 Perditio - 10,000 Terra - 2,000 airOutput = config.get(OUTPUTS, "Aer Output", 15000).getDouble(airOutput); @@ -190,7 +195,6 @@ public class EMTConfigHandler { inventoryBaubleProdution = config.get(VALUES, "Inventory Charging Ring production", 32, "Default is 32").getInt(); wandChargeFocusCost = config.get(VALUES, "Wand Focus: Wand Charging Cost", 40000, "Default is 40000").getInt(); - nanoBootsMinDrop = config.get(VALUES, "Nano Boots of the Traveller minimum drop", 6.0, "The distance allowed to fall without any damage").getDouble(nanoBootsMinDrop); nanoBootsMaxDrop = config.get(VALUES, "Nano Boots of the Traveller maximum healthy drop", 35.0, "Energy amount drained will tripled if player drops more than this amount of blocks").getDouble(nanoBootsMaxDrop); quantumBootsMinDrop = config.get(VALUES, "Quantum Boots of the Traveller minimum drop", 10.0, "The distance allowed to fall without any damage").getDouble(quantumBootsMinDrop);