aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2020-04-10 18:02:06 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2020-04-10 18:02:06 +0200
commite53d92257d2ce0f37dabb9f99d73fa2719c36823 (patch)
tree1dd9e8ef24510f83b0ff1f52b85984298b61eea3 /src/main/java/gregtech/api
parent93af178db9c7d457a22a39cb93229e40362ffd34 (diff)
downloadGT5-Unofficial-e53d92257d2ce0f37dabb9f99d73fa2719c36823.tar.gz
GT5-Unofficial-e53d92257d2ce0f37dabb9f99d73fa2719c36823.tar.bz2
GT5-Unofficial-e53d92257d2ce0f37dabb9f99d73fa2719c36823.zip
renormalize line endings
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/GregTech_API.java1458
-rw-r--r--src/main/java/gregtech/api/enums/MaterialBuilder.java520
-rw-r--r--src/main/java/gregtech/api/enums/OrePrefixes.java2236
-rw-r--r--src/main/java/gregtech/api/enums/TextureSet.java366
-rw-r--r--src/main/java/gregtech/api/enums/Textures.java3362
-rw-r--r--src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java38
-rw-r--r--src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java202
-rw-r--r--src/main/java/gregtech/api/items/GT_CoolantCell_Item.java170
-rw-r--r--src/main/java/gregtech/api/items/GT_Generic_Item.java322
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaBase_Item.java1232
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java380
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java394
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java1448
-rw-r--r--src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java324
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java2864
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java1686
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java1192
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java1316
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java3664
19 files changed, 11587 insertions, 11587 deletions
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java
index b42c7768c8..dac494d9bc 100644
--- a/src/main/java/gregtech/api/GregTech_API.java
+++ b/src/main/java/gregtech/api/GregTech_API.java
@@ -1,729 +1,729 @@
-package gregtech.api;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IDamagableItem;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.internal.IGT_RecipeAdder;
-import gregtech.api.interfaces.internal.IThaumcraftCompat;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.items.GT_CoolantCellIC_Item;
-import gregtech.api.items.GT_CoolantCell_Item;
-import gregtech.api.items.GT_Tool_Item;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.api.objects.GT_Cover_Default;
-import gregtech.api.objects.GT_Cover_None;
-import gregtech.api.objects.GT_HashSet;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.threads.GT_Runnable_MachineBlockUpdate;
-import gregtech.api.util.*;
-import gregtech.api.world.GT_Worldgen;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.Fluid;
-
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.*;
-
-/**
- * Please do not include this File in your Mod-download as it ruins compatiblity, like with the IC2-API
- * You may just copy those Functions into your Code, or better call them via reflection.
- * <p/>
- * The whole API is the basic construct of my Mod. Everything is dependent on it.
- * I change things quite often so please don't include any File inside your Mod, even if it is an Interface.
- * Since some Authors were stupid enough to break this simple Rule, I added Version checks to enforce it.
- * <p/>
- * In these Folders are many useful Functions. You can use them via reflection if you want.
- * I know not everything is compilable due to API's of other Mods, but these are easy to fix in your Setup.
- * <p/>
- * You can use this to learn about Modding, but I would recommend simpler Mods.
- * You may even copypaste Code from these API-Files into your Mod, as I have nothing against that, but you should look exactly at what you are copying.
- *
- * @author Gregorius Techneticies
- */
-@SuppressWarnings("ALL")
-public class GregTech_API {
-
- @Deprecated
- public static final long MATERIAL_UNIT = M, FLUID_MATERIAL_UNIT = L;
- /**
- * Fixes the HashMap Mappings for ItemStacks once the Server started
- */
- public static final Collection<Map<GT_ItemStack, ?>> sItemStackMappings = new ArrayList<>();
- public static final Collection<Map<Fluid, ?>> sFluidMappings = new ArrayList<>();
- /**
- * The MetaTileEntity-ID-List-Length
- */
- public static final short MAXIMUM_METATILE_IDS = Short.MAX_VALUE - 1;
- /**
- * My Creative Tab
- */
- public static final CreativeTabs
- TAB_GREGTECH = new GT_CreativeTab("Main", "Main"),
- TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"),
- TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores");
- /**
- * A List of all registered MetaTileEntities
- * <p/>
- * 0 - 749 are used by GregTech.
- * 750 - 999 are reserved for Alkalus.
- * 1000 - 2047 are used by GregTech.
- * 2048 - 2559 are reserved for OvermindDL.
- * 2560 - 3071 are reserved for Immibis.
- * 3072 - 3583 are reserved for LinusPhoenix.
- * 3584 - 4095 are reserved for BloodyAsp.
- * 4096 - 5095 are used for GregTech Frames.
- * 5096 - 6099 are used for GregTech Pipes.
- * 6100 - 8191 are used for GregTech Decoration Blocks.
- * 8192 - 8703 are reserved for ZL123.
- * 8704 - 9215 are reserved for Mr10Movie.
- * 9216 - 9727 are used for GregTech Automation Machines.
- * 9728 - 10239 are reserved for 28Smiles.
- * 10240 - 10751 are reserved for VirMan.
- * 10752 - 11263 are reserved for Briareos81.
- * 11264 - 12000 are reserved for the next one who asks me.
- * 9728 - 32766 are currently free.
- * <p/>
- * Contact me if you need a free ID-Range, which doesn't conflict with other Addons.
- * You could make an ID-Config, but we all know, what "stupid" customers think about conflicting ID's
- */
- public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS];
- /**
- * The Icon List for Covers
- */
- public static final Map<GT_ItemStack, ITexture> sCovers = new ConcurrentHashMap<>();
- /**
- * The List of Cover Behaviors for the Covers
- */
- public static final Map<GT_ItemStack, GT_CoverBehavior> sCoverBehaviors = new ConcurrentHashMap<>();
- /**
- * The List of Circuit Behaviors for the Redstone Circuit Block
- */
- public static final Map<Integer, GT_CircuitryBehavior> sCircuitryBehaviors = new ConcurrentHashMap<>();
- /**
- * The List of Blocks, which can conduct Machine Block Updates
- */
- public static final Map<Block, Integer> sMachineIDs = new ConcurrentHashMap<>();
- /**
- * The Redstone Frequencies
- */
- public static final Map<Integer, Byte> sWirelessRedstone = new ConcurrentHashMap<>();
- /**
- * The IDSU Frequencies
- */
- public static final Map<Integer, Integer> sIDSUList = new ConcurrentHashMap<>();
- /**
- * A List of all Books, which were created using @GT_Utility.getWrittenBook the original Title is the Key Value
- */
- public static final Map<String, ItemStack> sBookList = new ConcurrentHashMap<>();
- /**
- * The List of all Sounds used in GT, indices are in the static Block at the bottom
- */
- public static final Map<Integer, String> sSoundList = new ConcurrentHashMap<>();
- /**
- * The List of Tools, which can be used. Accepts regular damageable Items and Electric Items
- */
- public static final GT_HashSet<GT_ItemStack>
- sToolList = new GT_HashSet<>(),
- sCrowbarList = new GT_HashSet<>(),
- sScrewdriverList = new GT_HashSet<>(),
- sWrenchList = new GT_HashSet<>(),
- sSoftHammerList = new GT_HashSet<>(),
- sHardHammerList = new GT_HashSet<>(),
- sWireCutterList = new GT_HashSet<>(),
- sSolderingToolList = new GT_HashSet<>(),
- sSolderingMetalList = new GT_HashSet<>();
- /**
- * The List of Hazmat Armors
- */
- public static final GT_HashSet<GT_ItemStack>
- sGasHazmatList = new GT_HashSet<>(),
- sBioHazmatList = new GT_HashSet<>(),
- sFrostHazmatList = new GT_HashSet<>(),
- sHeatHazmatList = new GT_HashSet<>(),
- sRadioHazmatList = new GT_HashSet<>(),
- sElectroHazmatList = new GT_HashSet<>();
- /**
- * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets.
- * Mystcraft Dimensions and other Dimensional Things should be allowed.
- * Mystcraft and Twilight Forest are automatically considered a Dimension, without being in this List.
- */
- public static final Collection<Integer> sDimensionalList = new HashSet<>();
- /**
- * Lists of all the active World generation Features, these are getting Initialized in Postload!
- */
- public static final List<GT_Worldgen> sWorldgenList = new ArrayList<>();
- /**
- * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
- */
- public static final Materials[] sGeneratedMaterials = new Materials[1000];
- /**
- * This is the generic Cover behavior. Used for the default Covers, which have no Behavior.
- */
- public static final GT_CoverBehavior
- sDefaultBehavior = new GT_Cover_Default(),
- sNoBehavior = new GT_Cover_None();
- /**
- * For the API Version check
- */
- public static volatile int VERSION = 509;
-
- @Deprecated
- public static IGT_RecipeAdder sRecipeAdder;
- /**
- * Used to register Aspects to ThaumCraft, this Object might be null if ThaumCraft isn't installed
- */
- public static IThaumcraftCompat sThaumcraftCompat;
- /**
- * These Lists are getting executed at their respective timings. Useful if you have to do things right before/after I do them, without having to control the load order. Add your "Commands" in the Constructor or in a static Code Block of your Mods Main Class. These are not Threaded, I just use a native Java Interface for their execution. Implement just the Method run() and everything should work
- */
- public static List<Runnable>
- sBeforeGTPreload = new ArrayList<>(),
- sAfterGTPreload = new ArrayList<>(),
- sBeforeGTLoad = new ArrayList<>(),
- sAfterGTLoad = new ArrayList<>(),
- sBeforeGTPostload = new ArrayList<>(),
- sAfterGTPostload = new ArrayList<>(),
- sBeforeGTServerstart = new ArrayList<>(),
- sAfterGTServerstart = new ArrayList<>(),
- sBeforeGTServerstop = new ArrayList<>(),
- sAfterGTServerstop = new ArrayList<>(),
- sGTBlockIconload = new ArrayList<>(),
- sGTItemIconload = new ArrayList<>();
- /**
- * The Icon Registers from Blocks and Items. They will get set right before the corresponding Icon Load Phase as executed in the Runnable List above.
- */
- @SideOnly(Side.CLIENT)
- public static IIconRegister
- sBlockIcons,
- sItemIcons;
- /**
- * The Configuration Objects
- */
- public static GT_Config
- sRecipeFile = null,
- sMachineFile = null,
- sWorldgenFile = null,
- sModularArmor = null,
- sMaterialProperties = null,
- sMaterialComponents = null,
- sUnification = null,
- sSpecialFile = null,
- sClientDataFile,
- sOPStuff = null;
- public static int
- TICKS_FOR_LAG_AVERAGING = 25,
- MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100;
- /**
- * Initialized by the Block creation.
- */
- public static Block sBlockMachines;
-
- public static Block
- sBlockOres1,
- sBlockOresUb1,
- sBlockOresUb2,
- sBlockOresUb3,
- /*sBlockGem,*/
- sBlockMetal1,
- sBlockMetal2,
- sBlockMetal3,
- sBlockMetal4,
- sBlockMetal5,
- sBlockMetal6,
- sBlockMetal7,
- sBlockMetal8,
- sBlockGem1,
- sBlockGem2,
- sBlockGem3,
- sBlockReinforced;
- public static Block
- sBlockGranites,
- sBlockConcretes,
- sBlockStones;
- public static Block
- sBlockCasings1,
- sBlockCasings2,
- sBlockCasings3,
- sBlockCasings4,
- sBlockCasings5,
- sBlockCasings6,
- sBlockCasings8;
- /**
- * Getting assigned by the Config
- */
- public static boolean
- sTimber = true,
- sDrinksAlwaysDrinkable = false,
- sMultiThreadedSounds = false,
- sDoShowAllItemsInCreative = false,
- sColoredGUI = true,
- sConstantEnergy = true,
- sMachineExplosions = true,
- sMachineFlammable = true,
- sMachineNonWrenchExplosions = true,
- sMachineRainExplosions = true,
- sMachineThunderExplosions = true,
- sMachineFireExplosions = true,
- sMachineWireFire = true,
- mOutputRF = false,
- mInputRF = false,
- meIOLoaded = false,
- mRFExplosions = true,
- mServerStarted = false,
- mIC2Classic = false,
- mMagneticraft = false,
- mImmersiveEngineering = false,
- mGTPlusPlus = false,
- mTranslocator = false,
- mTConstruct = false,
- mGalacticraft = false;
- public static int
- mEUtoRF = 360,
- mRFtoEU = 20;
-
-
- /**
- * Option to not use MACHINE_METAL mixing into colors
- */
- public static boolean sUseMachineMetal = false;
-
-
- public static boolean mUseOnlyGoodSolderingMaterials = false;
-
- private static final String aTextIC2Lower = MOD_ID_IC2.toLowerCase(Locale.ENGLISH);
- /**
- * Getting assigned by the Mod loading
- */
- public static boolean
- sUnificationEntriesRegistered = false,
- sPreloadStarted = false,
- sPreloadFinished = false,
- sLoadStarted = false,
- sLoadFinished = false,
- sPostloadStarted = false,
- sPostloadFinished = false;
- private static Class sBaseMetaTileEntityClass = null;
-
- /**
- * Adds Biomes to the Biome Lists for World Generation
- */
- static {
- sItemStackMappings.add(sCovers);
- sItemStackMappings.add(sCoverBehaviors);
-
- //sDimensionalList.add(56);
- //sDimensionalList.add(55);
-
- sSoundList.put(0, "random.break");
- sSoundList.put(1, "random.anvil_use");
- sSoundList.put(2, "random.anvil_break");
- sSoundList.put(3, "random.click");
- sSoundList.put(4, "random.fizz");
- sSoundList.put(5, "random.explode");
- sSoundList.put(6, "fire.ignite");
-
- sSoundList.put(100, aTextIC2Lower + ":" + "tools.Wrench");
- sSoundList.put(101, aTextIC2Lower + ":" + "tools.RubberTrampoline");
- sSoundList.put(102, aTextIC2Lower + ":" + "tools.Painter");
- sSoundList.put(103, aTextIC2Lower + ":" + "tools.BatteryUse");
- sSoundList.put(104, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseOne");
- sSoundList.put(105, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseTwo");
- sSoundList.put(106, aTextIC2Lower + ":" + "tools.drill.DrillSoft");
- sSoundList.put(107, aTextIC2Lower + ":" + "tools.drill.DrillHard");
- sSoundList.put(108, aTextIC2Lower + ":" + "tools.ODScanner");
-
- sSoundList.put(200, aTextIC2Lower + ":" + "machines.ExtractorOp");
- sSoundList.put(201, aTextIC2Lower + ":" + "machines.MaceratorOp");
- sSoundList.put(202, aTextIC2Lower + ":" + "machines.InductionLoop");
- sSoundList.put(203, aTextIC2Lower + ":" + "machines.CompressorOp");
- sSoundList.put(204, aTextIC2Lower + ":" + "machines.RecyclerOp");
- sSoundList.put(205, aTextIC2Lower + ":" + "machines.MinerOp");
- sSoundList.put(206, aTextIC2Lower + ":" + "machines.PumpOp");
- sSoundList.put(207, aTextIC2Lower + ":" + "machines.ElectroFurnaceLoop");
- sSoundList.put(208, aTextIC2Lower + ":" + "machines.InductionLoop");
- sSoundList.put(209, aTextIC2Lower + ":" + "machines.MachineOverload");
- sSoundList.put(210, aTextIC2Lower + ":" + "machines.InterruptOne");
- sSoundList.put(211, aTextIC2Lower + ":" + "machines.KaChing");
- sSoundList.put(212, aTextIC2Lower + ":" + "machines.MagnetizerLoop");
- }
-
- /**
- * You want OreDict-Unification for YOUR Mod/Addon, when GregTech is installed? This Function is especially for YOU.
- * Call this Function after the load-Phase, as I register the the most of the Unification at that Phase (Redpowers Storageblocks are registered at postload).
- * A recommended use of this Function is inside your Recipe-System itself (if you have one), as the unification then makes 100% sure, that every added non-unificated Output gets automatically unificated.
- * <p/>
- * I will personally make sure, that only common prefixes of Ores get registered at the Unificator, as of now there are:
- * pulp, dust, dustSmall, ingot, nugget, gem, ore and block
- * If another Mod-Author messes these up, then it's not my fault and it's especially not your fault. As these are commonly used prefixes.
- * <p/>
- * This Unificator-API-Function uses the same Functions I use, for unificating Items. So if there is something messed up (very unlikely), then everything is messed up.
- * <p/>
- * You shouldn't use this to unificate the Inputs of your Recipes, this is only meant for the Outputs.
- *
- * @param aOreStack the Stack you want to get unificated. It is stackSize Sensitive.
- * @return Either an unificated Stack or the stack you toss in, but it should never be null, unless you throw a Nullpointer into it.
- */
- public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) {
- if (!GregTech_API.sPreloadFinished)
- GT_Log.err.println("GregTech_API ERROR: " + aOreStack.getItem() + "." + aOreStack.getItemDamage() + " - OreDict Unification Entries are not registered now, please call it in the postload phase.");
- return GT_OreDictUnificator.get(true, aOreStack);
- }
-
- /**
- * Causes a Machineblock Update
- * This update will cause surrounding MultiBlock Machines to update their Configuration.
- * You should call this Function in @Block.breakBlock and in @Block.onBlockAdded of your Machine.
- *
- * @param aWorld is being the World
- * @param aX is the X-Coord of the update causing Block
- * @param aY is the Y-Coord of the update causing Block
- * @param aZ is the Z-Coord of the update causing Block
- */
- public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) {
- if (!aWorld.isRemote)
- new Thread(new GT_Runnable_MachineBlockUpdate(aWorld, aX, aY, aZ), "Machine Block Updating").start();
- return true;
- }
-
- /**
- * Adds a Multi-Machine Block, like my Machine Casings for example.
- * You should call @causeMachineUpdate in @Block.breakBlock and in @Block.onBlockAdded of your registered Block.
- * You don't need to register TileEntities which implement @IMachineBlockUpdateable
- *
- * @param aBlock the Block
- * @param aMeta the Metadata of the Blocks as Bitmask! -1 or ~0 for all Metavalues
- */
- public static boolean registerMachineBlock(Block aBlock, int aMeta) {
- if (GT_Utility.isBlockInvalid(aBlock))
- return false;
- if (GregTech_API.sThaumcraftCompat != null)
- GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
- sMachineIDs.put(aBlock, aMeta);
- return true;
- }
-
- /**
- * Like above but with boolean Parameters instead of a BitMask
- */
- public static boolean registerMachineBlock(Block aBlock, boolean... aMeta) {
- if (GT_Utility.isBlockInvalid(aBlock) || aMeta == null || aMeta.length == 0)
- return false;
- if (GregTech_API.sThaumcraftCompat != null)
- GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
- int rMeta = 0;
- for (byte i = 0; i < aMeta.length && i < 16; i++) if (aMeta[i]) rMeta |= B[i];
- sMachineIDs.put(aBlock, rMeta);
- return true;
- }
-
- /**
- * if this Block is a Machine Update Conducting Block
- */
- public static boolean isMachineBlock(Block aBlock, int aMeta) {
- if (GT_Utility.isBlockInvalid(aBlock))
- return false;
- return (sMachineIDs.containsKey(aBlock) && (sMachineIDs.get(aBlock) & B[aMeta]) != 0);
- }
-
- /**
- * Creates a new Coolant Cell Item for your Nuclear Reactor
- */
- public static Item constructCoolantCellItem(String aUnlocalized, String aEnglish, int aMaxStore) {
- try {
- return new GT_CoolantCellIC_Item(aUnlocalized, aEnglish, aMaxStore);
-// return (Item)Class.forName("gregtech.api.items.GT_CoolantCellIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return new GT_CoolantCell_Item(aUnlocalized, aEnglish, aMaxStore);
-// return (Item)Class.forName("gregtech.api.items.GT_CoolantCell_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
- }
-
- /**
- * Creates a new Energy Armor Item
- */
- public static Item constructElectricArmorItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) {
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmorIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
- }
-
- /**
- * Creates a new Energy Battery Item
- */
- public static Item constructElectricEnergyStorageItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aEmptyID, int aFullID) {
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStoreIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStore_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
- }
-
- /**
- * Creates a new Hard Hammer Item
- */
- public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_HardHammer_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new Crowbar Item
- */
- public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
- } catch (Throwable e) {/*Do nothing*/}
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Crowbar_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new Wrench Item
- */
- public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Wrench_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Screwdriver Item
- */
- public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Wrench Item
- */
- public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Saw Item
- */
- public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SawIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Drill Item
- */
- public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_DrillIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new electric Soldering Tool
- */
- public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
- }
-
- /**
- * Creates a new empty electric Tool
- */
- public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aChargedGTID) {
- try {
- return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID);
- } catch (Throwable e) {/*Do nothing*/}
- return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, 0, false);
- }
-
- /**
- * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity
- */
- public static BaseMetaTileEntity constructBaseMetaTileEntity() {
- if (sBaseMetaTileEntityClass == null) {
- try {
- return (BaseMetaTileEntity) (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
- } catch (Throwable e) {/*Do nothing*/}
- }
-
- try {
- return (BaseMetaTileEntity) (sBaseMetaTileEntityClass.newInstance());
- } catch (Throwable e) {
- GT_Log.err.println("GT_Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- e.printStackTrace(GT_Log.err);
- throw new RuntimeException(e);
- }
- }
-
- public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) {
- if (!sCovers.containsKey(new GT_ItemStack(aStack)))
- sCovers.put(new GT_ItemStack(aStack), aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover);
- if (aBehavior != null)
- sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior);
- }
-
- public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehavior aBehavior) {
- sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior);
- }
-
- /**
- * Registers multiple Cover Items. I use that for the OreDict Functionality.
- *
- * @param aBehavior can be null
- */
- public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, GT_CoverBehavior aBehavior) {
- if (aCover.isValidTexture())
- aStackList.forEach(tStack -> GregTech_API.registerCover(tStack, aCover, aBehavior));
- }
-
- /**
- * returns a Cover behavior, guaranteed to not return null after preload
- */
- public static GT_CoverBehavior getCoverBehavior(ItemStack aStack) {
- if (aStack == null || aStack.getItem() == null)
- return sNoBehavior;
- GT_CoverBehavior rCover = sCoverBehaviors.get(new GT_ItemStack(aStack));
- if (rCover == null)
- return sDefaultBehavior;
- return rCover;
- }
-
- /**
- * returns a Cover behavior, guaranteed to not return null
- */
- public static GT_CoverBehavior getCoverBehavior(int aStack) {
- if (aStack == 0)
- return sNoBehavior;
- return getCoverBehavior(GT_Utility.intToStack(aStack));
- }
-
- /**
- * Register a Wrench to be usable on GregTech Machines.
- * The Wrench MUST have some kind of Durability unlike certain Buildcraft Wrenches.
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- * <p/>
- * -----
- * <p/>
- * Returning true at isDamagable was a great Idea, KingLemming. Well played.
- * Since the OmniWrench is just a Single-Item-Mod, people can choose if they want your infinite durability or not. So that's not really a Problem.
- * I even have a new Config to autodisable most infinite BC Wrenches (but that one is turned off).
- * <p/>
- * One last Bug for you to fix:
- * My Autoregistration detects Railcrafts Crowbars, Buildcrafts Wrenches and alike, due to their Interfaces.
- * Guess what now became a Crowbar by accident. Try registering the Wrench at the load phase to prevent things like that from happening.
- * Yes, I know that "You need to register Tools in the Load Phase"-Part wasn't there before this. Sorry about that.
- */
- public static boolean registerWrench(ItemStack aTool) {
- return registerTool(aTool, sWrenchList);
- }
-
- /**
- * Register a Crowbar to extract Covers from Machines
- * Crowbars are NOT Wrenches btw.
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerCrowbar(ItemStack aTool) {
- return registerTool(aTool, sCrowbarList);
- }
-
- /**
- * Register a Screwdriver to interact directly with Machines and Covers
- * Did I mention, that it is intentionally not possible to make a Multitool, which doesn't switch ItemID (like a Mode) all the time?
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerScrewdriver(ItemStack aTool) {
- return registerTool(aTool, sScrewdriverList);
- }
-
- /**
- * Register a Soft Hammer to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerSoftHammer(ItemStack aTool) {
- return registerTool(aTool, sSoftHammerList);
- }
-
- /**
- * Register a Hard Hammer to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerHardHammer(ItemStack aTool) {
- return registerTool(aTool, sHardHammerList);
- }
-
- /**
- * Register a Wire Cutter to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerWireCutter(ItemStack aTool) {
- return registerTool(aTool, sWireCutterList);
- }
-
- /**
- * Register a Soldering Tool to interact with Machines
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerSolderingTool(ItemStack aTool) {
- return registerTool(aTool, sSolderingToolList);
- }
-
- /**
- * Register a Soldering Tin to interact with Soldering Tools
- * <p/>
- * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
- */
- public static boolean registerSolderingMetal(ItemStack aTool) {
- return registerTool(aTool, sSolderingMetalList);
- }
-
- /**
- * Generic Function to add Tools to the Lists.
- * Contains all sanity Checks for Tools, like preventing one Tool from being registered for multiple purposes as controls would override each other.
- */
- public static boolean registerTool(ItemStack aTool, Collection<GT_ItemStack> aToolList) {
- if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) || (!aTool.getItem().isDamageable() && !GT_ModHandler.isElectricItem(aTool) && !(aTool.getItem() instanceof IDamagableItem)))
- return false;
- aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
- sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
- return true;
- }
-}
+package gregtech.api;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.internal.IGT_RecipeAdder;
+import gregtech.api.interfaces.internal.IThaumcraftCompat;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.items.GT_CoolantCellIC_Item;
+import gregtech.api.items.GT_CoolantCell_Item;
+import gregtech.api.items.GT_Tool_Item;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.objects.GT_Cover_Default;
+import gregtech.api.objects.GT_Cover_None;
+import gregtech.api.objects.GT_HashSet;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.threads.GT_Runnable_MachineBlockUpdate;
+import gregtech.api.util.*;
+import gregtech.api.world.GT_Worldgen;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.Fluid;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static gregtech.api.enums.GT_Values.*;
+
+/**
+ * Please do not include this File in your Mod-download as it ruins compatiblity, like with the IC2-API
+ * You may just copy those Functions into your Code, or better call them via reflection.
+ * <p/>
+ * The whole API is the basic construct of my Mod. Everything is dependent on it.
+ * I change things quite often so please don't include any File inside your Mod, even if it is an Interface.
+ * Since some Authors were stupid enough to break this simple Rule, I added Version checks to enforce it.
+ * <p/>
+ * In these Folders are many useful Functions. You can use them via reflection if you want.
+ * I know not everything is compilable due to API's of other Mods, but these are easy to fix in your Setup.
+ * <p/>
+ * You can use this to learn about Modding, but I would recommend simpler Mods.
+ * You may even copypaste Code from these API-Files into your Mod, as I have nothing against that, but you should look exactly at what you are copying.
+ *
+ * @author Gregorius Techneticies
+ */
+@SuppressWarnings("ALL")
+public class GregTech_API {
+
+ @Deprecated
+ public static final long MATERIAL_UNIT = M, FLUID_MATERIAL_UNIT = L;
+ /**
+ * Fixes the HashMap Mappings for ItemStacks once the Server started
+ */
+ public static final Collection<Map<GT_ItemStack, ?>> sItemStackMappings = new ArrayList<>();
+ public static final Collection<Map<Fluid, ?>> sFluidMappings = new ArrayList<>();
+ /**
+ * The MetaTileEntity-ID-List-Length
+ */
+ public static final short MAXIMUM_METATILE_IDS = Short.MAX_VALUE - 1;
+ /**
+ * My Creative Tab
+ */
+ public static final CreativeTabs
+ TAB_GREGTECH = new GT_CreativeTab("Main", "Main"),
+ TAB_GREGTECH_MATERIALS = new GT_CreativeTab("Materials", "Materials"),
+ TAB_GREGTECH_ORES = new GT_CreativeTab("Ores", "Ores");
+ /**
+ * A List of all registered MetaTileEntities
+ * <p/>
+ * 0 - 749 are used by GregTech.
+ * 750 - 999 are reserved for Alkalus.
+ * 1000 - 2047 are used by GregTech.
+ * 2048 - 2559 are reserved for OvermindDL.
+ * 2560 - 3071 are reserved for Immibis.
+ * 3072 - 3583 are reserved for LinusPhoenix.
+ * 3584 - 4095 are reserved for BloodyAsp.
+ * 4096 - 5095 are used for GregTech Frames.
+ * 5096 - 6099 are used for GregTech Pipes.
+ * 6100 - 8191 are used for GregTech Decoration Blocks.
+ * 8192 - 8703 are reserved for ZL123.
+ * 8704 - 9215 are reserved for Mr10Movie.
+ * 9216 - 9727 are used for GregTech Automation Machines.
+ * 9728 - 10239 are reserved for 28Smiles.
+ * 10240 - 10751 are reserved for VirMan.
+ * 10752 - 11263 are reserved for Briareos81.
+ * 11264 - 12000 are reserved for the next one who asks me.
+ * 9728 - 32766 are currently free.
+ * <p/>
+ * Contact me if you need a free ID-Range, which doesn't conflict with other Addons.
+ * You could make an ID-Config, but we all know, what "stupid" customers think about conflicting ID's
+ */
+ public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[MAXIMUM_METATILE_IDS];
+ /**
+ * The Icon List for Covers
+ */
+ public static final Map<GT_ItemStack, ITexture> sCovers = new ConcurrentHashMap<>();
+ /**
+ * The List of Cover Behaviors for the Covers
+ */
+ public static final Map<GT_ItemStack, GT_CoverBehavior> sCoverBehaviors = new ConcurrentHashMap<>();
+ /**
+ * The List of Circuit Behaviors for the Redstone Circuit Block
+ */
+ public static final Map<Integer, GT_CircuitryBehavior> sCircuitryBehaviors = new ConcurrentHashMap<>();
+ /**
+ * The List of Blocks, which can conduct Machine Block Updates
+ */
+ public static final Map<Block, Integer> sMachineIDs = new ConcurrentHashMap<>();
+ /**
+ * The Redstone Frequencies
+ */
+ public static final Map<Integer, Byte> sWirelessRedstone = new ConcurrentHashMap<>();
+ /**
+ * The IDSU Frequencies
+ */
+ public static final Map<Integer, Integer> sIDSUList = new ConcurrentHashMap<>();
+ /**
+ * A List of all Books, which were created using @GT_Utility.getWrittenBook the original Title is the Key Value
+ */
+ public static final Map<String, ItemStack> sBookList = new ConcurrentHashMap<>();
+ /**
+ * The List of all Sounds used in GT, indices are in the static Block at the bottom
+ */
+ public static final Map<Integer, String> sSoundList = new ConcurrentHashMap<>();
+ /**
+ * The List of Tools, which can be used. Accepts regular damageable Items and Electric Items
+ */
+ public static final GT_HashSet<GT_ItemStack>
+ sToolList = new GT_HashSet<>(),
+ sCrowbarList = new GT_HashSet<>(),
+ sScrewdriverList = new GT_HashSet<>(),
+ sWrenchList = new GT_HashSet<>(),
+ sSoftHammerList = new GT_HashSet<>(),
+ sHardHammerList = new GT_HashSet<>(),
+ sWireCutterList = new GT_HashSet<>(),
+ sSolderingToolList = new GT_HashSet<>(),
+ sSolderingMetalList = new GT_HashSet<>();
+ /**
+ * The List of Hazmat Armors
+ */
+ public static final GT_HashSet<GT_ItemStack>
+ sGasHazmatList = new GT_HashSet<>(),
+ sBioHazmatList = new GT_HashSet<>(),
+ sFrostHazmatList = new GT_HashSet<>(),
+ sHeatHazmatList = new GT_HashSet<>(),
+ sRadioHazmatList = new GT_HashSet<>(),
+ sElectroHazmatList = new GT_HashSet<>();
+ /**
+ * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets.
+ * Mystcraft Dimensions and other Dimensional Things should be allowed.
+ * Mystcraft and Twilight Forest are automatically considered a Dimension, without being in this List.
+ */
+ public static final Collection<Integer> sDimensionalList = new HashSet<>();
+ /**
+ * Lists of all the active World generation Features, these are getting Initialized in Postload!
+ */
+ public static final List<GT_Worldgen> sWorldgenList = new ArrayList<>();
+ /**
+ * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
+ */
+ public static final Materials[] sGeneratedMaterials = new Materials[1000];
+ /**
+ * This is the generic Cover behavior. Used for the default Covers, which have no Behavior.
+ */
+ public static final GT_CoverBehavior
+ sDefaultBehavior = new GT_Cover_Default(),
+ sNoBehavior = new GT_Cover_None();
+ /**
+ * For the API Version check
+ */
+ public static volatile int VERSION = 509;
+
+ @Deprecated
+ public static IGT_RecipeAdder sRecipeAdder;
+ /**
+ * Used to register Aspects to ThaumCraft, this Object might be null if ThaumCraft isn't installed
+ */
+ public static IThaumcraftCompat sThaumcraftCompat;
+ /**
+ * These Lists are getting executed at their respective timings. Useful if you have to do things right before/after I do them, without having to control the load order. Add your "Commands" in the Constructor or in a static Code Block of your Mods Main Class. These are not Threaded, I just use a native Java Interface for their execution. Implement just the Method run() and everything should work
+ */
+ public static List<Runnable>
+ sBeforeGTPreload = new ArrayList<>(),
+ sAfterGTPreload = new ArrayList<>(),
+ sBeforeGTLoad = new ArrayList<>(),
+ sAfterGTLoad = new ArrayList<>(),
+ sBeforeGTPostload = new ArrayList<>(),
+ sAfterGTPostload = new ArrayList<>(),
+ sBeforeGTServerstart = new ArrayList<>(),
+ sAfterGTServerstart = new ArrayList<>(),
+ sBeforeGTServerstop = new ArrayList<>(),
+ sAfterGTServerstop = new ArrayList<>(),
+ sGTBlockIconload = new ArrayList<>(),
+ sGTItemIconload = new ArrayList<>();
+ /**
+ * The Icon Registers from Blocks and Items. They will get set right before the corresponding Icon Load Phase as executed in the Runnable List above.
+ */
+ @SideOnly(Side.CLIENT)
+ public static IIconRegister
+ sBlockIcons,
+ sItemIcons;
+ /**
+ * The Configuration Objects
+ */
+ public static GT_Config
+ sRecipeFile = null,
+ sMachineFile = null,
+ sWorldgenFile = null,
+ sModularArmor = null,
+ sMaterialProperties = null,
+ sMaterialComponents = null,
+ sUnification = null,
+ sSpecialFile = null,
+ sClientDataFile,
+ sOPStuff = null;
+ public static int
+ TICKS_FOR_LAG_AVERAGING = 25,
+ MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = 100;
+ /**
+ * Initialized by the Block creation.
+ */
+ public static Block sBlockMachines;
+
+ public static Block
+ sBlockOres1,
+ sBlockOresUb1,
+ sBlockOresUb2,
+ sBlockOresUb3,
+ /*sBlockGem,*/
+ sBlockMetal1,
+ sBlockMetal2,
+ sBlockMetal3,
+ sBlockMetal4,
+ sBlockMetal5,
+ sBlockMetal6,
+ sBlockMetal7,
+ sBlockMetal8,
+ sBlockGem1,
+ sBlockGem2,
+ sBlockGem3,
+ sBlockReinforced;
+ public static Block
+ sBlockGranites,
+ sBlockConcretes,
+ sBlockStones;
+ public static Block
+ sBlockCasings1,
+ sBlockCasings2,
+ sBlockCasings3,
+ sBlockCasings4,
+ sBlockCasings5,
+ sBlockCasings6,
+ sBlockCasings8;
+ /**
+ * Getting assigned by the Config
+ */
+ public static boolean
+ sTimber = true,
+ sDrinksAlwaysDrinkable = false,
+ sMultiThreadedSounds = false,
+ sDoShowAllItemsInCreative = false,
+ sColoredGUI = true,
+ sConstantEnergy = true,
+ sMachineExplosions = true,
+ sMachineFlammable = true,
+ sMachineNonWrenchExplosions = true,
+ sMachineRainExplosions = true,
+ sMachineThunderExplosions = true,
+ sMachineFireExplosions = true,
+ sMachineWireFire = true,
+ mOutputRF = false,
+ mInputRF = false,
+ meIOLoaded = false,
+ mRFExplosions = true,
+ mServerStarted = false,
+ mIC2Classic = false,
+ mMagneticraft = false,
+ mImmersiveEngineering = false,
+ mGTPlusPlus = false,
+ mTranslocator = false,
+ mTConstruct = false,
+ mGalacticraft = false;
+ public static int
+ mEUtoRF = 360,
+ mRFtoEU = 20;
+
+
+ /**
+ * Option to not use MACHINE_METAL mixing into colors
+ */
+ public static boolean sUseMachineMetal = false;
+
+
+ public static boolean mUseOnlyGoodSolderingMaterials = false;
+
+ private static final String aTextIC2Lower = MOD_ID_IC2.toLowerCase(Locale.ENGLISH);
+ /**
+ * Getting assigned by the Mod loading
+ */
+ public static boolean
+ sUnificationEntriesRegistered = false,
+ sPreloadStarted = false,
+ sPreloadFinished = false,
+ sLoadStarted = false,
+ sLoadFinished = false,
+ sPostloadStarted = false,
+ sPostloadFinished = false;
+ private static Class sBaseMetaTileEntityClass = null;
+
+ /**
+ * Adds Biomes to the Biome Lists for World Generation
+ */
+ static {
+ sItemStackMappings.add(sCovers);
+ sItemStackMappings.add(sCoverBehaviors);
+
+ //sDimensionalList.add(56);
+ //sDimensionalList.add(55);
+
+ sSoundList.put(0, "random.break");
+ sSoundList.put(1, "random.anvil_use");
+ sSoundList.put(2, "random.anvil_break");
+ sSoundList.put(3, "random.click");
+ sSoundList.put(4, "random.fizz");
+ sSoundList.put(5, "random.explode");
+ sSoundList.put(6, "fire.ignite");
+
+ sSoundList.put(100, aTextIC2Lower + ":" + "tools.Wrench");
+ sSoundList.put(101, aTextIC2Lower + ":" + "tools.RubberTrampoline");
+ sSoundList.put(102, aTextIC2Lower + ":" + "tools.Painter");
+ sSoundList.put(103, aTextIC2Lower + ":" + "tools.BatteryUse");
+ sSoundList.put(104, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseOne");
+ sSoundList.put(105, aTextIC2Lower + ":" + "tools.chainsaw.ChainsawUseTwo");
+ sSoundList.put(106, aTextIC2Lower + ":" + "tools.drill.DrillSoft");
+ sSoundList.put(107, aTextIC2Lower + ":" + "tools.drill.DrillHard");
+ sSoundList.put(108, aTextIC2Lower + ":" + "tools.ODScanner");
+
+ sSoundList.put(200, aTextIC2Lower + ":" + "machines.ExtractorOp");
+ sSoundList.put(201, aTextIC2Lower + ":" + "machines.MaceratorOp");
+ sSoundList.put(202, aTextIC2Lower + ":" + "machines.InductionLoop");
+ sSoundList.put(203, aTextIC2Lower + ":" + "machines.CompressorOp");
+ sSoundList.put(204, aTextIC2Lower + ":" + "machines.RecyclerOp");
+ sSoundList.put(205, aTextIC2Lower + ":" + "machines.MinerOp");
+ sSoundList.put(206, aTextIC2Lower + ":" + "machines.PumpOp");
+ sSoundList.put(207, aTextIC2Lower + ":" + "machines.ElectroFurnaceLoop");
+ sSoundList.put(208, aTextIC2Lower + ":" + "machines.InductionLoop");
+ sSoundList.put(209, aTextIC2Lower + ":" + "machines.MachineOverload");
+ sSoundList.put(210, aTextIC2Lower + ":" + "machines.InterruptOne");
+ sSoundList.put(211, aTextIC2Lower + ":" + "machines.KaChing");
+ sSoundList.put(212, aTextIC2Lower + ":" + "machines.MagnetizerLoop");
+ }
+
+ /**
+ * You want OreDict-Unification for YOUR Mod/Addon, when GregTech is installed? This Function is especially for YOU.
+ * Call this Function after the load-Phase, as I register the the most of the Unification at that Phase (Redpowers Storageblocks are registered at postload).
+ * A recommended use of this Function is inside your Recipe-System itself (if you have one), as the unification then makes 100% sure, that every added non-unificated Output gets automatically unificated.
+ * <p/>
+ * I will personally make sure, that only common prefixes of Ores get registered at the Unificator, as of now there are:
+ * pulp, dust, dustSmall, ingot, nugget, gem, ore and block
+ * If another Mod-Author messes these up, then it's not my fault and it's especially not your fault. As these are commonly used prefixes.
+ * <p/>
+ * This Unificator-API-Function uses the same Functions I use, for unificating Items. So if there is something messed up (very unlikely), then everything is messed up.
+ * <p/>
+ * You shouldn't use this to unificate the Inputs of your Recipes, this is only meant for the Outputs.
+ *
+ * @param aOreStack the Stack you want to get unificated. It is stackSize Sensitive.
+ * @return Either an unificated Stack or the stack you toss in, but it should never be null, unless you throw a Nullpointer into it.
+ */
+ public static ItemStack getUnificatedOreDictStack(ItemStack aOreStack) {
+ if (!GregTech_API.sPreloadFinished)
+ GT_Log.err.println("GregTech_API ERROR: " + aOreStack.getItem() + "." + aOreStack.getItemDamage() + " - OreDict Unification Entries are not registered now, please call it in the postload phase.");
+ return GT_OreDictUnificator.get(true, aOreStack);
+ }
+
+ /**
+ * Causes a Machineblock Update
+ * This update will cause surrounding MultiBlock Machines to update their Configuration.
+ * You should call this Function in @Block.breakBlock and in @Block.onBlockAdded of your Machine.
+ *
+ * @param aWorld is being the World
+ * @param aX is the X-Coord of the update causing Block
+ * @param aY is the Y-Coord of the update causing Block
+ * @param aZ is the Z-Coord of the update causing Block
+ */
+ public static boolean causeMachineUpdate(World aWorld, int aX, int aY, int aZ) {
+ if (!aWorld.isRemote)
+ new Thread(new GT_Runnable_MachineBlockUpdate(aWorld, aX, aY, aZ), "Machine Block Updating").start();
+ return true;
+ }
+
+ /**
+ * Adds a Multi-Machine Block, like my Machine Casings for example.
+ * You should call @causeMachineUpdate in @Block.breakBlock and in @Block.onBlockAdded of your registered Block.
+ * You don't need to register TileEntities which implement @IMachineBlockUpdateable
+ *
+ * @param aBlock the Block
+ * @param aMeta the Metadata of the Blocks as Bitmask! -1 or ~0 for all Metavalues
+ */
+ public static boolean registerMachineBlock(Block aBlock, int aMeta) {
+ if (GT_Utility.isBlockInvalid(aBlock))
+ return false;
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
+ sMachineIDs.put(aBlock, aMeta);
+ return true;
+ }
+
+ /**
+ * Like above but with boolean Parameters instead of a BitMask
+ */
+ public static boolean registerMachineBlock(Block aBlock, boolean... aMeta) {
+ if (GT_Utility.isBlockInvalid(aBlock) || aMeta == null || aMeta.length == 0)
+ return false;
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerPortholeBlacklistedBlock(aBlock);
+ int rMeta = 0;
+ for (byte i = 0; i < aMeta.length && i < 16; i++) if (aMeta[i]) rMeta |= B[i];
+ sMachineIDs.put(aBlock, rMeta);
+ return true;
+ }
+
+ /**
+ * if this Block is a Machine Update Conducting Block
+ */
+ public static boolean isMachineBlock(Block aBlock, int aMeta) {
+ if (GT_Utility.isBlockInvalid(aBlock))
+ return false;
+ return (sMachineIDs.containsKey(aBlock) && (sMachineIDs.get(aBlock) & B[aMeta]) != 0);
+ }
+
+ /**
+ * Creates a new Coolant Cell Item for your Nuclear Reactor
+ */
+ public static Item constructCoolantCellItem(String aUnlocalized, String aEnglish, int aMaxStore) {
+ try {
+ return new GT_CoolantCellIC_Item(aUnlocalized, aEnglish, aMaxStore);
+// return (Item)Class.forName("gregtech.api.items.GT_CoolantCellIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return new GT_CoolantCell_Item(aUnlocalized, aEnglish, aMaxStore);
+// return (Item)Class.forName("gregtech.api.items.GT_CoolantCell_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxStore);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
+ }
+
+ /**
+ * Creates a new Energy Armor Item
+ */
+ public static Item constructElectricArmorItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aDamageEnergyCost, int aSpecials, double aArmorAbsorbtionPercentage, boolean aChargeProvider, int aType, int aArmorIndex) {
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmorIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyArmor_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aDamageEnergyCost, aSpecials, aArmorAbsorbtionPercentage, aChargeProvider, aType, aArmorIndex);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
+ }
+
+ /**
+ * Creates a new Energy Battery Item
+ */
+ public static Item constructElectricEnergyStorageItem(String aUnlocalized, String aEnglish, int aCharge, int aTransfer, int aTier, int aEmptyID, int aFullID) {
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStoreIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return (Item) Class.forName("gregtechmod.api.items.GT_EnergyStore_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aCharge, aTransfer, aTier, aEmptyID, aFullID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Generic_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", false);
+ }
+
+ /**
+ * Creates a new Hard Hammer Item
+ */
+ public static GT_Tool_Item constructHardHammerItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_HardHammer_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new Crowbar Item
+ */
+ public static GT_Tool_Item constructCrowbarItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_CrowbarRC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
+ } catch (Throwable e) {/*Do nothing*/}
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Crowbar_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new Wrench Item
+ */
+ public static GT_Tool_Item constructWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_Wrench_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Screwdriver Item
+ */
+ public static GT_Tool_Item constructElectricScrewdriverItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_ScrewdriverIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Wrench Item
+ */
+ public static GT_Tool_Item constructElectricWrenchItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_WrenchIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Saw Item
+ */
+ public static GT_Tool_Item constructElectricSawItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SawIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Drill Item
+ */
+ public static GT_Tool_Item constructElectricDrillItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aToolQuality, float aToolStrength, int aEnergyConsumptionPerBlockBreak, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_DrillIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aToolQuality, aToolStrength, aEnergyConsumptionPerBlockBreak, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new electric Soldering Tool
+ */
+ public static GT_Tool_Item constructElectricSolderingToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aEntityDamage, int aDisChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_SolderingToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aEntityDamage, aDisChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, aEntityDamage, false);
+ }
+
+ /**
+ * Creates a new empty electric Tool
+ */
+ public static GT_Tool_Item constructEmptyElectricToolItem(String aUnlocalized, String aEnglish, int aMaxDamage, int aChargedGTID) {
+ try {
+ return (GT_Tool_Item) Class.forName("gregtechmod.api.items.GT_EmptyToolIC_Item").getConstructors()[0].newInstance(aUnlocalized, aEnglish, aMaxDamage, aChargedGTID);
+ } catch (Throwable e) {/*Do nothing*/}
+ return new gregtech.api.items.GT_Tool_Item(aUnlocalized, aEnglish, "Doesn't work as intended, this is a Bug", aMaxDamage, 0, false);
+ }
+
+ /**
+ * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity
+ */
+ public static BaseMetaTileEntity constructBaseMetaTileEntity() {
+ if (sBaseMetaTileEntityClass == null) {
+ try {
+ return (BaseMetaTileEntity) (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
+ } catch (Throwable e) {/*Do nothing*/}
+ }
+
+ try {
+ return (BaseMetaTileEntity) (sBaseMetaTileEntityClass.newInstance());
+ } catch (Throwable e) {
+ GT_Log.err.println("GT_Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ e.printStackTrace(GT_Log.err);
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) {
+ if (!sCovers.containsKey(new GT_ItemStack(aStack)))
+ sCovers.put(new GT_ItemStack(aStack), aCover == null || !aCover.isValidTexture() ? Textures.BlockIcons.ERROR_RENDERING[0] : aCover);
+ if (aBehavior != null)
+ sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior);
+ }
+
+ public static void registerCoverBehavior(ItemStack aStack, GT_CoverBehavior aBehavior) {
+ sCoverBehaviors.put(new GT_ItemStack(aStack), aBehavior == null ? sDefaultBehavior : aBehavior);
+ }
+
+ /**
+ * Registers multiple Cover Items. I use that for the OreDict Functionality.
+ *
+ * @param aBehavior can be null
+ */
+ public static void registerCover(Collection<ItemStack> aStackList, ITexture aCover, GT_CoverBehavior aBehavior) {
+ if (aCover.isValidTexture())
+ aStackList.forEach(tStack -> GregTech_API.registerCover(tStack, aCover, aBehavior));
+ }
+
+ /**
+ * returns a Cover behavior, guaranteed to not return null after preload
+ */
+ public static GT_CoverBehavior getCoverBehavior(ItemStack aStack) {
+ if (aStack == null || aStack.getItem() == null)
+ return sNoBehavior;
+ GT_CoverBehavior rCover = sCoverBehaviors.get(new GT_ItemStack(aStack));
+ if (rCover == null)
+ return sDefaultBehavior;
+ return rCover;
+ }
+
+ /**
+ * returns a Cover behavior, guaranteed to not return null
+ */
+ public static GT_CoverBehavior getCoverBehavior(int aStack) {
+ if (aStack == 0)
+ return sNoBehavior;
+ return getCoverBehavior(GT_Utility.intToStack(aStack));
+ }
+
+ /**
+ * Register a Wrench to be usable on GregTech Machines.
+ * The Wrench MUST have some kind of Durability unlike certain Buildcraft Wrenches.
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ * <p/>
+ * -----
+ * <p/>
+ * Returning true at isDamagable was a great Idea, KingLemming. Well played.
+ * Since the OmniWrench is just a Single-Item-Mod, people can choose if they want your infinite durability or not. So that's not really a Problem.
+ * I even have a new Config to autodisable most infinite BC Wrenches (but that one is turned off).
+ * <p/>
+ * One last Bug for you to fix:
+ * My Autoregistration detects Railcrafts Crowbars, Buildcrafts Wrenches and alike, due to their Interfaces.
+ * Guess what now became a Crowbar by accident. Try registering the Wrench at the load phase to prevent things like that from happening.
+ * Yes, I know that "You need to register Tools in the Load Phase"-Part wasn't there before this. Sorry about that.
+ */
+ public static boolean registerWrench(ItemStack aTool) {
+ return registerTool(aTool, sWrenchList);
+ }
+
+ /**
+ * Register a Crowbar to extract Covers from Machines
+ * Crowbars are NOT Wrenches btw.
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerCrowbar(ItemStack aTool) {
+ return registerTool(aTool, sCrowbarList);
+ }
+
+ /**
+ * Register a Screwdriver to interact directly with Machines and Covers
+ * Did I mention, that it is intentionally not possible to make a Multitool, which doesn't switch ItemID (like a Mode) all the time?
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerScrewdriver(ItemStack aTool) {
+ return registerTool(aTool, sScrewdriverList);
+ }
+
+ /**
+ * Register a Soft Hammer to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerSoftHammer(ItemStack aTool) {
+ return registerTool(aTool, sSoftHammerList);
+ }
+
+ /**
+ * Register a Hard Hammer to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerHardHammer(ItemStack aTool) {
+ return registerTool(aTool, sHardHammerList);
+ }
+
+ /**
+ * Register a Wire Cutter to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerWireCutter(ItemStack aTool) {
+ return registerTool(aTool, sWireCutterList);
+ }
+
+ /**
+ * Register a Soldering Tool to interact with Machines
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerSolderingTool(ItemStack aTool) {
+ return registerTool(aTool, sSolderingToolList);
+ }
+
+ /**
+ * Register a Soldering Tin to interact with Soldering Tools
+ * <p/>
+ * You need to register Tools in the Load Phase, because otherwise the Autodetection will assign a Tool Type in certain Cases during postload (When IToolWrench or similar Interfaces are implemented).
+ */
+ public static boolean registerSolderingMetal(ItemStack aTool) {
+ return registerTool(aTool, sSolderingMetalList);
+ }
+
+ /**
+ * Generic Function to add Tools to the Lists.
+ * Contains all sanity Checks for Tools, like preventing one Tool from being registered for multiple purposes as controls would override each other.
+ */
+ public static boolean registerTool(ItemStack aTool, Collection<GT_ItemStack> aToolList) {
+ if (aTool == null || GT_Utility.isStackInList(aTool, sToolList) || (!aTool.getItem().isDamageable() && !GT_ModHandler.isElectricItem(aTool) && !(aTool.getItem() instanceof IDamagableItem)))
+ return false;
+ aToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
+ sToolList.add(new GT_ItemStack(GT_Utility.copyAmount(1, aTool)));
+ return true;
+ }
+}
diff --git a/src/main/java/gregtech/api/enums/MaterialBuilder.java b/src/main/java/gregtech/api/enums/MaterialBuilder.java
index 54c95f65d8..7df2e4bc39 100644
--- a/src/main/java/gregtech/api/enums/MaterialBuilder.java
+++ b/src/main/java/gregtech/api/enums/MaterialBuilder.java
@@ -1,261 +1,261 @@
-package gregtech.api.enums;
-
-import gregtech.api.objects.MaterialStack;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class MaterialBuilder {
- public static final int
- DIESEL = 0,
- GAS = 1,
- THERMAL = 2,
- SEMIFLUID = 3,
- PLASMA = 4,
- MAGIC = 5;
-
- private int metaItemSubID;
- private TextureSet iconSet;
- private float toolSpeed = 1.0f;
- private int durability = 0;
- private int toolQuality = 0;
- private int types = 0;
- private int r = 255, g = 255, b = 255, a = 0;
- private String name;
- private String defaultLocalName;
- private int fuelType = 0;
- private int fuelPower = 0;
- private int meltingPoint = 0;
- private int blastFurnaceTemp = 0;
- private boolean blastFurnaceRequired = false;
- private boolean transparent = false;
- private int oreValue = 1;
- private int densityMultiplier = 1;
- private int densityDivider = 1;
- private Dyes color = Dyes._NULL;
- private int extraData = 0;
- private List<MaterialStack> materialList = new ArrayList<>();
- private List<TC_Aspects.TC_AspectStack> aspects = new ArrayList<>();
- private boolean hasCorrespondingFluid = false;
- private boolean hasCorrespondingGas = false;
- private boolean canBeCracked = false;
- private boolean canBeSteamCracked = false;
- private int liquidTemperature = 300;
- private int gasTemperature = 300;
-
- public MaterialBuilder(int metaItemSubID, TextureSet iconSet, String defaultLocalName) {
- this.metaItemSubID = metaItemSubID;
- this.iconSet = iconSet;
- this.name = defaultLocalName.replace(" ", "").replace("-", "");
- this.defaultLocalName = defaultLocalName;
- }
-
- public Materials constructMaterial() {
- return new Materials(metaItemSubID, iconSet, toolSpeed, durability, toolQuality, types, r, g, b, a, name, defaultLocalName, fuelType, fuelPower, meltingPoint, blastFurnaceTemp,
- blastFurnaceRequired, transparent, oreValue, densityMultiplier, densityDivider, color, extraData, materialList, aspects)
- .setHasCorrespondingFluid(hasCorrespondingFluid)
- .setHasCorrespondingGas(hasCorrespondingGas)
- .setCanBeCracked(canBeCracked);
- }
-
- public MaterialBuilder setName(String name){
- this.name = name;
- return this;
- }
-
- public MaterialBuilder setTypes(int types){
- this.types = types;
- return this;
- }
-
- public MaterialBuilder addDustItems(){
- types = types | 1;
- return this;
- }
-
- public MaterialBuilder addMetalItems(){
- types = types | 2;
- return this;
- }
-
- public MaterialBuilder addGemItems(){
- types = types | 4;
- return this;
- }
-
- public MaterialBuilder addOreItems(){
- types = types | 8;
- return this;
- }
-
- public MaterialBuilder addCell(){
- types = types | 16;
- return this;
- }
-
- public MaterialBuilder addPlasma(){
- types = types | 32;
- return this;
- }
-
- public MaterialBuilder addToolHeadItems(){
- types = types | 64;
- return this;
- }
-
- public MaterialBuilder addGearItems(){
- types = types | 128;
- return this;
- }
-
- public MaterialBuilder addFluid(){
- this.hasCorrespondingFluid = true;
- return this;
- }
-
- public MaterialBuilder addGas(){
- this.hasCorrespondingGas = true;
- return this;
- }
-
- public MaterialBuilder setRGBA(int r, int g, int b, int a){
- this.r = r;
- this.g = g;
- this.b = b;
- this.a = a;
- return this;
- }
-
- public MaterialBuilder setRGB(int r, int g, int b){
- this.r = r;
- this.g = g;
- this.b = b;
- return this;
- }
-
- public MaterialBuilder setTransparent(boolean transparent){
- this.transparent = transparent;
- return this;
- }
-
- public MaterialBuilder setColor(Dyes color){
- this.color = color;
- return this;
- }
-
-
- public MaterialBuilder setToolSpeed(float toolSpeed) {
- this.toolSpeed = toolSpeed;
- return this;
- }
-
- public MaterialBuilder setDurability(int durability) {
- this.durability = durability;
- return this;
- }
-
- public MaterialBuilder setToolQuality(int toolQuality) {
- this.toolQuality = toolQuality;
- return this;
- }
-
-
- public MaterialBuilder setFuelType(int fuelType) {
- this.fuelType = fuelType;
- return this;
- }
-
- public MaterialBuilder setFuelPower(int fuelPower) {
- this.fuelPower = fuelPower;
- return this;
- }
-
- public MaterialBuilder setMeltingPoint(int meltingPoint) {
- this.meltingPoint = meltingPoint;
- return this;
- }
-
- public MaterialBuilder setBlastFurnaceTemp(int blastFurnaceTemp) {
- this.blastFurnaceTemp = blastFurnaceTemp;
- return this;
- }
-
- public MaterialBuilder setBlastFurnaceRequired(boolean blastFurnaceRequired) {
- this.blastFurnaceRequired = blastFurnaceRequired;
- return this;
- }
-
- public MaterialBuilder setOreValue(int oreValue) {
- this.oreValue = oreValue;
- return this;
- }
-
- public MaterialBuilder setDensityMultiplier(int densityMultiplier) {
- this.densityMultiplier = densityMultiplier;
- return this;
- }
-
- public MaterialBuilder setDensityDivider(int densityDivider) {
- this.densityDivider = densityDivider;
- return this;
- }
-
- public MaterialBuilder setExtraData(int extraData) {
- this.extraData = extraData;
- return this;
- }
-
- public MaterialBuilder addElectrolyzerRecipe(){
- extraData = extraData | 1;
- return this;
- }
-
- public MaterialBuilder addCentrifugeRecipe(){
- extraData = extraData | 2;
- return this;
- }
-
- public MaterialBuilder setMaterialList(List<MaterialStack> materialList) {
- this.materialList = materialList;
- return this;
- }
-
- public MaterialBuilder setMaterialList(MaterialStack ... materials) {
- this.materialList = Arrays.asList(materials);
- return this;
- }
-
- public MaterialBuilder setAspects(List<TC_Aspects.TC_AspectStack> aspects) {
- this.aspects = aspects;
- return this;
- }
-
- public int getLiquidTemperature() {
- return liquidTemperature;
- }
-
- public MaterialBuilder setLiquidTemperature(int liquidTemperature) {
- this.liquidTemperature = liquidTemperature;
- return this;
- }
-
- public int getGasTemperature() {
- return gasTemperature;
- }
-
- public MaterialBuilder setGasTemperature(int gasTemperature) {
- this.gasTemperature = gasTemperature;
- return this;
- }
-
- public boolean canBeCracked() {
- return canBeCracked;
- }
-
- public MaterialBuilder setCanBeCracked(boolean canBeCracked) {
- this.canBeCracked = canBeCracked;
- return this;
- }
-
+package gregtech.api.enums;
+
+import gregtech.api.objects.MaterialStack;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class MaterialBuilder {
+ public static final int
+ DIESEL = 0,
+ GAS = 1,
+ THERMAL = 2,
+ SEMIFLUID = 3,
+ PLASMA = 4,
+ MAGIC = 5;
+
+ private int metaItemSubID;
+ private TextureSet iconSet;
+ private float toolSpeed = 1.0f;
+ private int durability = 0;
+ private int toolQuality = 0;
+ private int types = 0;
+ private int r = 255, g = 255, b = 255, a = 0;
+ private String name;
+ private String defaultLocalName;
+ private int fuelType = 0;
+ private int fuelPower = 0;
+ private int meltingPoint = 0;
+ private int blastFurnaceTemp = 0;
+ private boolean blastFurnaceRequired = false;
+ private boolean transparent = false;
+ private int oreValue = 1;
+ private int densityMultiplier = 1;
+ private int densityDivider = 1;
+ private Dyes color = Dyes._NULL;
+ private int extraData = 0;
+ private List<MaterialStack> materialList = new ArrayList<>();
+ private List<TC_Aspects.TC_AspectStack> aspects = new ArrayList<>();
+ private boolean hasCorrespondingFluid = false;
+ private boolean hasCorrespondingGas = false;
+ private boolean canBeCracked = false;
+ private boolean canBeSteamCracked = false;
+ private int liquidTemperature = 300;
+ private int gasTemperature = 300;
+
+ public MaterialBuilder(int metaItemSubID, TextureSet iconSet, String defaultLocalName) {
+ this.metaItemSubID = metaItemSubID;
+ this.iconSet = iconSet;
+ this.name = defaultLocalName.replace(" ", "").replace("-", "");
+ this.defaultLocalName = defaultLocalName;
+ }
+
+ public Materials constructMaterial() {
+ return new Materials(metaItemSubID, iconSet, toolSpeed, durability, toolQuality, types, r, g, b, a, name, defaultLocalName, fuelType, fuelPower, meltingPoint, blastFurnaceTemp,
+ blastFurnaceRequired, transparent, oreValue, densityMultiplier, densityDivider, color, extraData, materialList, aspects)
+ .setHasCorrespondingFluid(hasCorrespondingFluid)
+ .setHasCorrespondingGas(hasCorrespondingGas)
+ .setCanBeCracked(canBeCracked);
+ }
+
+ public MaterialBuilder setName(String name){
+ this.name = name;
+ return this;
+ }
+
+ public MaterialBuilder setTypes(int types){
+ this.types = types;
+ return this;
+ }
+
+ public MaterialBuilder addDustItems(){
+ types = types | 1;
+ return this;
+ }
+
+ public MaterialBuilder addMetalItems(){
+ types = types | 2;
+ return this;
+ }
+
+ public MaterialBuilder addGemItems(){
+ types = types | 4;
+ return this;
+ }
+
+ public MaterialBuilder addOreItems(){
+ types = types | 8;
+ return this;
+ }
+
+ public MaterialBuilder addCell(){
+ types = types | 16;
+ return this;
+ }
+
+ public MaterialBuilder addPlasma(){
+ types = types | 32;
+ return this;
+ }
+
+ public MaterialBuilder addToolHeadItems(){
+ types = types | 64;
+ return this;
+ }
+
+ public MaterialBuilder addGearItems(){
+ types = types | 128;
+ return this;
+ }
+
+ public MaterialBuilder addFluid(){
+ this.hasCorrespondingFluid = true;
+ return this;
+ }
+
+ public MaterialBuilder addGas(){
+ this.hasCorrespondingGas = true;
+ return this;
+ }
+
+ public MaterialBuilder setRGBA(int r, int g, int b, int a){
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ this.a = a;
+ return this;
+ }
+
+ public MaterialBuilder setRGB(int r, int g, int b){
+ this.r = r;
+ this.g = g;
+ this.b = b;
+ return this;
+ }
+
+ public MaterialBuilder setTransparent(boolean transparent){
+ this.transparent = transparent;
+ return this;
+ }
+
+ public MaterialBuilder setColor(Dyes color){
+ this.color = color;
+ return this;
+ }
+
+
+ public MaterialBuilder setToolSpeed(float toolSpeed) {
+ this.toolSpeed = toolSpeed;
+ return this;
+ }
+
+ public MaterialBuilder setDurability(int durability) {
+ this.durability = durability;
+ return this;
+ }
+
+ public MaterialBuilder setToolQuality(int toolQuality) {
+ this.toolQuality = toolQuality;
+ return this;
+ }
+
+
+ public MaterialBuilder setFuelType(int fuelType) {
+ this.fuelType = fuelType;
+ return this;
+ }
+
+ public MaterialBuilder setFuelPower(int fuelPower) {
+ this.fuelPower = fuelPower;
+ return this;
+ }
+
+ public MaterialBuilder setMeltingPoint(int meltingPoint) {
+ this.meltingPoint = meltingPoint;
+ return this;
+ }
+
+ public MaterialBuilder setBlastFurnaceTemp(int blastFurnaceTemp) {
+ this.blastFurnaceTemp = blastFurnaceTemp;
+ return this;
+ }
+
+ public MaterialBuilder setBlastFurnaceRequired(boolean blastFurnaceRequired) {
+ this.blastFurnaceRequired = blastFurnaceRequired;
+ return this;
+ }
+
+ public MaterialBuilder setOreValue(int oreValue) {
+ this.oreValue = oreValue;
+ return this;
+ }
+
+ public MaterialBuilder setDensityMultiplier(int densityMultiplier) {
+ this.densityMultiplier = densityMultiplier;
+ return this;
+ }
+
+ public MaterialBuilder setDensityDivider(int densityDivider) {
+ this.densityDivider = densityDivider;
+ return this;
+ }
+
+ public MaterialBuilder setExtraData(int extraData) {
+ this.extraData = extraData;
+ return this;
+ }
+
+ public MaterialBuilder addElectrolyzerRecipe(){
+ extraData = extraData | 1;
+ return this;
+ }
+
+ public MaterialBuilder addCentrifugeRecipe(){
+ extraData = extraData | 2;
+ return this;
+ }
+
+ public MaterialBuilder setMaterialList(List<MaterialStack> materialList) {
+ this.materialList = materialList;
+ return this;
+ }
+
+ public MaterialBuilder setMaterialList(MaterialStack ... materials) {
+ this.materialList = Arrays.asList(materials);
+ return this;
+ }
+
+ public MaterialBuilder setAspects(List<TC_Aspects.TC_AspectStack> aspects) {
+ this.aspects = aspects;
+ return this;
+ }
+
+ public int getLiquidTemperature() {
+ return liquidTemperature;
+ }
+
+ public MaterialBuilder setLiquidTemperature(int liquidTemperature) {
+ this.liquidTemperature = liquidTemperature;
+ return this;
+ }
+
+ public int getGasTemperature() {
+ return gasTemperature;
+ }
+
+ public MaterialBuilder setGasTemperature(int gasTemperature) {
+ this.gasTemperature = gasTemperature;
+ return this;
+ }
+
+ public boolean canBeCracked() {
+ return canBeCracked;
+ }
+
+ public MaterialBuilder setCanBeCracked(boolean canBeCracked) {
+ this.canBeCracked = canBeCracked;
+ return this;
+ }
+
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java
index bf8f7b8c30..c3a85f46fb 100644
--- a/src/main/java/gregtech/api/enums/OrePrefixes.java
+++ b/src/main/java/gregtech/api/enums/OrePrefixes.java
@@ -1,1118 +1,1118 @@
-package gregtech.api.enums;
-
-import com.google.common.base.Objects;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.TC_Aspects.TC_AspectStack;
-import gregtech.api.interfaces.ICondition;
-import gregtech.api.interfaces.IMaterialHandler;
-import gregtech.api.interfaces.IOreRecipeRegistrator;
-import gregtech.api.interfaces.ISubTagContainer;
-import gregtech.api.objects.ItemData;
-import gregtech.api.objects.MaterialStack;
-import gregtech.api.objects.ObjMap;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Utility;
-import gregtech.loaders.materialprocessing.ProcessingModSupport;
-import net.minecraft.item.ItemStack;
-
-import java.util.*;
-
-import static gregtech.api.enums.GT_Values.*;
-
-public enum OrePrefixes {
- @Deprecated pulp("Pulps", "", "", false, false, false, false, false, false, false, false, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, -1),
- @Deprecated leaves("Leaves", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- @Deprecated sapling("Saplings", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- @Deprecated itemDust("Dusts", "", "", false, false, false, false, false, false, false, false, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, -1),
- oreBlackgranite("Black Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
- oreRedgranite("Red Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
- oreMarble("Marble Ores", "Marble ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
- oreBasalt("Basalt Ores", "Basalt ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
- oreNetherrack("Netherrack Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
- oreNether("Nether Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
- @Deprecated denseore("Dense Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, -1),
- oreDense("Dense Ores", "Dense ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Dense-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
- oreRich("Rich Ores", "Rich ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of TFC
- oreNormal("Normal Ores", "Normal ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of TFC
- oreSmall("Small Ores", "Small ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, 67), // Prefix of Railcraft.
- orePoor("Poor Ores", "Poor ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of Railcraft.
- oreEndstone("Endstone Ores", "End ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
- oreEnd("End Ores", "End ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
- @Deprecated oreGem("Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, -1),
- ore("Ores", "", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, 68), // Regular Ore Prefix. Ore -> Material is a Oneway Operation! Introduced by Eloraam
- crushedCentrifuged("Centrifuged Ores", "Centrifuged ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], -1, 64, 7),
- crushedPurified("Purified Ores", "Purified ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], -1, 64, 6),
- crushed("Crushed Ores", "Crushed ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], -1, 64, 5),
- shard("Crystallised Shards", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1), // Introduced by Mekanism
- clump("Clumps", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
- reduced("Reduced Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
- crystalline("Crystallised Metals", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
- cleanGravel("Clean Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
- dirtyGravel("Dirty Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
- ingotQuintuple("5x Ingots", "Quintuple ", " Ingot", true, true, false, false, false, false, true, true, false, false, B[1], M * 5, 12, 16), // A quintuple Ingot.
- ingotQuadruple("4x Ingots", "Quadruple ", " Ingot", true, true, false, false, false, false, true, true, false, false, B[1], M * 4, 16, 15), // A quadruple Ingot.
- @Deprecated ingotQuad("4x Ingots", "Quadruple ", " Ingot", false, false, false, false, false, false, false, false, false, false, B[1], -1, 16, 15),
- ingotTriple("3x Ingots", "Triple ", " Ingot", true, true, false, false, false, false, true, false, false, false, B[1], M * 3, 21, 14), // A triple Ingot.
- ingotDouble("2x Ingots", "Double ", " Ingot", true, true, false, false, false, false, true, true, false, false, B[1], M * 2, 32, 13), // A double Ingot. Introduced by TerraFirmaCraft
- ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer.
- ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam
- gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft
- gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft
- gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft
- gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft
- gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam
- @Deprecated dustDirty("Impure Dusts", "", "", false, false, false, false, false, false, false, false, false, true, B[3], -1, 64, 3),
- dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust.
- dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust.
- dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material
- dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 2),
- dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 4),
- dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka.
- nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, 9), // A Nugget. Introduced by Eloraam
- plateAlloy("Alloy Plates", "", "", true, false, false, false, false, false, false, false, false, false, B[1], -1, 64, 17), // Special Alloys have this prefix.
- plateSteamcraft("Steamcraft Plates", "", "", false, false, false, false, false, false, false, false, false, false, B[1], -1, 64, 17),
- plateDense("Dense Plates", "Dense ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 9, 8, 22), // 9 Plates combined in one Item.
- plateQuintuple("5x Plates", "Quintuple ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 5, 12, 21),
- plateQuadruple("4x Plates", "Quadruple ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 4, 16, 20),
- @Deprecated plateQuad("4x Plates", "", "", false, false, false, false, false, false, false, false, false, false, B[1], -1, 16, 20),
- plateTriple("3x Plates", "Triple ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 3, 21, 19),
- plateDouble("2x Plates", "Double ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 2, 32, 18),
- plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
- itemCasing("Casings", "", " Casing", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 10), // Casing made of 1/2 Ingot/Dust
- foil("Foils", "", " Foil", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 29), // Foil made of 1/4 Ingot/Dust.
- stickLong("Long Sticks/Rods", "Long ", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 54), // Stick made of an Ingot.
- stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam
- round("Rounds", "", " Round", true, true, false, false, false, false, true, true, false, false, B[1], M / 9, 64, 25), // consisting out of one Nugget.
- bolt("Bolts", "", " Bolt", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 8, 64, 26), // consisting out of 1/8 Ingot or 1/4 Stick.
- comb("Combs", "", " Comb", false, false, false, false, false, false, false, true, false, false, B[1] | B[2], M, 64, 101), // contain dusts
- screw("Screws", "", " Screw", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 9, 64, 27), // consisting out of a Bolt.
- ring("Rings", "", " Ring", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 28), // consisting out of 1/2 Stick.
- springSmall("Small Springs", "Small ", " Spring", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 55), // consisting out of 1 Fine Wire.
- spring("Springs", "", " Spring", true, true, false, false, false, false, true, true, false, false, B[1], M * 1, 64, 56), // consisting out of 2 Sticks.
- wireFine("Fine Wires", "Fine ", " Wire", true, true, false, false, false, false, true, true, false, false, B[1], M / 8, 64, 51), // consisting out of 1/8 Ingot or 1/4 Wire.
- rotor("Rotors", "", " Rotor", true, true, false, false, false, false, true, true, false, false, B[7], M * 4 + M / 4, 16, 53), // consisting out of 4 Plates, 1 Ring and 1 Screw.
- gearGtSmall("Small Gears", "Small ", " Gear", true, true, false, false, false, false, true, true, false, false, B[7], M * 1, 64, 52),
- gearGt("Gears", "", " Gear", true, true, false, false, false, false, true, true, false, false, B[7], M * 4, 16, 63), // Introduced by me because BuildCraft has ruined the gear Prefix...
- lens("Lenses", "", " Lens", true, true, false, false, false, false, true, true, false, false, B[2], (M * 3) / 4, 64, 24), // 3/4 of a Plate or Gem used to shape a Lense. Normally only used on Transparent Materials.
- crateGtDust("Crates of Dust", "Crate of ", " Dust", true, true, false, true, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, 96), // consisting out of 16 Dusts.
- crateGtPlate("Crates of Plates", "Crate of ", " Plate", true, true, false, true, false, false, false, true, false, false, B[1] | B[2], -1, 64, 99), // consisting out of 16 Plates.
- crateGtIngot("Crates of Ingots", "Crate of ", " Ingot", true, true, false, true, false, false, false, true, false, false, B[1], -1, 64, 97), // consisting out of 16 Ingots.
- crateGtGem("Crates of Gems", "Crate of ", " Gem", true, true, false, true, false, false, false, true, false, false, B[2], -1, 64, 98), // consisting out of 16 Gems.
- cellPlasma("Cells of Plasma", "", " Plasma Cell" , true, true, true, true, false, false, false, true, false, false, B[5], M * 1, 64, 31), // Hot Cell full of Plasma, which can be used in the Plasma Generator.
- cellMolten("Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 31), // Hot Cell full of molten stuff, which can be used in the Plasma Generator.
- cell("Cells", "", " Cell", true, true, true, true, false, false, true, true, false, false, B[4] | B[8], M * 1, 64, 30), // Regular Gas/Fluid Cell. Introduced by Calclavia
- bucket("Buckets", "", " Bucket", true, true, true, true, false, false, true, false, false, false, B[4] | B[8], M * 1, 16, -1), // A vanilla Iron Bucket filled with the Material.
- bottle("Bottles", "", " Bottle", true, true, true, true, false, false, false, false, false, false, B[4] | B[8], -1, 16, -1), // Glass Bottle containing a Fluid.
- capsule("Capsules", "", " Capsule", false, true, true, true, false, false, false, false, false, false, B[4] | B[8], M * 1, 16, -1),
- crystal("Crystals", "", " Crystal", false, true, false, false, false, false, true, false, false, false, B[2], M * 1, 64, -1),
- bulletGtSmall("Small Bullets", "Small ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 9, 64, -1),
- bulletGtMedium("Medium Bullets", "Medium ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 6, 64, -1),
- bulletGtLarge("Large Bullets", "Large ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 3, 64, -1),
- arrowGtWood("Regular Arrows", "", " Arrow", true, true, false, false, true, false, true, false, true, false, B[6], M / 4, 64, 57), // Arrow made of 1/4 Ingot/Dust + Wooden Stick.
- arrowGtPlastic("Light Arrows", "Light ", " Arrow", true, true, false, false, true, false, true, false, true, false, B[6], M / 4, 64, 58), // Arrow made of 1/4 Ingot/Dust + Plastic Stick.
- arrow("Arrows", "", "", false, false, true, false, false, false, false, false, true, false, B[6], -1, 64, 57),
- toolHeadArrow("Arrow Heads", "", " Arrow Head", true, true, false, false, false, false, true, true, false, false, B[6], M / 4, 64, 46), // consisting out of 1/4 Ingot.
- toolHeadSword("Sword Blades", "", " Sword Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 32), // consisting out of 2 Ingots.
- toolHeadPickaxe("Pickaxe Heads", "", " Pickaxe Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 3, 16, 33), // consisting out of 3 Ingots.
- toolHeadShovel("Shovel Heads", "", " Shovel Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 1, 16, 34), // consisting out of 1 Ingots.
- toolHeadUniversalSpade("Universal Spade Heads", "", " Universal Spade Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 1, 16, 43), // consisting out of 1 Ingots.
- toolHeadAxe("Axe Heads", "", " Axe Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 3, 16, 35), // consisting out of 3 Ingots.
- toolHeadHoe("Hoe Heads", "", " Hoe Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 36), // consisting out of 2 Ingots.
- toolHeadSense("Sense Blades", "", " Sense Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 3, 16, 44), // consisting out of 3 Ingots.
- toolHeadFile("File Heads", "", " File Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 38), // consisting out of 2 Ingots.
- toolHeadHammer("Hammer Heads", "", " Hammer Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
- toolHeadPlow("Plow Heads", "", " Plow Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 45), // consisting out of 4 Ingots.
- toolHeadSaw("Saw Blades", "", " Saw Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 39), // consisting out of 2 Ingots.
- toolHeadBuzzSaw("Buzzsaw Blades", "", " Buzzsaw Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 48), // consisting out of 4 Ingots.
- toolHeadScrewdriver("Screwdriver Tips", "", " Screwdriver Tip", true, true, false, false, false, false, true, false, false, false, B[6], M * 1, 16, 47), // consisting out of 1 Ingots.
- toolHeadDrill("Drill Tips", "", " Drill Tip", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 40), // consisting out of 4 Ingots.
- toolHeadChainsaw("Chainsaw Tips", "", " Chainsaw Tip", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 41), // consisting out of 2 Ingots.
- toolHeadWrench("Wrench Tips", "", " Wrench Tip", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 42), // consisting out of 4 Ingots.
- turbineBlade("Turbine Blades", "", " Turbine Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 64, 100), // consisting out of 6 Ingots.
- toolSword("Swords", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), // vanilly Sword
- toolPickaxe("Pickaxes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 3, 1, -1), // vanilly Pickaxe
- toolShovel("Shovels", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 1, 1, -1), // vanilly Shovel
- toolAxe("Axes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 3, 1, -1), // vanilly Axe
- toolHoe("Hoes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), // vanilly Hoe
- toolShears("Shears", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), // vanilly Shears
- tool("Tools", "", "", false, false, false, false, false, false, false, false, true, false, B[6], -1, 1, -1), // toolPot, toolSkillet, toolSaucepan, toolBakeware, toolCuttingboard, toolMortarandpestle, toolMixingbowl, toolJuicer
- compressedCobblestone("9^X Compressed Cobblestones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- compressedStone("9^X Compressed Stones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- compressedDirt("9^X Compressed Dirt", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- compressedGravel("9^X Compressed Gravel", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- compressedSand("9^X Compressed Sand", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- compressed("Compressed Materials", "Compressed ", "", true, true, false, false, false, false, true, false, false, false, 0, M * 3, 64, -1), // Compressed Material, worth 1 Unit. Introduced by Galacticraft
- glass("Glasses", "", "", false, false, true, false, true, false, false, false, false, false, 0, -1, 64, -1),
- paneGlass("Glass Panes", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
- blockGlass("Glass Blocks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
- blockWool("Wool Blocks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
- block_("Random Blocks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // IGNORE
- block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar
- craftingTool("Crafting Tools", "", "", false, false, false, false, false, false, false, false, true, false, 0, -1, 64, -1), // Special Prefix used mainly for the Crafting Handler.
- crafting("Crafting Ingredients", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Special Prefix used mainly for the Crafting Handler.
- craft("Crafting Stuff?", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Special Prefix used mainly for the Crafting Handler.
- log("Logs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix used for Logs. Usually as "logWood". Introduced by Eloraam
- slab("Slabs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix used for Slabs. Usually as "slabWood" or "slabStone". Introduced by SirSengir
- stair("Stairs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix used for Stairs. Usually as "stairWood" or "stairStone". Introduced by SirSengir
- fence("Fences", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Prefix used for Fences. Usually as "fenceWood". Introduced by Forge
- plank("Planks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix for Planks. Usually "plankWood". Introduced by Eloraam
- treeSapling("Saplings", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix for Saplings.
- treeLeaves("Leaves", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix for Leaves.
- tree("Tree Parts", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Prefix for Tree Parts.
- stoneCobble("Cobblestones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Cobblestone Prefix for all Cobblestones.
- stoneSmooth("Smoothstones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Smoothstone Prefix.
- stoneMossyBricks("mossy Stone Bricks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Mossy Stone Bricks.
- stoneMossy("Mossy Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Mossy Cobble.
- @Deprecated stoneBricksMossy("Mossy Stone Bricks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1),
- stoneBricks("Stone Bricks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Stone Bricks.
- @Deprecated stoneBrick("Stone Bricks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1),
- stoneCracked("Cracked Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Cracked Bricks.
- stoneChiseled("Chiseled Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Chiseled Stone.
- stone("Stones", "", "", false, true, true, false, true, true, false, false, false, false, 0, -1, 64, -1), // Prefix to determine which kind of Rock this is.
- cobblestone("Cobblestones", "", "", false, true, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
- rock("Rocks", "", "", false, true, true, false, true, true, false, false, false, false, 0, -1, 64, -1), // Prefix to determine which kind of Rock this is.
- record("Records", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, 1, -1),
- rubble("Rubbles", "", "", true, true, true, false, false, false, false, false, false, false, 0, -1, 64, -1),
- scraps("Scraps", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- scrap("Scraps", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- item_("Items", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // IGNORE
- item("Items", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Random Item. Introduced by Alblaka
- book("Books", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Used for Books of any kind.
- paper("Papers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Used for Papers of any kind.
- dye("Dyes", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, 64, -1), // Used for the 16 dyes. Introduced by Eloraam
- stainedClay("Stained Clays", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Used for the 16 colors of Stained Clay. Introduced by Forge
- armorHelmet("Helmets", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 5, 1, -1), // vanilly Helmet
- armorChestplate("Chestplates", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 8, 1, -1), // vanilly Chestplate
- armorLeggings("Leggings", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 7, 1, -1), // vanilly Pants
- armorBoots("Boots", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 4, 1, -1), // vanilly Boots
- armor("Armor Parts", "", "", false, false, false, false, false, false, false, false, true, false, B[6], -1, 1, -1),
- frameGt("Frame Boxes", "", "", true, true, false, false, true, false, true, false, false, false, 0, M * 2, 64, 83),
- pipeTiny("Tiny Pipes", "Tiny ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78),
- pipeSmall("Small Pipes", "Small ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79),
- pipeMedium("Medium Pipes", "Medium ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
- pipeLarge("Large pipes", "Large ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81),
- pipeHuge("Huge Pipes", "Huge ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82),
- pipeQuadruple("Quadruple Pipes", "Quadruple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M *12, 64, 84),
- pipeNonuple("Nonuple Pipes", "Nonuple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 9, 64, 85),
- pipeRestrictiveTiny("Tiny Restrictive Pipes", "Tiny Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78),
- pipeRestrictiveSmall("Small Restrictive Pipes", "Small Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79),
- pipeRestrictiveMedium("Medium Restrictive Pipes", "Medium Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
- pipeRestrictiveLarge("Large Restrictive Pipes", "Large Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81),
- pipeRestrictiveHuge("Huge Restrictive Pipes", "Huge Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82),
- pipe("Pipes", "", " Pipe", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, 77),
- wireGt16("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1),
- wireGt12("12x Wires", "12x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 6, 64, -1),
- wireGt08("8x Wires", "8x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 4, 64, -1),
- wireGt04("4x Wires", "4x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 2, 64, -1),
- wireGt02("2x Wires", "2x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 1, 64, -1),
- wireGt01("1x Wires", "1x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M / 2, 64, -1),
- cableGt16("16x Cables", "16x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1),
- cableGt12("12x Cables", "12x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 6, 64, -1),
- cableGt08("8x Cables", "8x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 4, 64, -1),
- cableGt04("4x Cables", "4x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 2, 64, -1),
- cableGt02("2x Cables", "2x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 1, 64, -1),
- cableGt01("1x Cables", "1x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M / 2, 64, -1),
-
- /* Electric Components.
- *
- * usual Materials for this are:
- * Primitive (Tier 1)
- * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery
- * Good (Tier 3)
- * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery
- * Data (Tier 5) : Data Storage Circuit
- * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit
- * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal
- * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb
- * Infinite (Cheaty)
- */
- batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
- circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
- chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft
- computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1), // A whole Computer. "computerMaster" = ComputerCube
-
- // random known prefixes without special abilities.
- skull("Skulls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- plating("Platings", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- dinosaur("Dinosaurs", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- travelgear("Travel Gear", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- bauble("Baubles", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- cluster("Clusters", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- grafter("Grafters", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- scoop("Scoops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- frame("Frames", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- tome("Tomes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- junk("Junk", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- bee("Bees", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- rod("Rods", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- dirt("Dirts", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- sand("Sands", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
- grass("Grasses", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- gravel("Gravels", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- mushroom("Mushrooms", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- wood("Woods", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Eloraam
- drop("Drops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- fuel("Fuels", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- panel("Panels", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- brick("Bricks", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- chunk("Chunks", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- wire("Wires", "", "", false, false, false, false, true, false, false, false, false, false, 0, -1, 64, -1),
- seed("Seeds", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- reed("Reeds", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- sheetDouble("2x Sheets", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- sheet("Sheets", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- crop("Crops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- plant("Plants", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- coin("Coins", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- lumar("Lumars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- ground("Grounded Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- cable("Cables", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- component("Components", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- wax("Waxes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- wall("Walls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- tube("Tubes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- list("Lists", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- food("Foods", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- gear("Gears", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by SirSengir
- coral("Corals", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- flower("Flowers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- storage("Storages", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- material("Materials", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- plasma("Plasmas", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- element("Elements", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- molecule("Molecules", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- wafer("Wafers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- orb("Orbs", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- handle("Handles", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- blade("Blades", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- head("Heads", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- motor("Motors", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- bit("Bits", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- shears("Shears", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- turbine("Turbines", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- fertilizer("Fertilizers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- chest("Chests", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- raw("Raw Things", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- stainedGlass("Stained Glasses", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- mystic("Mystic Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- mana("Mana Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- rune("Runes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- petal("Petals", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- pearl("Pearls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- powder("Powders", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- soulsand("Soulsands", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- obsidian("Obsidians", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- glowstone("Glowstones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- beans("Beans", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- br("br", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- essence("Essences", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- alloy("Alloys", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- cooking("Cooked Things", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- elven("Elven Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- reactor("Reactors", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- mffs("MFFS", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- projred("Project Red", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- ganys("Ganys Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- liquid("Liquids", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- bars("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- bar("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
- toolHeadMallet("Mallet Heads", "", " Mallet Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 127), // Reverse Head consisting out of 6 Ingots.
- handleMallet("Mallet Handle", "", " Handle", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 126); // Reverse Stick made of half an Ingot. Introduced by Eloraam
-
- public static volatile int VERSION = 509;
-
- static {
- pulp.mPrefixInto = dust;
- oreGem.mPrefixInto = ore;
- leaves.mPrefixInto = treeLeaves;
- sapling.mPrefixInto = treeSapling;
- itemDust.mPrefixInto = dust;
- dustDirty.mPrefixInto = dustImpure;
- denseore.mPrefixInto = oreDense;
- ingotQuad.mPrefixInto = ingotQuadruple;
- plateQuad.mPrefixInto = plateQuadruple;
- stoneBrick.mPrefixInto = stoneBricks;
- stoneBricksMossy.mPrefixInto = stoneMossyBricks;
-
- ingotHot.mHeatDamage = 3.0F;
- cellMolten.mHeatDamage=3;
- cellPlasma.mHeatDamage = 6.0F;
-
- block.ignoreMaterials(Materials.Ice, Materials.Snow, Materials.Concrete, Materials.Glass, Materials.Glowstone, Materials.DarkIron, Materials.Marble, Materials.Quartz, Materials.CertusQuartz, Materials.Limestone);
- ingot.ignoreMaterials(Materials.Brick, Materials.NetherBrick);
-
- dust.addFamiliarPrefix(dustTiny);
- dust.addFamiliarPrefix(dustSmall);
- dustTiny.addFamiliarPrefix(dust);
- dustTiny.addFamiliarPrefix(dustSmall);
- dustSmall.addFamiliarPrefix(dust);
- dustSmall.addFamiliarPrefix(dustTiny);
-
- ingot.addFamiliarPrefix(nugget);
- nugget.addFamiliarPrefix(ingot);
-
- for (OrePrefixes tPrefix1 : values())
- if (tPrefix1.name().startsWith("ore"))
- for (OrePrefixes tPrefix2 : values())
- if (tPrefix2.name().startsWith("ore"))
- tPrefix1.addFamiliarPrefix(tPrefix2);
- for (OrePrefixes tPrefix1 : values())
- if (tPrefix1.name().startsWith("pipe"))
- for (OrePrefixes tPrefix2 : values())
- if (tPrefix2.name().startsWith("pipe"))
- tPrefix1.addFamiliarPrefix(tPrefix2);
- for (OrePrefixes tPrefix1 : values())
- if (tPrefix1.name().startsWith("wireGt"))
- for (OrePrefixes tPrefix2 : values())
- if (tPrefix2.name().startsWith("wireGt"))
- tPrefix1.addFamiliarPrefix(tPrefix2);
- for (OrePrefixes tPrefix1 : values())
- if (tPrefix1.name().startsWith("cableGt")) for (OrePrefixes tPrefix2 : values())
- if (tPrefix2.name().startsWith("cableGt")) tPrefix1.addFamiliarPrefix(tPrefix2);
-
- // These are only the important ones.
- gem.mNotGeneratedItems.add(Materials.Coal);
- gem.mNotGeneratedItems.add(Materials.Charcoal);
- gem.mNotGeneratedItems.add(Materials.NetherStar);
- gem.mNotGeneratedItems.add(Materials.Diamond);
- gem.mNotGeneratedItems.add(Materials.Emerald);
- gem.mNotGeneratedItems.add(Materials.NetherQuartz);
- gem.mNotGeneratedItems.add(Materials.EnderPearl);
- gem.mNotGeneratedItems.add(Materials.EnderEye);
- gem.mNotGeneratedItems.add(Materials.Flint);
- gem.mNotGeneratedItems.add(Materials.Lapis);
- dust.mNotGeneratedItems.add(Materials.Bone);
- dust.mNotGeneratedItems.add(Materials.Redstone);
- dust.mNotGeneratedItems.add(Materials.Glowstone);
- dust.mNotGeneratedItems.add(Materials.Gunpowder);
- dust.mNotGeneratedItems.add(Materials.Sugar);
- dust.mNotGeneratedItems.add(Materials.Blaze);
- //dust.mNotGeneratedItems.add(Materials.Ichorium);
- //dustSmall.mNotGeneratedItems.add(Materials.Ichorium);
- //dustTiny.mNotGeneratedItems.add(Materials.Ichorium);
- stick.mNotGeneratedItems.add(Materials.Wood);
- stick.mNotGeneratedItems.add(Materials.Bone);
- stick.mNotGeneratedItems.add(Materials.Blaze);
- ingot.mNotGeneratedItems.add(Materials.Iron);
- ingot.mNotGeneratedItems.add(Materials.Gold);
- ingot.mNotGeneratedItems.add(Materials.Brick);
- ingot.mNotGeneratedItems.add(Materials.BrickNether);
- ingot.mNotGeneratedItems.add(Materials.WoodSealed);
- ingot.mNotGeneratedItems.add(Materials.Wood);
- //ingot.mNotGeneratedItems.add(Materials.Ichorium);
- nugget.mNotGeneratedItems.add(Materials.Gold);
- plate.mNotGeneratedItems.add(Materials.Paper);
- cell.mNotGeneratedItems.add(Materials.Empty);
- cell.mNotGeneratedItems.add(Materials.Water);
- cell.mNotGeneratedItems.add(Materials.Lava);
- cell.mNotGeneratedItems.add(Materials.ConstructionFoam);
- cell.mNotGeneratedItems.add(Materials.UUMatter);
- cell.mNotGeneratedItems.add(Materials.CoalFuel);
- bucket.mNotGeneratedItems.add(Materials.Empty);
- bucket.mNotGeneratedItems.add(Materials.Lava);
- bucket.mNotGeneratedItems.add(Materials.Milk);
- bucket.mNotGeneratedItems.add(Materials.Water);
- bottle.mNotGeneratedItems.add(Materials.Empty);
- bottle.mNotGeneratedItems.add(Materials.Water);
- bottle.mNotGeneratedItems.add(Materials.Milk);
- block.mNotGeneratedItems.add(Materials.Iron);
- block.mNotGeneratedItems.add(Materials.Gold);
- block.mNotGeneratedItems.add(Materials.Lapis);
- block.mNotGeneratedItems.add(Materials.Emerald);
- block.mNotGeneratedItems.add(Materials.Redstone);
- block.mNotGeneratedItems.add(Materials.Diamond);
- block.mNotGeneratedItems.add(Materials.Coal);
- toolHeadArrow.mNotGeneratedItems.add(Materials.Glass);
-
- //-----
-
- dustImpure.mGeneratedItems.add(Materials.GraniteRed);
- dustImpure.mGeneratedItems.add(Materials.GraniteBlack);
- dustImpure.mGeneratedItems.add(Materials.Quartzite);
- dustImpure.mGeneratedItems.add(Materials.Flint);
- dustImpure.mGeneratedItems.add(Materials.Redrock);
- dustImpure.mGeneratedItems.add(Materials.Basalt);
- dustImpure.mGeneratedItems.add(Materials.Marble);
- dustImpure.mGeneratedItems.add(Materials.Netherrack);
- dustImpure.mGeneratedItems.add(Materials.Endstone);
- dustImpure.mGeneratedItems.add(Materials.Stone);
-
- plate.mGeneratedItems.add(Materials.Redstone);
- plate.mGeneratedItems.add(Materials.Concrete);
- plate.mGeneratedItems.add(Materials.GraniteRed);
- plate.mGeneratedItems.add(Materials.GraniteBlack);
- plate.mGeneratedItems.add(Materials.Basalt);
- plate.mGeneratedItems.add(Materials.Marble);
- plate.mGeneratedItems.add(Materials.Glowstone);
- plate.mGeneratedItems.add(Materials.Electrotine);
- plate.mGeneratedItems.add(Materials.Obsidian);
-
- plate.mGeneratedItems.add(Materials.Paper);
- plateDouble.mGeneratedItems.add(Materials.Paper);
- plateTriple.mGeneratedItems.add(Materials.Paper);
- plateQuadruple.mGeneratedItems.add(Materials.Paper);
- plateQuintuple.mGeneratedItems.add(Materials.Paper);
- ring.mGeneratedItems.add(Materials.Paper);
-
- lens.mGeneratedItems.add(Materials.EnderPearl);
- lens.mGeneratedItems.add(Materials.EnderEye);
-
- stickLong.mGeneratedItems.add(Materials.Blaze);
-
- //-----
-
- dust.mGeneratedItems.addAll(dustPure.mGeneratedItems);
- dust.mGeneratedItems.addAll(dustImpure.mGeneratedItems);
- dust.mGeneratedItems.addAll(dustRefined.mGeneratedItems);
- dustTiny.mGeneratedItems.addAll(dust.mGeneratedItems);
- dustSmall.mGeneratedItems.addAll(dust.mGeneratedItems);
- crateGtDust.mGeneratedItems.addAll(dust.mGeneratedItems);
- crateGtIngot.mGeneratedItems.addAll(ingot.mGeneratedItems);
- crateGtGem.mGeneratedItems.addAll(gem.mGeneratedItems);
- crateGtPlate.mGeneratedItems.addAll(plate.mGeneratedItems);
- itemCasing.mGeneratedItems.addAll(itemCasing.mGeneratedItems);
- //-----
-
- toolHeadFile.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
- toolHeadSaw.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
- toolHeadDrill.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
- toolHeadChainsaw.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
- toolHeadWrench.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
- toolHeadBuzzSaw.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
- turbineBlade.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
-
- rotor.mCondition = new ICondition.Nor<ISubTagContainer>(SubTag.CRYSTAL, SubTag.STONE, SubTag.BOUNCY);
-
- spring.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.STRETCHY, SubTag.BOUNCY, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
- springSmall.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.STRETCHY, SubTag.BOUNCY, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
-
- gemChipped.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
- gemFlawed.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
- gemFlawless.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
- gemExquisite.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
-
- lens.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.MAGICAL, new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.HAS_COLOR));
-
- plateDouble.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
- plateTriple.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
- plateQuadruple.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
- plateQuintuple.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
-
- plateDense.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
-
- ingotDouble.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
- ingotTriple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
- ingotQuadruple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
- ingotQuintuple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
-
- wireFine.mCondition = SubTag.METAL;
-
- //-----
-
- pipeRestrictiveTiny.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount);
- pipeRestrictiveSmall.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 2);
- pipeRestrictiveMedium.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 3);
- pipeRestrictiveLarge.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 4);
- pipeRestrictiveHuge.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 5);
- cableGt12.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 5);
- cableGt12.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 4);
- cableGt08.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 3);
- cableGt04.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 2);
- cableGt02.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount);
- cableGt01.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount);
- bucket.mSecondaryMaterial = new MaterialStack(Materials.Iron, ingot.mMaterialAmount * 3);
- cell.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
- cellPlasma.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
- cellMolten.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
- oreRedgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteRed, dust.mMaterialAmount);
- oreBlackgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteBlack, dust.mMaterialAmount);
- oreNetherrack.mSecondaryMaterial = new MaterialStack(Materials.Netherrack, dust.mMaterialAmount);
- oreNether.mSecondaryMaterial = new MaterialStack(Materials.Netherrack, dust.mMaterialAmount);
- oreEndstone.mSecondaryMaterial = new MaterialStack(Materials.Endstone, dust.mMaterialAmount);
- oreEnd.mSecondaryMaterial = new MaterialStack(Materials.Endstone, dust.mMaterialAmount);
- oreMarble.mSecondaryMaterial = new MaterialStack(Materials.Marble, dust.mMaterialAmount);
- oreBasalt.mSecondaryMaterial = new MaterialStack(Materials.Basalt, dust.mMaterialAmount);
- oreDense.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount);
- orePoor.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
- oreSmall.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
- oreNormal.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
- oreRich.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
- ore.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount);
- crushed.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount);
- toolHeadDrill.mSecondaryMaterial = new MaterialStack(Materials.Steel, plate.mMaterialAmount * 4);
- toolHeadChainsaw.mSecondaryMaterial = new MaterialStack(Materials.Steel, plate.mMaterialAmount * 4 + ring.mMaterialAmount * 2);
- toolHeadWrench.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount + screw.mMaterialAmount * 2);
- arrowGtWood.mSecondaryMaterial = new MaterialStack(Materials.Wood, stick.mMaterialAmount);
- arrowGtPlastic.mSecondaryMaterial = new MaterialStack(Materials.Plastic, stick.mMaterialAmount);
- bulletGtSmall.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 9);
- bulletGtMedium.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 6);
- bulletGtLarge.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 3);
- }
-
- public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<ItemStack>();
- public final short mTextureIndex;
- public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost;
- public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem;
- public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
- public final Collection<OrePrefixes> mFamiliarPrefixes = new HashSet<OrePrefixes>();
- /**
- * Used to determine the amount of Material this Prefix contains.
- * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot.
- * 0 = Null
- * Negative = Undefined Amount
- */
- public final long mMaterialAmount;
- public final Collection<Materials> mDisabledItems = new HashSet<Materials>(), mNotGeneratedItems = new HashSet<Materials>(), mIgnoredMaterials = new HashSet<Materials>(), mGeneratedItems = new HashSet<Materials>();
- private final ArrayList<IOreRecipeRegistrator> mOreProcessing = new ArrayList<IOreRecipeRegistrator>();
- public ItemStack mContainerItem = null;
- public ICondition<ISubTagContainer> mCondition = null;
- public byte mDefaultStackSize = 64;
- public MaterialStack mSecondaryMaterial = null;
- public OrePrefixes mPrefixInto = this;
- public float mHeatDamage = 0.0F; // Negative for Frost Damage
- public static List<OrePrefixes> mPreventableComponents = new LinkedList<>(Arrays.asList(OrePrefixes.gem, OrePrefixes.ingotHot, OrePrefixes.ingotDouble, OrePrefixes.ingotTriple, OrePrefixes.ingotQuadruple, OrePrefixes.ingotQuintuple, OrePrefixes.plate, OrePrefixes.plateDouble, OrePrefixes.plateTriple, OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.plateDense, OrePrefixes.stick, OrePrefixes.round, OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.foil, OrePrefixes.toolHeadSword, OrePrefixes.toolHeadPickaxe, OrePrefixes.toolHeadShovel, OrePrefixes.toolHeadAxe, OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, OrePrefixes.wireFine, OrePrefixes.gearGtSmall, OrePrefixes.rotor, OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, OrePrefixes.arrowGtWood, OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gearGt, OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate, OrePrefixes.itemCasing));
- /**
- * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
- */
- public int mMaterialGenerationBits = 0;
-
- OrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) {
- mIsUnificatable = aIsUnificatable;
- mIsMaterialBased = aIsMaterialBased;
- mIsSelfReferencing = aIsSelfReferencing;
- mIsContainer = aIsContainer;
- mDontUnificateActively = aDontUnificateActively;
- mIsUsedForBlocks = aIsUsedForBlocks;
- mAllowNormalRecycling = aAllowNormalRecycling;
- mGenerateDefaultItem = aGenerateDefaultItem;
- mIsEnchantable = aIsEnchantable;
- mIsUsedForOreProcessing = aIsUsedForOreProcessing;
- mMaterialGenerationBits = aMaterialGenerationBits;
- mMaterialAmount = aMaterialAmount;
- mRegularLocalName = aRegularLocalName;
- mLocalizedMaterialPre = aLocalizedMaterialPre;
- mLocalizedMaterialPost = aLocalizedMaterialPost;
- mDefaultStackSize = (byte) aDefaultStackSize;
- mTextureIndex = (short) aTextureindex;
-
- if (name().startsWith("ore")) {
- new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
- } else if (name().startsWith("wire") || name().startsWith("cable")) {
- new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
- } else if (name().startsWith("dust")) {
- new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects);
- } else if (name().startsWith("crushed")) {
- new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects);
- } else if (name().startsWith("ingot") || name().startsWith("nugget")) {
- new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects);
- } else if (name().startsWith("armor")) {
- new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects);
- } else if (name().startsWith("stone")) {
- new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
- } else if (name().startsWith("pipe")) {
- new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects);
- } else if (name().startsWith("gear")) {
- new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects);
- new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects);
- } else if (name().startsWith("frame") || name().startsWith("plate")) {
- new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects);
- } else if (name().startsWith("tool")) {
- new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects);
- } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) {
- new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects);
- } else if (name().startsWith("crate")) {
- new TC_AspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects);
- } else if (name().startsWith("circuit")) {
- new TC_AspectStack(TC_Aspects.COGNITIO, 1).addToAspectList(mAspects);
- } else if (name().startsWith("computer")) {
- new TC_AspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects);
- } else if (name().startsWith("battery")) {
- new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
- }
- }
-
- public static void initMaterialComponents() {
- boolean enablePerItemSettings = GregTech_API.sMaterialComponents.get("general", "enablePerItemSettings", false);
- boolean enableUnusedPlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedPlates", false);
- boolean enableUnusedDoubleIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedDoubleIngots", false);
- boolean enableUnusedTripleIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedTripleIngots", false);
- boolean enableUnusedQuadIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuadIngots", false);
- boolean enableUnusedQuinIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuinIngots", false);
- boolean enableUnusedDoublePlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedDoublePlates", false);
- boolean enableUnusedTriplePlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedTriplePlates", false);
- boolean enableUnusedQuadPlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuadPlates", false);
- boolean enableUnusedQuinPlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuinPlates", false);
- boolean enableUnusedDensePlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedDensePlates", false);
- boolean enableUnusedGears = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedGears", false);
- boolean enableUnusedSmallGears = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedSmallGears", false);
- boolean enableUnusedRings = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRings", false);
- boolean enableUnusedSprings = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedSprings", false);
- boolean enableUnusedSmallSprings = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedSmallSprings", false);
- boolean enableUnusedRounds = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRounds", false);
- boolean enableUnusedRotors = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRotors", false);
- boolean enableUnusedFineWires = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedFineWires", false);
- boolean enableUnusedFoil = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedFoil", false);
- boolean enableUnusedArrows = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedArrowHeads", false);
- boolean enableUnusedCrates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedCrates", false);
- boolean enableUnusedBolts = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedBolts", false);
- boolean enableUnusedScrews = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedScrews", false);
- boolean enableUnusedRods = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRods", false);
- boolean enableUnusedLongRods = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedLongRods", false);
- boolean enableUnusedGems = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedGems", false);
- boolean enableUnusedItemCasing = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedItemCasing", false);
-
- //TODO possibly use OrePrefix mNotGeneratedItems/mGeneratedItems instead of a static List for every material instance?
- //TODO Make sure stuff like gem plates / standard plates / paper plates all generate with the current condition
- for (Materials aMaterial : Materials.values()) {
- if (aMaterial.mMetaItemSubID > 0) {
- if (aMaterial.mBlastFurnaceTemp <= 1750) ingotHot.mDisabledItems.add(aMaterial); //Moved HotIngot code from GT_MetaGenerated_Item_01 so all this is in once place
- if (!enableUnusedSprings && (aMaterial != Materials.Titanium)) spring.mDisabledItems.add(aMaterial);
- if (!enableUnusedSmallSprings) springSmall.mDisabledItems.add(aMaterial);
- if (!enableUnusedRounds && !(aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium || aMaterial == Materials.HSSG)) round.mDisabledItems.add(aMaterial);
- if (!enableUnusedCrates) {
- if (!(aMaterial == Materials.DamascusSteel || aMaterial == Materials.Steel || aMaterial == Materials.Bronze || aMaterial == Materials.Manganese))
- crateGtIngot.mDisabledItems.add(aMaterial);
- if (!(aMaterial == Materials.Neodymium || aMaterial == Materials.Chrome))
- crateGtDust.mDisabledItems.add(aMaterial);
- crateGtGem.mDisabledItems.add(aMaterial);
- crateGtPlate.mDisabledItems.add(aMaterial);
- }
- if (!enableUnusedArrows) {
- toolHeadArrow.mDisabledItems.add(aMaterial);
- arrowGtPlastic.mDisabledItems.add(aMaterial);
- if (!(aMaterial == Materials.DamascusSteel || aMaterial == Materials.SterlingSilver))
- arrowGtWood.mDisabledItems.add(aMaterial);
- }
- //Plates
- if (!enableUnusedPlates && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Silicon || aMaterial == Materials.Zinc ||
- aMaterial == Materials.Europium || aMaterial == Materials.Americium || aMaterial == Materials.RedAlloy || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.BatteryAlloy ||
- aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Firestone || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.YttriumBariumCuprate ||
- aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz || aMaterial == Materials.Lazurite || aMaterial == Materials.Lapis ||
- aMaterial == Materials.Paper || aMaterial == Materials.Jasper || aMaterial == Materials.Dilithium || aMaterial == Materials.Forcicium || aMaterial == Materials.Forcillium ||
- aMaterial == Materials.EnderPearl || aMaterial == Materials.EnderEye || aMaterial == Materials.Glass || aMaterial == Materials.Copper || aMaterial == Materials.Tin || aMaterial == Materials.Redstone ||
- aMaterial == Materials.Sodalite || aMaterial == Materials.Gallium || aMaterial == Materials.GalliumArsenide || aMaterial == Materials.IndiumGalliumPhosphide))
- plate.mDisabledItems.add(aMaterial);
- //Ingot/Plate Storage
- if (!enableUnusedDoubleIngots) ingotDouble.mDisabledItems.add(aMaterial);
- if (!enableUnusedTripleIngots) ingotTriple.mDisabledItems.add(aMaterial);
- if (!enableUnusedQuadIngots) ingotQuadruple.mDisabledItems.add(aMaterial);
- if (!enableUnusedQuinIngots) ingotQuintuple.mDisabledItems.add(aMaterial);
- if (!enableUnusedDoublePlates && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Paper || aMaterial == Materials.Aluminium || aMaterial == Materials.Steel || aMaterial == Materials.TungstenSteel))
- plateDouble.mDisabledItems.add(aMaterial);
- if (!enableUnusedTriplePlates && !(aMaterial == Materials.Paper)) plateTriple.mDisabledItems.add(aMaterial);
- if (!enableUnusedQuadPlates && !(aMaterial == Materials.Paper)) plateQuadruple.mDisabledItems.add(aMaterial);
- if (!enableUnusedQuinPlates && !(aMaterial == Materials.Paper)) plateQuintuple.mDisabledItems.add(aMaterial);
- if (!(enableUnusedDensePlates || GregTech_API.mGTPlusPlus) && !(aMaterial == Materials.Iron || aMaterial == Materials.Copper || aMaterial == Materials.Lead || aMaterial == Materials.Paper))
- plateDense.mDisabledItems.add(aMaterial);
- //Rotors
- if (!enableUnusedRotors && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Tin || aMaterial == Materials.Osmium ||
- aMaterial == Materials.Iridium || aMaterial == Materials.Bronze || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
- aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium))
- rotor.mDisabledItems.add(aMaterial);
- //Rings
- if (!enableUnusedRings && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron || aMaterial == Materials.Tin ||
- aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron ||
- aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel || aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel ||
- aMaterial == Materials.Rubber || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium || aMaterial == Materials.HSSG || aMaterial == Materials.Aluminium ||
- aMaterial == Materials.Invar || aMaterial == Materials.Brass || aMaterial == Materials.Paper || aMaterial == Materials.Silicone || aMaterial == Materials.StyreneButadieneRubber))
- ring.mDisabledItems.add(aMaterial);
- //Foil
- if (!enableUnusedFoil && !(aMaterial == Materials.Zinc || aMaterial == Materials.Aluminium || aMaterial == Materials.Silicon || aMaterial == Materials.Gold ||
- aMaterial == Materials.Electrum || aMaterial == Materials.Platinum || aMaterial == Materials.Osmiridium || aMaterial == Materials.Osmium ||
- aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Steel || aMaterial == Materials.Copper || aMaterial == Materials.YttriumBariumCuprate
- || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.Naquadah || aMaterial == Materials.Manganese ||
- aMaterial == Materials.Plastic || aMaterial == Materials.Silicone || aMaterial == Materials.PolyvinylChloride || aMaterial == Materials.PolyphenyleneSulfide ||
- aMaterial == Materials.Nichrome || aMaterial == Materials.BlackSteel || aMaterial == Materials.Titanium || aMaterial == Materials.TungstenSteel ||
- aMaterial == Materials.Tungsten || aMaterial == Materials.HSSG || aMaterial == Materials.NaquadahAlloy || aMaterial == Materials.Duranium ||
- aMaterial == Materials.Europium))
- foil.mDisabledItems.add(aMaterial);
- //Fine Wire
- if (!enableUnusedFineWires && !(aMaterial == Materials.Steel || aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Platinum || aMaterial == Materials.Osmium ||
- aMaterial == Materials.Tin || aMaterial == Materials.Lead || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.Copper || aMaterial == Materials.Electrum ||
- aMaterial == Materials.Gold || aMaterial == Materials.RedAlloy || aMaterial == Materials.Graphene || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.YttriumBariumCuprate ))
- wireFine.mDisabledItems.add(aMaterial);
- //Gears
- if (!enableUnusedGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium || aMaterial == Materials.Iron || aMaterial == Materials.Copper ||
- aMaterial == Materials.Tin || aMaterial == Materials.Gold || aMaterial == Materials.Stone || aMaterial == Materials.Bronze ||
- aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel || aMaterial == Materials.TungstenSteel || aMaterial == Materials.CobaltBrass ||
- aMaterial == Materials.Diamond || aMaterial == Materials.Wood || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium))
- gearGt.mDisabledItems.add(aMaterial);
- //Small Gears
- if (!enableUnusedSmallGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
- aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium))
- gearGtSmall.mDisabledItems.add(aMaterial);
- //Bolts
- if (!enableUnusedBolts && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron ||
- aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Neutronium ||
- aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
- aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel || aMaterial == Materials.Tungsten || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG))
- bolt.mDisabledItems.add(aMaterial);
- //Screws
- if (!enableUnusedScrews && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron ||
- aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Neutronium ||
- aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
- aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG))
- screw.mDisabledItems.add(aMaterial);
- //Rods
- if (!enableUnusedRods && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron ||
- aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Neutronium ||
- aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
- aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG ||
- aMaterial == Materials.Aluminium || aMaterial == Materials.Copper || aMaterial == Materials.Neodymium || aMaterial == Materials.Europium ||
- aMaterial == Materials.Platinum || aMaterial == Materials.Gold || aMaterial == Materials.Uranium235 || aMaterial == Materials.Plutonium241 ||
- aMaterial == Materials.Americium || aMaterial == Materials.Neutronium || aMaterial == Materials.Bronze || aMaterial == Materials.Brass ||
- aMaterial == Materials.Electrum || aMaterial == Materials.NaquadahEnriched || aMaterial == Materials.CobaltBrass || aMaterial == Materials.IronMagnetic ||
- aMaterial == Materials.SteelMagnetic || aMaterial == Materials.NeodymiumMagnetic || aMaterial == Materials.Samarium || aMaterial == Materials.SamariumMagnetic || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.Diamond ||
- aMaterial == Materials.Wood || aMaterial == Materials.Plastic || aMaterial == Materials.Lead || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.Lapis ||
- aMaterial == Materials.Lazurite || aMaterial == Materials.Sodalite|| aMaterial == Materials.PolyvinylChloride))
- stick.mDisabledItems.add(aMaterial);
- //Long Rods
- if (!enableUnusedLongRods && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.NeodymiumMagnetic || aMaterial == Materials.SamariumMagnetic || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE ||
- aMaterial == Materials.Neutronium || aMaterial == Materials.Americium || aMaterial == Materials.WroughtIron || aMaterial == Materials.Magnalium ||
- aMaterial == Materials.TungstenSteel))
- stickLong.mDisabledItems.add(aMaterial);
-
- if (!enableUnusedGems && ((aMaterial.mTypes & 0x04) == 0)) {
- gem.mDisabledItems.add(aMaterial);
- gemChipped.mDisabledItems.add(aMaterial);
- gemFlawless.mDisabledItems.add(aMaterial);
- gemFlawed.mDisabledItems.add(aMaterial);
- gemExquisite.mDisabledItems.add(aMaterial);
- }
- //itemCasing
- if (!enableUnusedItemCasing) itemCasing.mDisabledItems.add(aMaterial);
- }
- }
- for (IMaterialHandler aRegistrator : Materials.mMaterialHandlers) {
- aRegistrator.onComponentInit();
- }
- for (Materials aMaterial : Materials.values()) {
- if (aMaterial.mMetaItemSubID > 0) {
- for (IMaterialHandler aRegistrator : Materials.mMaterialHandlers) {
- aRegistrator.onComponentIteration(aMaterial);
- }
- if (enablePerItemSettings) {
- StringBuilder aConfigPathSB = new StringBuilder();
- aConfigPathSB.append("materialcomponents.").append(aMaterial.mConfigSection).append(".").append(aMaterial.mName);
- String aConfigPath = aConfigPathSB.toString();
- for (OrePrefixes aPrefix : mPreventableComponents) {
- boolean aEnableComponent = GregTech_API.sMaterialComponents.get(aConfigPath, aPrefix.toString(), !aPrefix.mDisabledItems.contains(aMaterial));
- if (!aEnableComponent) { //Disable component if false and is not already in disabled list
- aPrefix.disableComponent(aMaterial);
- } else if (aEnableComponent) { //Enable component if true and is not already in enabled list
- aPrefix.enableComponent(aMaterial);
- }
- }
- aConfigPathSB.setLength(0);
- }
- }
- }
- }
-
- public static boolean isInstanceOf(String aName, OrePrefixes aPrefix) {
- return aName != null && aName.startsWith(aPrefix.toString());
- }
-
- public void disableComponent(Materials aMaterial) {
- if (!this.mDisabledItems.contains(aMaterial)) this.mDisabledItems.add(aMaterial);
- }
-
- public static OrePrefixes getOrePrefix(String aOre) {
- for (OrePrefixes tPrefix : values())
- if (aOre.startsWith(tPrefix.toString())) {
- if (tPrefix == oreNether && aOre.equals("oreNetherQuartz")) return ore;
- if (tPrefix == oreNether && aOre.equals("oreNetherStar")) return ore;
- if (tPrefix == oreBasalt && aOre.equals("oreBasalticMineralSand")) return ore;
- return tPrefix;
- }
- return null;
- }
-
- public static String stripPrefix(String aOre) {
- for (OrePrefixes tPrefix : values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return aOre.replaceFirst(tPrefix.toString(), "");
- }
- }
- return aOre;
- }
-
- public static String replacePrefix(String aOre, OrePrefixes aPrefix) {
- for (OrePrefixes tPrefix : values()) {
- if (aOre.startsWith(tPrefix.toString())) {
- return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
- }
- }
- return "";
- }
-
- public static OrePrefixes getPrefix(String aPrefixName) {
- return getPrefix(aPrefixName, null);
- }
-
- public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) {
- Object tObject = GT_Utility.getFieldContent(OrePrefixes.class, aPrefixName, false, false);
- if (tObject instanceof OrePrefixes) return (OrePrefixes) tObject;
- return aReplacement;
- }
-
- public static Materials getMaterial(String aOre) {
- return Materials.get(stripPrefix(aOre));
- }
-
- public static Materials getMaterial(String aOre, OrePrefixes aPrefix) {
- return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
- }
-
- public static Materials getRealMaterial(String aOre, OrePrefixes aPrefix) {
- return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
- }
-
- public void enableComponent(Materials aMaterial) {
- this.mDisabledItems.remove(aMaterial);
- }
-
- public boolean add(ItemStack aStack) {
- if (aStack == null) return false;
- if (!contains(aStack)) {
- mPrefixedItems.add(aStack);
- // It's now in there... so update the cache
- getSet(this.toString().toUpperCase()).put(Objects.hashCode(aStack.getItem(), aStack.getItemDamage()), true);
- }
- while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null);
- return true;
- }
-
- private static final LinkedHashMap<String, ObjMap<Integer, Boolean>>mCachedResults = new LinkedHashMap<String, ObjMap<Integer, Boolean>>();
-
- private ObjMap<Integer, Boolean> getSet(final String prefix) {
- ObjMap<Integer, Boolean> foundSet = mCachedResults.get(prefix);
- if (foundSet == null){
- foundSet = new ObjMap<Integer, Boolean>(512, 0.5f);
- mCachedResults.put(prefix, foundSet);
- }
-
- return foundSet;
- }
-
- public boolean contains(ItemStack aStack) {
- if (aStack == null) {
- return false;
- }
-
- final ObjMap<Integer, Boolean> aCurrentSet = getSet(this.toString().toUpperCase());
- final Boolean result = aCurrentSet.get(Objects.hashCode(aStack.getItem(), aStack.getItemDamage()));
-
- if (result != null) {
- return result;
- }
-
- return false;
- }
-
- public boolean containsUnCached(ItemStack aStack) {
- // In case someone needs this
- for (ItemStack tStack : mPrefixedItems){
- if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())){
- return true;
- }
- }
- return false;
- }
-
- public boolean doGenerateItem(Materials aMaterial) {
- return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial) /*|| mDynamicItems.contains(aMaterial)*/) && !mNotGeneratedItems.contains(aMaterial) && !mDisabledItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial));
- }
-
- public boolean ignoreMaterials(Materials... aMaterials) {
- for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial);
- return true;
- }
-
- public boolean isIgnored(Materials aMaterial) {
- if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true;
- return mIgnoredMaterials.contains(aMaterial);
- }
-
- public boolean addFamiliarPrefix(OrePrefixes aPrefix) {
- if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false;
- return mFamiliarPrefixes.add(aPrefix);
- }
-
- public boolean add(IOreRecipeRegistrator aRegistrator) {
- if (aRegistrator == null) return false;
- return mOreProcessing.add(aRegistrator);
- }
-
- public void processOre(Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
- if (aMaterial != null && (aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack)) {
- //if (Materials.mPreventableComponents.contains(this) && !this.mDynamicItems.contains(aMaterial)) return;
- for (IOreRecipeRegistrator tRegistrator : mOreProcessing) {
- if (D2) GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.mName + "' at " + GT_Utility.getClassName(tRegistrator));
- tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
- }
- }
- }
-
- public Object get(Object aMaterial) {
- if (aMaterial instanceof Materials) return new ItemData(this, (Materials) aMaterial);
- return name() + aMaterial;
- }
-
- public String getDefaultLocalNameForItem(Materials aMaterial) {
- return aMaterial.getDefaultLocalizedNameForItem(getDefaultLocalNameFormatForItem(aMaterial));
- }
-
- @SuppressWarnings("incomplete-switch")
- public String getDefaultLocalNameFormatForItem(Materials aMaterial) {
- // Certain Materials have slightly different Localizations.
- switch (this) {
- case crateGtDust:
- return mLocalizedMaterialPre + OrePrefixes.dust.getDefaultLocalNameFormatForItem(aMaterial);
- case crateGtIngot:
- return mLocalizedMaterialPre + OrePrefixes.ingot.getDefaultLocalNameFormatForItem(aMaterial);
- case crateGtGem:
- return mLocalizedMaterialPre + OrePrefixes.gem.getDefaultLocalNameFormatForItem(aMaterial);
- case crateGtPlate:
- return mLocalizedMaterialPre + OrePrefixes.plate.getDefaultLocalNameFormatForItem(aMaterial);
- case cellMolten:
- }
- switch (aMaterial.mName) {
- case "Glass":
- case "BorosilicateGlass":
- if (name().startsWith("gem")) return mLocalizedMaterialPre + "%material" + " Crystal";
- if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Pane";
- if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material" + " Bar";
- if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip";
- break;
- case "Wheat":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "Flour";
- break;
- case "Ice":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "Crushed Ice";
- break;
- case "Wood":
- case "WoodSealed":
- if (name().startsWith("bolt")) return "Short " + "%material" + " Stick";
- if (name().startsWith("stick")) return mLocalizedMaterialPre + "%material" + " Stick";
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Pulp";
- if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip";
- if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Plank";
- break;
- case "Plastic":
- case "Rubber":
- case "Polyethylene":
- case "Epoxid":
- case "EpoxidFiberReinforced":
- case "Polydimethylsiloxane":
- case "Silicone":
- case "Polysiloxane":
- case "Polycaprolactam":
- case "Polytetrafluoroethylene":
- case "PolyvinylChloride":
- case "Polystyrene":
- case "StyreneButadieneRubber":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Pulp";
- if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Sheet";
- if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material" + " Bar";
- if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip";
- if (name().startsWith("foil")) return "Thin " + "%material" + " Sheet";
- break;
- case "FierySteel":
- if (mIsContainer) return mLocalizedMaterialPre + "Fiery Blood" + mLocalizedMaterialPost;
- break;
- case "Steeleaf":
- if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material";
- break;
- case "Bone":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "Bone Meal";
- break;
- case "Blaze":
- case "Milk":
- case "Cocoa":
- case "Chocolate":
- case "Coffee":
- case "Chili":
- case "Cheese":
- case "Snow":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Powder";
- break;
- case "Paper":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "Chad";
- switch (this) {
- case plate: return "Sheet of Paper";
- case plateDouble: return "Paperboard";
- case plateTriple: return "Carton";
- case plateQuadruple: return "Cardboard";
- case plateQuintuple: return "Thick Cardboard";
- case plateDense: return "Strong Cardboard";
- }
- break;
- case "MeatRaw":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "Mince Meat";
- break;
- case "MeatCooked":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "Cooked Mince Meat";
- break;
- case "Ash":
- case "DarkAsh":
- case "Gunpowder":
- case "Sugar":
- case "Salt":
- case "RockSalt":
- case "VolcanicAsh":
- case "RareEarth":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material";
- break;
- case "Vermiculite":
- case "Bentonite":
- case "Kaolinite":
- case "Talc":
- case "BasalticMineralSand":
- case "GraniticMineralSand":
- case "GlauconiteSand":
- case "CassiteriteSand":
- case "GarnetSand":
- case "QuartzSand":
- case "Pitchblende":
- case "FullersEarth":
- if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material";
- switch (this) {
- case crushedCentrifuged:
- case crushedPurified:
- return mLocalizedMaterialPre + "%material";
- case crushed:
- return "Ground " + "%material";
- }
- break;
- }
- if (ProcessingModSupport.aEnableThaumcraftMats) {
- switch (aMaterial.mName) {
- case "InfusedAir":
- case "InfusedDull":
- case "InfusedEarth":
- case "InfusedEntropy":
- case "InfusedFire":
- case "InfusedOrder":
- case "InfusedVis":
- case "InfusedWater":
- if (name().startsWith("gem")) return mLocalizedMaterialPre + "Shard of " + "%material";
- if (name().startsWith("crystal")) return mLocalizedMaterialPre + "Shard of " + "%material";
- if (name().startsWith("plate"))
- return mLocalizedMaterialPre + "%material" + " Crystal Plate";
- if (name().startsWith("dust"))
- return mLocalizedMaterialPre + "%material" + " Crystal Powder";
- switch (this) {
- case crushedCentrifuged:
- case crushedPurified:
- case crushed:
- return mLocalizedMaterialPre + "%material" + " Crystals";
- }
- break;
- }
- }
- // Use Standard Localization
- return mLocalizedMaterialPre + "%material" + mLocalizedMaterialPost;
- }
-}
+package gregtech.api.enums;
+
+import com.google.common.base.Objects;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.ICondition;
+import gregtech.api.interfaces.IMaterialHandler;
+import gregtech.api.interfaces.IOreRecipeRegistrator;
+import gregtech.api.interfaces.ISubTagContainer;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.objects.ObjMap;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gregtech.loaders.materialprocessing.ProcessingModSupport;
+import net.minecraft.item.ItemStack;
+
+import java.util.*;
+
+import static gregtech.api.enums.GT_Values.*;
+
+public enum OrePrefixes {
+ @Deprecated pulp("Pulps", "", "", false, false, false, false, false, false, false, false, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, -1),
+ @Deprecated leaves("Leaves", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ @Deprecated sapling("Saplings", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ @Deprecated itemDust("Dusts", "", "", false, false, false, false, false, false, false, false, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, -1),
+ oreBlackgranite("Black Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
+ oreRedgranite("Red Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
+ oreMarble("Marble Ores", "Marble ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
+ oreBasalt("Basalt Ores", "Basalt ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
+ oreNetherrack("Netherrack Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
+ oreNether("Nether Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
+ @Deprecated denseore("Dense Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, -1),
+ oreDense("Dense Ores", "Dense ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Dense-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
+ oreRich("Rich Ores", "Rich ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of TFC
+ oreNormal("Normal Ores", "Normal ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of TFC
+ oreSmall("Small Ores", "Small ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, 67), // Prefix of Railcraft.
+ orePoor("Poor Ores", "Poor ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of Railcraft.
+ oreEndstone("Endstone Ores", "End ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
+ oreEnd("End Ores", "End ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
+ @Deprecated oreGem("Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, -1),
+ ore("Ores", "", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, 68), // Regular Ore Prefix. Ore -> Material is a Oneway Operation! Introduced by Eloraam
+ crushedCentrifuged("Centrifuged Ores", "Centrifuged ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], -1, 64, 7),
+ crushedPurified("Purified Ores", "Purified ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], -1, 64, 6),
+ crushed("Crushed Ores", "Crushed ", " Ore", true, true, false, false, false, false, false, true, false, true, B[3], -1, 64, 5),
+ shard("Crystallised Shards", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1), // Introduced by Mekanism
+ clump("Clumps", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
+ reduced("Reduced Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
+ crystalline("Crystallised Metals", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
+ cleanGravel("Clean Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
+ dirtyGravel("Dirty Gravels", "", "", true, true, false, false, false, false, false, false, false, true, B[3], -1, 64, -1),
+ ingotQuintuple("5x Ingots", "Quintuple ", " Ingot", true, true, false, false, false, false, true, true, false, false, B[1], M * 5, 12, 16), // A quintuple Ingot.
+ ingotQuadruple("4x Ingots", "Quadruple ", " Ingot", true, true, false, false, false, false, true, true, false, false, B[1], M * 4, 16, 15), // A quadruple Ingot.
+ @Deprecated ingotQuad("4x Ingots", "Quadruple ", " Ingot", false, false, false, false, false, false, false, false, false, false, B[1], -1, 16, 15),
+ ingotTriple("3x Ingots", "Triple ", " Ingot", true, true, false, false, false, false, true, false, false, false, B[1], M * 3, 21, 14), // A triple Ingot.
+ ingotDouble("2x Ingots", "Double ", " Ingot", true, true, false, false, false, false, true, true, false, false, B[1], M * 2, 32, 13), // A double Ingot. Introduced by TerraFirmaCraft
+ ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer.
+ ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam
+ gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft
+ gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft
+ gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft
+ gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft
+ gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam
+ @Deprecated dustDirty("Impure Dusts", "", "", false, false, false, false, false, false, false, false, false, true, B[3], -1, 64, 3),
+ dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust.
+ dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust.
+ dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material
+ dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 2),
+ dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 4),
+ dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka.
+ nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, 9), // A Nugget. Introduced by Eloraam
+ plateAlloy("Alloy Plates", "", "", true, false, false, false, false, false, false, false, false, false, B[1], -1, 64, 17), // Special Alloys have this prefix.
+ plateSteamcraft("Steamcraft Plates", "", "", false, false, false, false, false, false, false, false, false, false, B[1], -1, 64, 17),
+ plateDense("Dense Plates", "Dense ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 9, 8, 22), // 9 Plates combined in one Item.
+ plateQuintuple("5x Plates", "Quintuple ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 5, 12, 21),
+ plateQuadruple("4x Plates", "Quadruple ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 4, 16, 20),
+ @Deprecated plateQuad("4x Plates", "", "", false, false, false, false, false, false, false, false, false, false, B[1], -1, 16, 20),
+ plateTriple("3x Plates", "Triple ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 3, 21, 19),
+ plateDouble("2x Plates", "Double ", " Plate", true, true, false, false, false, false, true, true, false, false, B[1], M * 2, 32, 18),
+ plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
+ itemCasing("Casings", "", " Casing", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 10), // Casing made of 1/2 Ingot/Dust
+ foil("Foils", "", " Foil", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 29), // Foil made of 1/4 Ingot/Dust.
+ stickLong("Long Sticks/Rods", "Long ", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 54), // Stick made of an Ingot.
+ stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam
+ round("Rounds", "", " Round", true, true, false, false, false, false, true, true, false, false, B[1], M / 9, 64, 25), // consisting out of one Nugget.
+ bolt("Bolts", "", " Bolt", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 8, 64, 26), // consisting out of 1/8 Ingot or 1/4 Stick.
+ comb("Combs", "", " Comb", false, false, false, false, false, false, false, true, false, false, B[1] | B[2], M, 64, 101), // contain dusts
+ screw("Screws", "", " Screw", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 9, 64, 27), // consisting out of a Bolt.
+ ring("Rings", "", " Ring", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 28), // consisting out of 1/2 Stick.
+ springSmall("Small Springs", "Small ", " Spring", true, true, false, false, false, false, true, true, false, false, B[1], M / 4, 64, 55), // consisting out of 1 Fine Wire.
+ spring("Springs", "", " Spring", true, true, false, false, false, false, true, true, false, false, B[1], M * 1, 64, 56), // consisting out of 2 Sticks.
+ wireFine("Fine Wires", "Fine ", " Wire", true, true, false, false, false, false, true, true, false, false, B[1], M / 8, 64, 51), // consisting out of 1/8 Ingot or 1/4 Wire.
+ rotor("Rotors", "", " Rotor", true, true, false, false, false, false, true, true, false, false, B[7], M * 4 + M / 4, 16, 53), // consisting out of 4 Plates, 1 Ring and 1 Screw.
+ gearGtSmall("Small Gears", "Small ", " Gear", true, true, false, false, false, false, true, true, false, false, B[7], M * 1, 64, 52),
+ gearGt("Gears", "", " Gear", true, true, false, false, false, false, true, true, false, false, B[7], M * 4, 16, 63), // Introduced by me because BuildCraft has ruined the gear Prefix...
+ lens("Lenses", "", " Lens", true, true, false, false, false, false, true, true, false, false, B[2], (M * 3) / 4, 64, 24), // 3/4 of a Plate or Gem used to shape a Lense. Normally only used on Transparent Materials.
+ crateGtDust("Crates of Dust", "Crate of ", " Dust", true, true, false, true, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, 96), // consisting out of 16 Dusts.
+ crateGtPlate("Crates of Plates", "Crate of ", " Plate", true, true, false, true, false, false, false, true, false, false, B[1] | B[2], -1, 64, 99), // consisting out of 16 Plates.
+ crateGtIngot("Crates of Ingots", "Crate of ", " Ingot", true, true, false, true, false, false, false, true, false, false, B[1], -1, 64, 97), // consisting out of 16 Ingots.
+ crateGtGem("Crates of Gems", "Crate of ", " Gem", true, true, false, true, false, false, false, true, false, false, B[2], -1, 64, 98), // consisting out of 16 Gems.
+ cellPlasma("Cells of Plasma", "", " Plasma Cell" , true, true, true, true, false, false, false, true, false, false, B[5], M * 1, 64, 31), // Hot Cell full of Plasma, which can be used in the Plasma Generator.
+ cellMolten("Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 31), // Hot Cell full of molten stuff, which can be used in the Plasma Generator.
+ cell("Cells", "", " Cell", true, true, true, true, false, false, true, true, false, false, B[4] | B[8], M * 1, 64, 30), // Regular Gas/Fluid Cell. Introduced by Calclavia
+ bucket("Buckets", "", " Bucket", true, true, true, true, false, false, true, false, false, false, B[4] | B[8], M * 1, 16, -1), // A vanilla Iron Bucket filled with the Material.
+ bottle("Bottles", "", " Bottle", true, true, true, true, false, false, false, false, false, false, B[4] | B[8], -1, 16, -1), // Glass Bottle containing a Fluid.
+ capsule("Capsules", "", " Capsule", false, true, true, true, false, false, false, false, false, false, B[4] | B[8], M * 1, 16, -1),
+ crystal("Crystals", "", " Crystal", false, true, false, false, false, false, true, false, false, false, B[2], M * 1, 64, -1),
+ bulletGtSmall("Small Bullets", "Small ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 9, 64, -1),
+ bulletGtMedium("Medium Bullets", "Medium ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 6, 64, -1),
+ bulletGtLarge("Large Bullets", "Large ", " Bullet", true, true, false, false, true, false, true, false, true, false, B[6] | B[8], M / 3, 64, -1),
+ arrowGtWood("Regular Arrows", "", " Arrow", true, true, false, false, true, false, true, false, true, false, B[6], M / 4, 64, 57), // Arrow made of 1/4 Ingot/Dust + Wooden Stick.
+ arrowGtPlastic("Light Arrows", "Light ", " Arrow", true, true, false, false, true, false, true, false, true, false, B[6], M / 4, 64, 58), // Arrow made of 1/4 Ingot/Dust + Plastic Stick.
+ arrow("Arrows", "", "", false, false, true, false, false, false, false, false, true, false, B[6], -1, 64, 57),
+ toolHeadArrow("Arrow Heads", "", " Arrow Head", true, true, false, false, false, false, true, true, false, false, B[6], M / 4, 64, 46), // consisting out of 1/4 Ingot.
+ toolHeadSword("Sword Blades", "", " Sword Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 32), // consisting out of 2 Ingots.
+ toolHeadPickaxe("Pickaxe Heads", "", " Pickaxe Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 3, 16, 33), // consisting out of 3 Ingots.
+ toolHeadShovel("Shovel Heads", "", " Shovel Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 1, 16, 34), // consisting out of 1 Ingots.
+ toolHeadUniversalSpade("Universal Spade Heads", "", " Universal Spade Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 1, 16, 43), // consisting out of 1 Ingots.
+ toolHeadAxe("Axe Heads", "", " Axe Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 3, 16, 35), // consisting out of 3 Ingots.
+ toolHeadHoe("Hoe Heads", "", " Hoe Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 36), // consisting out of 2 Ingots.
+ toolHeadSense("Sense Blades", "", " Sense Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 3, 16, 44), // consisting out of 3 Ingots.
+ toolHeadFile("File Heads", "", " File Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 38), // consisting out of 2 Ingots.
+ toolHeadHammer("Hammer Heads", "", " Hammer Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots.
+ toolHeadPlow("Plow Heads", "", " Plow Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 45), // consisting out of 4 Ingots.
+ toolHeadSaw("Saw Blades", "", " Saw Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 39), // consisting out of 2 Ingots.
+ toolHeadBuzzSaw("Buzzsaw Blades", "", " Buzzsaw Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 48), // consisting out of 4 Ingots.
+ toolHeadScrewdriver("Screwdriver Tips", "", " Screwdriver Tip", true, true, false, false, false, false, true, false, false, false, B[6], M * 1, 16, 47), // consisting out of 1 Ingots.
+ toolHeadDrill("Drill Tips", "", " Drill Tip", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 40), // consisting out of 4 Ingots.
+ toolHeadChainsaw("Chainsaw Tips", "", " Chainsaw Tip", true, true, false, false, false, false, true, true, false, false, B[6], M * 2, 16, 41), // consisting out of 2 Ingots.
+ toolHeadWrench("Wrench Tips", "", " Wrench Tip", true, true, false, false, false, false, true, true, false, false, B[6], M * 4, 16, 42), // consisting out of 4 Ingots.
+ turbineBlade("Turbine Blades", "", " Turbine Blade", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 64, 100), // consisting out of 6 Ingots.
+ toolSword("Swords", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), // vanilly Sword
+ toolPickaxe("Pickaxes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 3, 1, -1), // vanilly Pickaxe
+ toolShovel("Shovels", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 1, 1, -1), // vanilly Shovel
+ toolAxe("Axes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 3, 1, -1), // vanilly Axe
+ toolHoe("Hoes", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), // vanilly Hoe
+ toolShears("Shears", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 2, 1, -1), // vanilly Shears
+ tool("Tools", "", "", false, false, false, false, false, false, false, false, true, false, B[6], -1, 1, -1), // toolPot, toolSkillet, toolSaucepan, toolBakeware, toolCuttingboard, toolMortarandpestle, toolMixingbowl, toolJuicer
+ compressedCobblestone("9^X Compressed Cobblestones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ compressedStone("9^X Compressed Stones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ compressedDirt("9^X Compressed Dirt", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ compressedGravel("9^X Compressed Gravel", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ compressedSand("9^X Compressed Sand", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ compressed("Compressed Materials", "Compressed ", "", true, true, false, false, false, false, true, false, false, false, 0, M * 3, 64, -1), // Compressed Material, worth 1 Unit. Introduced by Galacticraft
+ glass("Glasses", "", "", false, false, true, false, true, false, false, false, false, false, 0, -1, 64, -1),
+ paneGlass("Glass Panes", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ blockGlass("Glass Blocks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ blockWool("Wool Blocks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ block_("Random Blocks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // IGNORE
+ block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar
+ craftingTool("Crafting Tools", "", "", false, false, false, false, false, false, false, false, true, false, 0, -1, 64, -1), // Special Prefix used mainly for the Crafting Handler.
+ crafting("Crafting Ingredients", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Special Prefix used mainly for the Crafting Handler.
+ craft("Crafting Stuff?", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Special Prefix used mainly for the Crafting Handler.
+ log("Logs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix used for Logs. Usually as "logWood". Introduced by Eloraam
+ slab("Slabs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix used for Slabs. Usually as "slabWood" or "slabStone". Introduced by SirSengir
+ stair("Stairs", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix used for Stairs. Usually as "stairWood" or "stairStone". Introduced by SirSengir
+ fence("Fences", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Prefix used for Fences. Usually as "fenceWood". Introduced by Forge
+ plank("Planks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix for Planks. Usually "plankWood". Introduced by Eloraam
+ treeSapling("Saplings", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix for Saplings.
+ treeLeaves("Leaves", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Prefix for Leaves.
+ tree("Tree Parts", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Prefix for Tree Parts.
+ stoneCobble("Cobblestones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Cobblestone Prefix for all Cobblestones.
+ stoneSmooth("Smoothstones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Smoothstone Prefix.
+ stoneMossyBricks("mossy Stone Bricks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Mossy Stone Bricks.
+ stoneMossy("Mossy Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Mossy Cobble.
+ @Deprecated stoneBricksMossy("Mossy Stone Bricks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ stoneBricks("Stone Bricks", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Stone Bricks.
+ @Deprecated stoneBrick("Stone Bricks", "", "", false, false, false, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ stoneCracked("Cracked Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Cracked Bricks.
+ stoneChiseled("Chiseled Stones", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Chiseled Stone.
+ stone("Stones", "", "", false, true, true, false, true, true, false, false, false, false, 0, -1, 64, -1), // Prefix to determine which kind of Rock this is.
+ cobblestone("Cobblestones", "", "", false, true, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ rock("Rocks", "", "", false, true, true, false, true, true, false, false, false, false, 0, -1, 64, -1), // Prefix to determine which kind of Rock this is.
+ record("Records", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, 1, -1),
+ rubble("Rubbles", "", "", true, true, true, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ scraps("Scraps", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ scrap("Scraps", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ item_("Items", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // IGNORE
+ item("Items", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Random Item. Introduced by Alblaka
+ book("Books", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Used for Books of any kind.
+ paper("Papers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Used for Papers of any kind.
+ dye("Dyes", "", "", false, false, true, false, false, false, false, false, false, false, 0, -1, 64, -1), // Used for the 16 dyes. Introduced by Eloraam
+ stainedClay("Stained Clays", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1), // Used for the 16 colors of Stained Clay. Introduced by Forge
+ armorHelmet("Helmets", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 5, 1, -1), // vanilly Helmet
+ armorChestplate("Chestplates", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 8, 1, -1), // vanilly Chestplate
+ armorLeggings("Leggings", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 7, 1, -1), // vanilly Pants
+ armorBoots("Boots", "", "", false, true, false, false, false, false, true, false, true, false, B[6], M * 4, 1, -1), // vanilly Boots
+ armor("Armor Parts", "", "", false, false, false, false, false, false, false, false, true, false, B[6], -1, 1, -1),
+ frameGt("Frame Boxes", "", "", true, true, false, false, true, false, true, false, false, false, 0, M * 2, 64, 83),
+ pipeTiny("Tiny Pipes", "Tiny ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78),
+ pipeSmall("Small Pipes", "Small ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79),
+ pipeMedium("Medium Pipes", "Medium ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
+ pipeLarge("Large pipes", "Large ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81),
+ pipeHuge("Huge Pipes", "Huge ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82),
+ pipeQuadruple("Quadruple Pipes", "Quadruple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M *12, 64, 84),
+ pipeNonuple("Nonuple Pipes", "Nonuple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 9, 64, 85),
+ pipeRestrictiveTiny("Tiny Restrictive Pipes", "Tiny Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78),
+ pipeRestrictiveSmall("Small Restrictive Pipes", "Small Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79),
+ pipeRestrictiveMedium("Medium Restrictive Pipes", "Medium Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
+ pipeRestrictiveLarge("Large Restrictive Pipes", "Large Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81),
+ pipeRestrictiveHuge("Huge Restrictive Pipes", "Huge Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82),
+ pipe("Pipes", "", " Pipe", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, 77),
+ wireGt16("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1),
+ wireGt12("12x Wires", "12x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 6, 64, -1),
+ wireGt08("8x Wires", "8x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 4, 64, -1),
+ wireGt04("4x Wires", "4x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 2, 64, -1),
+ wireGt02("2x Wires", "2x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 1, 64, -1),
+ wireGt01("1x Wires", "1x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M / 2, 64, -1),
+ cableGt16("16x Cables", "16x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1),
+ cableGt12("12x Cables", "12x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 6, 64, -1),
+ cableGt08("8x Cables", "8x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 4, 64, -1),
+ cableGt04("4x Cables", "4x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 2, 64, -1),
+ cableGt02("2x Cables", "2x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M * 1, 64, -1),
+ cableGt01("1x Cables", "1x ", " Cable", true, true, false, false, false, false, true, false, false, false, 0, M / 2, 64, -1),
+
+ /* Electric Components.
+ *
+ * usual Materials for this are:
+ * Primitive (Tier 1)
+ * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery
+ * Good (Tier 3)
+ * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery
+ * Data (Tier 5) : Data Storage Circuit
+ * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit
+ * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal
+ * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb
+ * Infinite (Cheaty)
+ */
+ batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
+ circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
+ chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft
+ computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1), // A whole Computer. "computerMaster" = ComputerCube
+
+ // random known prefixes without special abilities.
+ skull("Skulls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ plating("Platings", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ dinosaur("Dinosaurs", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ travelgear("Travel Gear", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ bauble("Baubles", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ cluster("Clusters", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ grafter("Grafters", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ scoop("Scoops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ frame("Frames", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ tome("Tomes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ junk("Junk", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ bee("Bees", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ rod("Rods", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ dirt("Dirts", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ sand("Sands", "", "", false, false, true, false, false, true, false, false, false, false, 0, -1, 64, -1),
+ grass("Grasses", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ gravel("Gravels", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ mushroom("Mushrooms", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ wood("Woods", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Eloraam
+ drop("Drops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ fuel("Fuels", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ panel("Panels", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ brick("Bricks", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ chunk("Chunks", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ wire("Wires", "", "", false, false, false, false, true, false, false, false, false, false, 0, -1, 64, -1),
+ seed("Seeds", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ reed("Reeds", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ sheetDouble("2x Sheets", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ sheet("Sheets", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ crop("Crops", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ plant("Plants", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ coin("Coins", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ lumar("Lumars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ ground("Grounded Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ cable("Cables", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ component("Components", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ wax("Waxes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ wall("Walls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ tube("Tubes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ list("Lists", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ food("Foods", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ gear("Gears", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by SirSengir
+ coral("Corals", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ flower("Flowers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ storage("Storages", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ material("Materials", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ plasma("Plasmas", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ element("Elements", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ molecule("Molecules", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ wafer("Wafers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ orb("Orbs", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ handle("Handles", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ blade("Blades", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ head("Heads", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ motor("Motors", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ bit("Bits", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ shears("Shears", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ turbine("Turbines", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ fertilizer("Fertilizers", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ chest("Chests", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ raw("Raw Things", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ stainedGlass("Stained Glasses", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ mystic("Mystic Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ mana("Mana Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ rune("Runes", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ petal("Petals", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ pearl("Pearls", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ powder("Powders", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ soulsand("Soulsands", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ obsidian("Obsidians", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ glowstone("Glowstones", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ beans("Beans", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ br("br", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ essence("Essences", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ alloy("Alloys", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ cooking("Cooked Things", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ elven("Elven Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ reactor("Reactors", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ mffs("MFFS", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ projred("Project Red", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ ganys("Ganys Stuff", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ liquid("Liquids", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ bars("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ bar("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ toolHeadMallet("Mallet Heads", "", " Mallet Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 127), // Reverse Head consisting out of 6 Ingots.
+ handleMallet("Mallet Handle", "", " Handle", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 126); // Reverse Stick made of half an Ingot. Introduced by Eloraam
+
+ public static volatile int VERSION = 509;
+
+ static {
+ pulp.mPrefixInto = dust;
+ oreGem.mPrefixInto = ore;
+ leaves.mPrefixInto = treeLeaves;
+ sapling.mPrefixInto = treeSapling;
+ itemDust.mPrefixInto = dust;
+ dustDirty.mPrefixInto = dustImpure;
+ denseore.mPrefixInto = oreDense;
+ ingotQuad.mPrefixInto = ingotQuadruple;
+ plateQuad.mPrefixInto = plateQuadruple;
+ stoneBrick.mPrefixInto = stoneBricks;
+ stoneBricksMossy.mPrefixInto = stoneMossyBricks;
+
+ ingotHot.mHeatDamage = 3.0F;
+ cellMolten.mHeatDamage=3;
+ cellPlasma.mHeatDamage = 6.0F;
+
+ block.ignoreMaterials(Materials.Ice, Materials.Snow, Materials.Concrete, Materials.Glass, Materials.Glowstone, Materials.DarkIron, Materials.Marble, Materials.Quartz, Materials.CertusQuartz, Materials.Limestone);
+ ingot.ignoreMaterials(Materials.Brick, Materials.NetherBrick);
+
+ dust.addFamiliarPrefix(dustTiny);
+ dust.addFamiliarPrefix(dustSmall);
+ dustTiny.addFamiliarPrefix(dust);
+ dustTiny.addFamiliarPrefix(dustSmall);
+ dustSmall.addFamiliarPrefix(dust);
+ dustSmall.addFamiliarPrefix(dustTiny);
+
+ ingot.addFamiliarPrefix(nugget);
+ nugget.addFamiliarPrefix(ingot);
+
+ for (OrePrefixes tPrefix1 : values())
+ if (tPrefix1.name().startsWith("ore"))
+ for (OrePrefixes tPrefix2 : values())
+ if (tPrefix2.name().startsWith("ore"))
+ tPrefix1.addFamiliarPrefix(tPrefix2);
+ for (OrePrefixes tPrefix1 : values())
+ if (tPrefix1.name().startsWith("pipe"))
+ for (OrePrefixes tPrefix2 : values())
+ if (tPrefix2.name().startsWith("pipe"))
+ tPrefix1.addFamiliarPrefix(tPrefix2);
+ for (OrePrefixes tPrefix1 : values())
+ if (tPrefix1.name().startsWith("wireGt"))
+ for (OrePrefixes tPrefix2 : values())
+ if (tPrefix2.name().startsWith("wireGt"))
+ tPrefix1.addFamiliarPrefix(tPrefix2);
+ for (OrePrefixes tPrefix1 : values())
+ if (tPrefix1.name().startsWith("cableGt")) for (OrePrefixes tPrefix2 : values())
+ if (tPrefix2.name().startsWith("cableGt")) tPrefix1.addFamiliarPrefix(tPrefix2);
+
+ // These are only the important ones.
+ gem.mNotGeneratedItems.add(Materials.Coal);
+ gem.mNotGeneratedItems.add(Materials.Charcoal);
+ gem.mNotGeneratedItems.add(Materials.NetherStar);
+ gem.mNotGeneratedItems.add(Materials.Diamond);
+ gem.mNotGeneratedItems.add(Materials.Emerald);
+ gem.mNotGeneratedItems.add(Materials.NetherQuartz);
+ gem.mNotGeneratedItems.add(Materials.EnderPearl);
+ gem.mNotGeneratedItems.add(Materials.EnderEye);
+ gem.mNotGeneratedItems.add(Materials.Flint);
+ gem.mNotGeneratedItems.add(Materials.Lapis);
+ dust.mNotGeneratedItems.add(Materials.Bone);
+ dust.mNotGeneratedItems.add(Materials.Redstone);
+ dust.mNotGeneratedItems.add(Materials.Glowstone);
+ dust.mNotGeneratedItems.add(Materials.Gunpowder);
+ dust.mNotGeneratedItems.add(Materials.Sugar);
+ dust.mNotGeneratedItems.add(Materials.Blaze);
+ //dust.mNotGeneratedItems.add(Materials.Ichorium);
+ //dustSmall.mNotGeneratedItems.add(Materials.Ichorium);
+ //dustTiny.mNotGeneratedItems.add(Materials.Ichorium);
+ stick.mNotGeneratedItems.add(Materials.Wood);
+ stick.mNotGeneratedItems.add(Materials.Bone);
+ stick.mNotGeneratedItems.add(Materials.Blaze);
+ ingot.mNotGeneratedItems.add(Materials.Iron);
+ ingot.mNotGeneratedItems.add(Materials.Gold);
+ ingot.mNotGeneratedItems.add(Materials.Brick);
+ ingot.mNotGeneratedItems.add(Materials.BrickNether);
+ ingot.mNotGeneratedItems.add(Materials.WoodSealed);
+ ingot.mNotGeneratedItems.add(Materials.Wood);
+ //ingot.mNotGeneratedItems.add(Materials.Ichorium);
+ nugget.mNotGeneratedItems.add(Materials.Gold);
+ plate.mNotGeneratedItems.add(Materials.Paper);
+ cell.mNotGeneratedItems.add(Materials.Empty);
+ cell.mNotGeneratedItems.add(Materials.Water);
+ cell.mNotGeneratedItems.add(Materials.Lava);
+ cell.mNotGeneratedItems.add(Materials.ConstructionFoam);
+ cell.mNotGeneratedItems.add(Materials.UUMatter);
+ cell.mNotGeneratedItems.add(Materials.CoalFuel);
+ bucket.mNotGeneratedItems.add(Materials.Empty);
+ bucket.mNotGeneratedItems.add(Materials.Lava);
+ bucket.mNotGeneratedItems.add(Materials.Milk);
+ bucket.mNotGeneratedItems.add(Materials.Water);
+ bottle.mNotGeneratedItems.add(Materials.Empty);
+ bottle.mNotGeneratedItems.add(Materials.Water);
+ bottle.mNotGeneratedItems.add(Materials.Milk);
+ block.mNotGeneratedItems.add(Materials.Iron);
+ block.mNotGeneratedItems.add(Materials.Gold);
+ block.mNotGeneratedItems.add(Materials.Lapis);
+ block.mNotGeneratedItems.add(Materials.Emerald);
+ block.mNotGeneratedItems.add(Materials.Redstone);
+ block.mNotGeneratedItems.add(Materials.Diamond);
+ block.mNotGeneratedItems.add(Materials.Coal);
+ toolHeadArrow.mNotGeneratedItems.add(Materials.Glass);
+
+ //-----
+
+ dustImpure.mGeneratedItems.add(Materials.GraniteRed);
+ dustImpure.mGeneratedItems.add(Materials.GraniteBlack);
+ dustImpure.mGeneratedItems.add(Materials.Quartzite);
+ dustImpure.mGeneratedItems.add(Materials.Flint);
+ dustImpure.mGeneratedItems.add(Materials.Redrock);
+ dustImpure.mGeneratedItems.add(Materials.Basalt);
+ dustImpure.mGeneratedItems.add(Materials.Marble);
+ dustImpure.mGeneratedItems.add(Materials.Netherrack);
+ dustImpure.mGeneratedItems.add(Materials.Endstone);
+ dustImpure.mGeneratedItems.add(Materials.Stone);
+
+ plate.mGeneratedItems.add(Materials.Redstone);
+ plate.mGeneratedItems.add(Materials.Concrete);
+ plate.mGeneratedItems.add(Materials.GraniteRed);
+ plate.mGeneratedItems.add(Materials.GraniteBlack);
+ plate.mGeneratedItems.add(Materials.Basalt);
+ plate.mGeneratedItems.add(Materials.Marble);
+ plate.mGeneratedItems.add(Materials.Glowstone);
+ plate.mGeneratedItems.add(Materials.Electrotine);
+ plate.mGeneratedItems.add(Materials.Obsidian);
+
+ plate.mGeneratedItems.add(Materials.Paper);
+ plateDouble.mGeneratedItems.add(Materials.Paper);
+ plateTriple.mGeneratedItems.add(Materials.Paper);
+ plateQuadruple.mGeneratedItems.add(Materials.Paper);
+ plateQuintuple.mGeneratedItems.add(Materials.Paper);
+ ring.mGeneratedItems.add(Materials.Paper);
+
+ lens.mGeneratedItems.add(Materials.EnderPearl);
+ lens.mGeneratedItems.add(Materials.EnderEye);
+
+ stickLong.mGeneratedItems.add(Materials.Blaze);
+
+ //-----
+
+ dust.mGeneratedItems.addAll(dustPure.mGeneratedItems);
+ dust.mGeneratedItems.addAll(dustImpure.mGeneratedItems);
+ dust.mGeneratedItems.addAll(dustRefined.mGeneratedItems);
+ dustTiny.mGeneratedItems.addAll(dust.mGeneratedItems);
+ dustSmall.mGeneratedItems.addAll(dust.mGeneratedItems);
+ crateGtDust.mGeneratedItems.addAll(dust.mGeneratedItems);
+ crateGtIngot.mGeneratedItems.addAll(ingot.mGeneratedItems);
+ crateGtGem.mGeneratedItems.addAll(gem.mGeneratedItems);
+ crateGtPlate.mGeneratedItems.addAll(plate.mGeneratedItems);
+ itemCasing.mGeneratedItems.addAll(itemCasing.mGeneratedItems);
+ //-----
+
+ toolHeadFile.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+ toolHeadSaw.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+ toolHeadDrill.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+ toolHeadChainsaw.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+ toolHeadWrench.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+ toolHeadBuzzSaw.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+ turbineBlade.mCondition = new ICondition.And<ISubTagContainer>(new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY));
+
+ rotor.mCondition = new ICondition.Nor<ISubTagContainer>(SubTag.CRYSTAL, SubTag.STONE, SubTag.BOUNCY);
+
+ spring.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.STRETCHY, SubTag.BOUNCY, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
+ springSmall.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.STRETCHY, SubTag.BOUNCY, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
+
+ gemChipped.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
+ gemFlawed.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
+ gemFlawless.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
+ gemExquisite.mCondition = new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.CRYSTAL, new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), new ICondition.Not<ISubTagContainer>(SubTag.PEARL), new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL));
+
+ lens.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.MAGICAL, new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.HAS_COLOR));
+
+ plateDouble.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
+ plateTriple.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
+ plateQuadruple.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
+ plateQuintuple.mCondition = new ICondition.Or<ISubTagContainer>(SubTag.PAPER, new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING));
+
+ plateDense.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
+
+ ingotDouble.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
+ ingotTriple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
+ ingotQuadruple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
+ ingotQuintuple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING);
+
+ wireFine.mCondition = SubTag.METAL;
+
+ //-----
+
+ pipeRestrictiveTiny.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount);
+ pipeRestrictiveSmall.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 2);
+ pipeRestrictiveMedium.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 3);
+ pipeRestrictiveLarge.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 4);
+ pipeRestrictiveHuge.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount * 5);
+ cableGt12.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 5);
+ cableGt12.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 4);
+ cableGt08.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 3);
+ cableGt04.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount * 2);
+ cableGt02.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount);
+ cableGt01.mSecondaryMaterial = new MaterialStack(Materials.Rubber, plate.mMaterialAmount);
+ bucket.mSecondaryMaterial = new MaterialStack(Materials.Iron, ingot.mMaterialAmount * 3);
+ cell.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellPlasma.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellMolten.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ oreRedgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteRed, dust.mMaterialAmount);
+ oreBlackgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteBlack, dust.mMaterialAmount);
+ oreNetherrack.mSecondaryMaterial = new MaterialStack(Materials.Netherrack, dust.mMaterialAmount);
+ oreNether.mSecondaryMaterial = new MaterialStack(Materials.Netherrack, dust.mMaterialAmount);
+ oreEndstone.mSecondaryMaterial = new MaterialStack(Materials.Endstone, dust.mMaterialAmount);
+ oreEnd.mSecondaryMaterial = new MaterialStack(Materials.Endstone, dust.mMaterialAmount);
+ oreMarble.mSecondaryMaterial = new MaterialStack(Materials.Marble, dust.mMaterialAmount);
+ oreBasalt.mSecondaryMaterial = new MaterialStack(Materials.Basalt, dust.mMaterialAmount);
+ oreDense.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount);
+ orePoor.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
+ oreSmall.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
+ oreNormal.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
+ oreRich.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount * 2);
+ ore.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount);
+ crushed.mSecondaryMaterial = new MaterialStack(Materials.Stone, dust.mMaterialAmount);
+ toolHeadDrill.mSecondaryMaterial = new MaterialStack(Materials.Steel, plate.mMaterialAmount * 4);
+ toolHeadChainsaw.mSecondaryMaterial = new MaterialStack(Materials.Steel, plate.mMaterialAmount * 4 + ring.mMaterialAmount * 2);
+ toolHeadWrench.mSecondaryMaterial = new MaterialStack(Materials.Steel, ring.mMaterialAmount + screw.mMaterialAmount * 2);
+ arrowGtWood.mSecondaryMaterial = new MaterialStack(Materials.Wood, stick.mMaterialAmount);
+ arrowGtPlastic.mSecondaryMaterial = new MaterialStack(Materials.Plastic, stick.mMaterialAmount);
+ bulletGtSmall.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 9);
+ bulletGtMedium.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 6);
+ bulletGtLarge.mSecondaryMaterial = new MaterialStack(Materials.Brass, ingot.mMaterialAmount / 3);
+ }
+
+ public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<ItemStack>();
+ public final short mTextureIndex;
+ public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost;
+ public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem;
+ public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
+ public final Collection<OrePrefixes> mFamiliarPrefixes = new HashSet<OrePrefixes>();
+ /**
+ * Used to determine the amount of Material this Prefix contains.
+ * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot.
+ * 0 = Null
+ * Negative = Undefined Amount
+ */
+ public final long mMaterialAmount;
+ public final Collection<Materials> mDisabledItems = new HashSet<Materials>(), mNotGeneratedItems = new HashSet<Materials>(), mIgnoredMaterials = new HashSet<Materials>(), mGeneratedItems = new HashSet<Materials>();
+ private final ArrayList<IOreRecipeRegistrator> mOreProcessing = new ArrayList<IOreRecipeRegistrator>();
+ public ItemStack mContainerItem = null;
+ public ICondition<ISubTagContainer> mCondition = null;
+ public byte mDefaultStackSize = 64;
+ public MaterialStack mSecondaryMaterial = null;
+ public OrePrefixes mPrefixInto = this;
+ public float mHeatDamage = 0.0F; // Negative for Frost Damage
+ public static List<OrePrefixes> mPreventableComponents = new LinkedList<>(Arrays.asList(OrePrefixes.gem, OrePrefixes.ingotHot, OrePrefixes.ingotDouble, OrePrefixes.ingotTriple, OrePrefixes.ingotQuadruple, OrePrefixes.ingotQuintuple, OrePrefixes.plate, OrePrefixes.plateDouble, OrePrefixes.plateTriple, OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.plateDense, OrePrefixes.stick, OrePrefixes.round, OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.foil, OrePrefixes.toolHeadSword, OrePrefixes.toolHeadPickaxe, OrePrefixes.toolHeadShovel, OrePrefixes.toolHeadAxe, OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, OrePrefixes.wireFine, OrePrefixes.gearGtSmall, OrePrefixes.rotor, OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, OrePrefixes.arrowGtWood, OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gearGt, OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate, OrePrefixes.itemCasing));
+ /**
+ * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
+ */
+ public int mMaterialGenerationBits = 0;
+
+ OrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) {
+ mIsUnificatable = aIsUnificatable;
+ mIsMaterialBased = aIsMaterialBased;
+ mIsSelfReferencing = aIsSelfReferencing;
+ mIsContainer = aIsContainer;
+ mDontUnificateActively = aDontUnificateActively;
+ mIsUsedForBlocks = aIsUsedForBlocks;
+ mAllowNormalRecycling = aAllowNormalRecycling;
+ mGenerateDefaultItem = aGenerateDefaultItem;
+ mIsEnchantable = aIsEnchantable;
+ mIsUsedForOreProcessing = aIsUsedForOreProcessing;
+ mMaterialGenerationBits = aMaterialGenerationBits;
+ mMaterialAmount = aMaterialAmount;
+ mRegularLocalName = aRegularLocalName;
+ mLocalizedMaterialPre = aLocalizedMaterialPre;
+ mLocalizedMaterialPost = aLocalizedMaterialPost;
+ mDefaultStackSize = (byte) aDefaultStackSize;
+ mTextureIndex = (short) aTextureindex;
+
+ if (name().startsWith("ore")) {
+ new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("wire") || name().startsWith("cable")) {
+ new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("dust")) {
+ new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crushed")) {
+ new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("ingot") || name().startsWith("nugget")) {
+ new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("armor")) {
+ new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("stone")) {
+ new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("pipe")) {
+ new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("gear")) {
+ new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects);
+ new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("frame") || name().startsWith("plate")) {
+ new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("tool")) {
+ new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects);
+ } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) {
+ new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crate")) {
+ new TC_AspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects);
+ } else if (name().startsWith("circuit")) {
+ new TC_AspectStack(TC_Aspects.COGNITIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("computer")) {
+ new TC_AspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects);
+ } else if (name().startsWith("battery")) {
+ new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
+ }
+ }
+
+ public static void initMaterialComponents() {
+ boolean enablePerItemSettings = GregTech_API.sMaterialComponents.get("general", "enablePerItemSettings", false);
+ boolean enableUnusedPlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedPlates", false);
+ boolean enableUnusedDoubleIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedDoubleIngots", false);
+ boolean enableUnusedTripleIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedTripleIngots", false);
+ boolean enableUnusedQuadIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuadIngots", false);
+ boolean enableUnusedQuinIngots = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuinIngots", false);
+ boolean enableUnusedDoublePlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedDoublePlates", false);
+ boolean enableUnusedTriplePlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedTriplePlates", false);
+ boolean enableUnusedQuadPlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuadPlates", false);
+ boolean enableUnusedQuinPlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedQuinPlates", false);
+ boolean enableUnusedDensePlates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedDensePlates", false);
+ boolean enableUnusedGears = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedGears", false);
+ boolean enableUnusedSmallGears = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedSmallGears", false);
+ boolean enableUnusedRings = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRings", false);
+ boolean enableUnusedSprings = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedSprings", false);
+ boolean enableUnusedSmallSprings = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedSmallSprings", false);
+ boolean enableUnusedRounds = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRounds", false);
+ boolean enableUnusedRotors = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRotors", false);
+ boolean enableUnusedFineWires = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedFineWires", false);
+ boolean enableUnusedFoil = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedFoil", false);
+ boolean enableUnusedArrows = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedArrowHeads", false);
+ boolean enableUnusedCrates = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedCrates", false);
+ boolean enableUnusedBolts = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedBolts", false);
+ boolean enableUnusedScrews = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedScrews", false);
+ boolean enableUnusedRods = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedRods", false);
+ boolean enableUnusedLongRods = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedLongRods", false);
+ boolean enableUnusedGems = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedGems", false);
+ boolean enableUnusedItemCasing = GregTech_API.sMaterialComponents.get("globalcomponents", "enableUnusedItemCasing", false);
+
+ //TODO possibly use OrePrefix mNotGeneratedItems/mGeneratedItems instead of a static List for every material instance?
+ //TODO Make sure stuff like gem plates / standard plates / paper plates all generate with the current condition
+ for (Materials aMaterial : Materials.values()) {
+ if (aMaterial.mMetaItemSubID > 0) {
+ if (aMaterial.mBlastFurnaceTemp <= 1750) ingotHot.mDisabledItems.add(aMaterial); //Moved HotIngot code from GT_MetaGenerated_Item_01 so all this is in once place
+ if (!enableUnusedSprings && (aMaterial != Materials.Titanium)) spring.mDisabledItems.add(aMaterial);
+ if (!enableUnusedSmallSprings) springSmall.mDisabledItems.add(aMaterial);
+ if (!enableUnusedRounds && !(aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium || aMaterial == Materials.HSSG)) round.mDisabledItems.add(aMaterial);
+ if (!enableUnusedCrates) {
+ if (!(aMaterial == Materials.DamascusSteel || aMaterial == Materials.Steel || aMaterial == Materials.Bronze || aMaterial == Materials.Manganese))
+ crateGtIngot.mDisabledItems.add(aMaterial);
+ if (!(aMaterial == Materials.Neodymium || aMaterial == Materials.Chrome))
+ crateGtDust.mDisabledItems.add(aMaterial);
+ crateGtGem.mDisabledItems.add(aMaterial);
+ crateGtPlate.mDisabledItems.add(aMaterial);
+ }
+ if (!enableUnusedArrows) {
+ toolHeadArrow.mDisabledItems.add(aMaterial);
+ arrowGtPlastic.mDisabledItems.add(aMaterial);
+ if (!(aMaterial == Materials.DamascusSteel || aMaterial == Materials.SterlingSilver))
+ arrowGtWood.mDisabledItems.add(aMaterial);
+ }
+ //Plates
+ if (!enableUnusedPlates && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Silicon || aMaterial == Materials.Zinc ||
+ aMaterial == Materials.Europium || aMaterial == Materials.Americium || aMaterial == Materials.RedAlloy || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.BatteryAlloy ||
+ aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Firestone || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.YttriumBariumCuprate ||
+ aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.CertusQuartz || aMaterial == Materials.NetherQuartz || aMaterial == Materials.Lazurite || aMaterial == Materials.Lapis ||
+ aMaterial == Materials.Paper || aMaterial == Materials.Jasper || aMaterial == Materials.Dilithium || aMaterial == Materials.Forcicium || aMaterial == Materials.Forcillium ||
+ aMaterial == Materials.EnderPearl || aMaterial == Materials.EnderEye || aMaterial == Materials.Glass || aMaterial == Materials.Copper || aMaterial == Materials.Tin || aMaterial == Materials.Redstone ||
+ aMaterial == Materials.Sodalite || aMaterial == Materials.Gallium || aMaterial == Materials.GalliumArsenide || aMaterial == Materials.IndiumGalliumPhosphide))
+ plate.mDisabledItems.add(aMaterial);
+ //Ingot/Plate Storage
+ if (!enableUnusedDoubleIngots) ingotDouble.mDisabledItems.add(aMaterial);
+ if (!enableUnusedTripleIngots) ingotTriple.mDisabledItems.add(aMaterial);
+ if (!enableUnusedQuadIngots) ingotQuadruple.mDisabledItems.add(aMaterial);
+ if (!enableUnusedQuinIngots) ingotQuintuple.mDisabledItems.add(aMaterial);
+ if (!enableUnusedDoublePlates && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Paper || aMaterial == Materials.Aluminium || aMaterial == Materials.Steel || aMaterial == Materials.TungstenSteel))
+ plateDouble.mDisabledItems.add(aMaterial);
+ if (!enableUnusedTriplePlates && !(aMaterial == Materials.Paper)) plateTriple.mDisabledItems.add(aMaterial);
+ if (!enableUnusedQuadPlates && !(aMaterial == Materials.Paper)) plateQuadruple.mDisabledItems.add(aMaterial);
+ if (!enableUnusedQuinPlates && !(aMaterial == Materials.Paper)) plateQuintuple.mDisabledItems.add(aMaterial);
+ if (!(enableUnusedDensePlates || GregTech_API.mGTPlusPlus) && !(aMaterial == Materials.Iron || aMaterial == Materials.Copper || aMaterial == Materials.Lead || aMaterial == Materials.Paper))
+ plateDense.mDisabledItems.add(aMaterial);
+ //Rotors
+ if (!enableUnusedRotors && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Tin || aMaterial == Materials.Osmium ||
+ aMaterial == Materials.Iridium || aMaterial == Materials.Bronze || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
+ aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium))
+ rotor.mDisabledItems.add(aMaterial);
+ //Rings
+ if (!enableUnusedRings && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron || aMaterial == Materials.Tin ||
+ aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron ||
+ aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel || aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel ||
+ aMaterial == Materials.Rubber || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium || aMaterial == Materials.HSSG || aMaterial == Materials.Aluminium ||
+ aMaterial == Materials.Invar || aMaterial == Materials.Brass || aMaterial == Materials.Paper || aMaterial == Materials.Silicone || aMaterial == Materials.StyreneButadieneRubber))
+ ring.mDisabledItems.add(aMaterial);
+ //Foil
+ if (!enableUnusedFoil && !(aMaterial == Materials.Zinc || aMaterial == Materials.Aluminium || aMaterial == Materials.Silicon || aMaterial == Materials.Gold ||
+ aMaterial == Materials.Electrum || aMaterial == Materials.Platinum || aMaterial == Materials.Osmiridium || aMaterial == Materials.Osmium ||
+ aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Steel || aMaterial == Materials.Copper || aMaterial == Materials.YttriumBariumCuprate
+ || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.Naquadah || aMaterial == Materials.Manganese ||
+ aMaterial == Materials.Plastic || aMaterial == Materials.Silicone || aMaterial == Materials.PolyvinylChloride || aMaterial == Materials.PolyphenyleneSulfide ||
+ aMaterial == Materials.Nichrome || aMaterial == Materials.BlackSteel || aMaterial == Materials.Titanium || aMaterial == Materials.TungstenSteel ||
+ aMaterial == Materials.Tungsten || aMaterial == Materials.HSSG || aMaterial == Materials.NaquadahAlloy || aMaterial == Materials.Duranium ||
+ aMaterial == Materials.Europium))
+ foil.mDisabledItems.add(aMaterial);
+ //Fine Wire
+ if (!enableUnusedFineWires && !(aMaterial == Materials.Steel || aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Platinum || aMaterial == Materials.Osmium ||
+ aMaterial == Materials.Tin || aMaterial == Materials.Lead || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.Copper || aMaterial == Materials.Electrum ||
+ aMaterial == Materials.Gold || aMaterial == Materials.RedAlloy || aMaterial == Materials.Graphene || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.YttriumBariumCuprate ))
+ wireFine.mDisabledItems.add(aMaterial);
+ //Gears
+ if (!enableUnusedGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium || aMaterial == Materials.Iron || aMaterial == Materials.Copper ||
+ aMaterial == Materials.Tin || aMaterial == Materials.Gold || aMaterial == Materials.Stone || aMaterial == Materials.Bronze ||
+ aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel || aMaterial == Materials.TungstenSteel || aMaterial == Materials.CobaltBrass ||
+ aMaterial == Materials.Diamond || aMaterial == Materials.Wood || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium))
+ gearGt.mDisabledItems.add(aMaterial);
+ //Small Gears
+ if (!enableUnusedSmallGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
+ aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE || aMaterial == Materials.Neutronium))
+ gearGtSmall.mDisabledItems.add(aMaterial);
+ //Bolts
+ if (!enableUnusedBolts && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron ||
+ aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Neutronium ||
+ aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
+ aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel || aMaterial == Materials.Tungsten || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG))
+ bolt.mDisabledItems.add(aMaterial);
+ //Screws
+ if (!enableUnusedScrews && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron ||
+ aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Neutronium ||
+ aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
+ aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG))
+ screw.mDisabledItems.add(aMaterial);
+ //Rods
+ if (!enableUnusedRods && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.Chrome || aMaterial == Materials.Iron ||
+ aMaterial == Materials.Tin || aMaterial == Materials.Osmium || aMaterial == Materials.Iridium || aMaterial == Materials.Neutronium ||
+ aMaterial == Materials.Bronze || aMaterial == Materials.WroughtIron || aMaterial == Materials.Steel || aMaterial == Materials.StainlessSteel ||
+ aMaterial == Materials.PigIron || aMaterial == Materials.TungstenSteel || aMaterial == Materials.HSSE || aMaterial == Materials.HSSG ||
+ aMaterial == Materials.Aluminium || aMaterial == Materials.Copper || aMaterial == Materials.Neodymium || aMaterial == Materials.Europium ||
+ aMaterial == Materials.Platinum || aMaterial == Materials.Gold || aMaterial == Materials.Uranium235 || aMaterial == Materials.Plutonium241 ||
+ aMaterial == Materials.Americium || aMaterial == Materials.Neutronium || aMaterial == Materials.Bronze || aMaterial == Materials.Brass ||
+ aMaterial == Materials.Electrum || aMaterial == Materials.NaquadahEnriched || aMaterial == Materials.CobaltBrass || aMaterial == Materials.IronMagnetic ||
+ aMaterial == Materials.SteelMagnetic || aMaterial == Materials.NeodymiumMagnetic || aMaterial == Materials.Samarium || aMaterial == Materials.SamariumMagnetic || aMaterial == Materials.VanadiumGallium || aMaterial == Materials.Diamond ||
+ aMaterial == Materials.Wood || aMaterial == Materials.Plastic || aMaterial == Materials.Lead || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.Lapis ||
+ aMaterial == Materials.Lazurite || aMaterial == Materials.Sodalite|| aMaterial == Materials.PolyvinylChloride))
+ stick.mDisabledItems.add(aMaterial);
+ //Long Rods
+ if (!enableUnusedLongRods && ((aMaterial.mTypes & 0x40) == 0) && !(aMaterial == Materials.Titanium || aMaterial == Materials.NeodymiumMagnetic || aMaterial == Materials.SamariumMagnetic || aMaterial == Materials.HSSG || aMaterial == Materials.HSSE ||
+ aMaterial == Materials.Neutronium || aMaterial == Materials.Americium || aMaterial == Materials.WroughtIron || aMaterial == Materials.Magnalium ||
+ aMaterial == Materials.TungstenSteel))
+ stickLong.mDisabledItems.add(aMaterial);
+
+ if (!enableUnusedGems && ((aMaterial.mTypes & 0x04) == 0)) {
+ gem.mDisabledItems.add(aMaterial);
+ gemChipped.mDisabledItems.add(aMaterial);
+ gemFlawless.mDisabledItems.add(aMaterial);
+ gemFlawed.mDisabledItems.add(aMaterial);
+ gemExquisite.mDisabledItems.add(aMaterial);
+ }
+ //itemCasing
+ if (!enableUnusedItemCasing) itemCasing.mDisabledItems.add(aMaterial);
+ }
+ }
+ for (IMaterialHandler aRegistrator : Materials.mMaterialHandlers) {
+ aRegistrator.onComponentInit();
+ }
+ for (Materials aMaterial : Materials.values()) {
+ if (aMaterial.mMetaItemSubID > 0) {
+ for (IMaterialHandler aRegistrator : Materials.mMaterialHandlers) {
+ aRegistrator.onComponentIteration(aMaterial);
+ }
+ if (enablePerItemSettings) {
+ StringBuilder aConfigPathSB = new StringBuilder();
+ aConfigPathSB.append("materialcomponents.").append(aMaterial.mConfigSection).append(".").append(aMaterial.mName);
+ String aConfigPath = aConfigPathSB.toString();
+ for (OrePrefixes aPrefix : mPreventableComponents) {
+ boolean aEnableComponent = GregTech_API.sMaterialComponents.get(aConfigPath, aPrefix.toString(), !aPrefix.mDisabledItems.contains(aMaterial));
+ if (!aEnableComponent) { //Disable component if false and is not already in disabled list
+ aPrefix.disableComponent(aMaterial);
+ } else if (aEnableComponent) { //Enable component if true and is not already in enabled list
+ aPrefix.enableComponent(aMaterial);
+ }
+ }
+ aConfigPathSB.setLength(0);
+ }
+ }
+ }
+ }
+
+ public static boolean isInstanceOf(String aName, OrePrefixes aPrefix) {
+ return aName != null && aName.startsWith(aPrefix.toString());
+ }
+
+ public void disableComponent(Materials aMaterial) {
+ if (!this.mDisabledItems.contains(aMaterial)) this.mDisabledItems.add(aMaterial);
+ }
+
+ public static OrePrefixes getOrePrefix(String aOre) {
+ for (OrePrefixes tPrefix : values())
+ if (aOre.startsWith(tPrefix.toString())) {
+ if (tPrefix == oreNether && aOre.equals("oreNetherQuartz")) return ore;
+ if (tPrefix == oreNether && aOre.equals("oreNetherStar")) return ore;
+ if (tPrefix == oreBasalt && aOre.equals("oreBasalticMineralSand")) return ore;
+ return tPrefix;
+ }
+ return null;
+ }
+
+ public static String stripPrefix(String aOre) {
+ for (OrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), "");
+ }
+ }
+ return aOre;
+ }
+
+ public static String replacePrefix(String aOre, OrePrefixes aPrefix) {
+ for (OrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
+ }
+ }
+ return "";
+ }
+
+ public static OrePrefixes getPrefix(String aPrefixName) {
+ return getPrefix(aPrefixName, null);
+ }
+
+ public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) {
+ Object tObject = GT_Utility.getFieldContent(OrePrefixes.class, aPrefixName, false, false);
+ if (tObject instanceof OrePrefixes) return (OrePrefixes) tObject;
+ return aReplacement;
+ }
+
+ public static Materials getMaterial(String aOre) {
+ return Materials.get(stripPrefix(aOre));
+ }
+
+ public static Materials getMaterial(String aOre, OrePrefixes aPrefix) {
+ return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static Materials getRealMaterial(String aOre, OrePrefixes aPrefix) {
+ return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public void enableComponent(Materials aMaterial) {
+ this.mDisabledItems.remove(aMaterial);
+ }
+
+ public boolean add(ItemStack aStack) {
+ if (aStack == null) return false;
+ if (!contains(aStack)) {
+ mPrefixedItems.add(aStack);
+ // It's now in there... so update the cache
+ getSet(this.toString().toUpperCase()).put(Objects.hashCode(aStack.getItem(), aStack.getItemDamage()), true);
+ }
+ while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null);
+ return true;
+ }
+
+ private static final LinkedHashMap<String, ObjMap<Integer, Boolean>>mCachedResults = new LinkedHashMap<String, ObjMap<Integer, Boolean>>();
+
+ private ObjMap<Integer, Boolean> getSet(final String prefix) {
+ ObjMap<Integer, Boolean> foundSet = mCachedResults.get(prefix);
+ if (foundSet == null){
+ foundSet = new ObjMap<Integer, Boolean>(512, 0.5f);
+ mCachedResults.put(prefix, foundSet);
+ }
+
+ return foundSet;
+ }
+
+ public boolean contains(ItemStack aStack) {
+ if (aStack == null) {
+ return false;
+ }
+
+ final ObjMap<Integer, Boolean> aCurrentSet = getSet(this.toString().toUpperCase());
+ final Boolean result = aCurrentSet.get(Objects.hashCode(aStack.getItem(), aStack.getItemDamage()));
+
+ if (result != null) {
+ return result;
+ }
+
+ return false;
+ }
+
+ public boolean containsUnCached(ItemStack aStack) {
+ // In case someone needs this
+ for (ItemStack tStack : mPrefixedItems){
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean doGenerateItem(Materials aMaterial) {
+ return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial) /*|| mDynamicItems.contains(aMaterial)*/) && !mNotGeneratedItems.contains(aMaterial) && !mDisabledItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial));
+ }
+
+ public boolean ignoreMaterials(Materials... aMaterials) {
+ for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial);
+ return true;
+ }
+
+ public boolean isIgnored(Materials aMaterial) {
+ if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true;
+ return mIgnoredMaterials.contains(aMaterial);
+ }
+
+ public boolean addFamiliarPrefix(OrePrefixes aPrefix) {
+ if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false;
+ return mFamiliarPrefixes.add(aPrefix);
+ }
+
+ public boolean add(IOreRecipeRegistrator aRegistrator) {
+ if (aRegistrator == null) return false;
+ return mOreProcessing.add(aRegistrator);
+ }
+
+ public void processOre(Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if (aMaterial != null && (aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack)) {
+ //if (Materials.mPreventableComponents.contains(this) && !this.mDynamicItems.contains(aMaterial)) return;
+ for (IOreRecipeRegistrator tRegistrator : mOreProcessing) {
+ if (D2) GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.mName + "' at " + GT_Utility.getClassName(tRegistrator));
+ tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
+ }
+ }
+ }
+
+ public Object get(Object aMaterial) {
+ if (aMaterial instanceof Materials) return new ItemData(this, (Materials) aMaterial);
+ return name() + aMaterial;
+ }
+
+ public String getDefaultLocalNameForItem(Materials aMaterial) {
+ return aMaterial.getDefaultLocalizedNameForItem(getDefaultLocalNameFormatForItem(aMaterial));
+ }
+
+ @SuppressWarnings("incomplete-switch")
+ public String getDefaultLocalNameFormatForItem(Materials aMaterial) {
+ // Certain Materials have slightly different Localizations.
+ switch (this) {
+ case crateGtDust:
+ return mLocalizedMaterialPre + OrePrefixes.dust.getDefaultLocalNameFormatForItem(aMaterial);
+ case crateGtIngot:
+ return mLocalizedMaterialPre + OrePrefixes.ingot.getDefaultLocalNameFormatForItem(aMaterial);
+ case crateGtGem:
+ return mLocalizedMaterialPre + OrePrefixes.gem.getDefaultLocalNameFormatForItem(aMaterial);
+ case crateGtPlate:
+ return mLocalizedMaterialPre + OrePrefixes.plate.getDefaultLocalNameFormatForItem(aMaterial);
+ case cellMolten:
+ }
+ switch (aMaterial.mName) {
+ case "Glass":
+ case "BorosilicateGlass":
+ if (name().startsWith("gem")) return mLocalizedMaterialPre + "%material" + " Crystal";
+ if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Pane";
+ if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material" + " Bar";
+ if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip";
+ break;
+ case "Wheat":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "Flour";
+ break;
+ case "Ice":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "Crushed Ice";
+ break;
+ case "Wood":
+ case "WoodSealed":
+ if (name().startsWith("bolt")) return "Short " + "%material" + " Stick";
+ if (name().startsWith("stick")) return mLocalizedMaterialPre + "%material" + " Stick";
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Pulp";
+ if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip";
+ if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Plank";
+ break;
+ case "Plastic":
+ case "Rubber":
+ case "Polyethylene":
+ case "Epoxid":
+ case "EpoxidFiberReinforced":
+ case "Polydimethylsiloxane":
+ case "Silicone":
+ case "Polysiloxane":
+ case "Polycaprolactam":
+ case "Polytetrafluoroethylene":
+ case "PolyvinylChloride":
+ case "Polystyrene":
+ case "StyreneButadieneRubber":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Pulp";
+ if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Sheet";
+ if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material" + " Bar";
+ if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip";
+ if (name().startsWith("foil")) return "Thin " + "%material" + " Sheet";
+ break;
+ case "FierySteel":
+ if (mIsContainer) return mLocalizedMaterialPre + "Fiery Blood" + mLocalizedMaterialPost;
+ break;
+ case "Steeleaf":
+ if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material";
+ break;
+ case "Bone":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "Bone Meal";
+ break;
+ case "Blaze":
+ case "Milk":
+ case "Cocoa":
+ case "Chocolate":
+ case "Coffee":
+ case "Chili":
+ case "Cheese":
+ case "Snow":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Powder";
+ break;
+ case "Paper":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "Chad";
+ switch (this) {
+ case plate: return "Sheet of Paper";
+ case plateDouble: return "Paperboard";
+ case plateTriple: return "Carton";
+ case plateQuadruple: return "Cardboard";
+ case plateQuintuple: return "Thick Cardboard";
+ case plateDense: return "Strong Cardboard";
+ }
+ break;
+ case "MeatRaw":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "Mince Meat";
+ break;
+ case "MeatCooked":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "Cooked Mince Meat";
+ break;
+ case "Ash":
+ case "DarkAsh":
+ case "Gunpowder":
+ case "Sugar":
+ case "Salt":
+ case "RockSalt":
+ case "VolcanicAsh":
+ case "RareEarth":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material";
+ break;
+ case "Vermiculite":
+ case "Bentonite":
+ case "Kaolinite":
+ case "Talc":
+ case "BasalticMineralSand":
+ case "GraniticMineralSand":
+ case "GlauconiteSand":
+ case "CassiteriteSand":
+ case "GarnetSand":
+ case "QuartzSand":
+ case "Pitchblende":
+ case "FullersEarth":
+ if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material";
+ switch (this) {
+ case crushedCentrifuged:
+ case crushedPurified:
+ return mLocalizedMaterialPre + "%material";
+ case crushed:
+ return "Ground " + "%material";
+ }
+ break;
+ }
+ if (ProcessingModSupport.aEnableThaumcraftMats) {
+ switch (aMaterial.mName) {
+ case "InfusedAir":
+ case "InfusedDull":
+ case "InfusedEarth":
+ case "InfusedEntropy":
+ case "InfusedFire":
+ case "InfusedOrder":
+ case "InfusedVis":
+ case "InfusedWater":
+ if (name().startsWith("gem")) return mLocalizedMaterialPre + "Shard of " + "%material";
+ if (name().startsWith("crystal")) return mLocalizedMaterialPre + "Shard of " + "%material";
+ if (name().startsWith("plate"))
+ return mLocalizedMaterialPre + "%material" + " Crystal Plate";
+ if (name().startsWith("dust"))
+ return mLocalizedMaterialPre + "%material" + " Crystal Powder";
+ switch (this) {
+ case crushedCentrifuged:
+ case crushedPurified:
+ case crushed:
+ return mLocalizedMaterialPre + "%material" + " Crystals";
+ }
+ break;
+ }
+ }
+ // Use Standard Localization
+ return mLocalizedMaterialPre + "%material" + mLocalizedMaterialPost;
+ }
+}
diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java
index faca880a0b..38a96bb4ac 100644
--- a/src/main/java/gregtech/api/enums/TextureSet.java
+++ b/src/main/java/gregtech/api/enums/TextureSet.java
@@ -1,184 +1,184 @@
-package gregtech.api.enums;
-
-import gregtech.api.interfaces.IIconContainer;
-
-public class TextureSet {
- public static final TextureSet
- SET_NONE = new TextureSet("NONE"),
- SET_DULL = new TextureSet("DULL"),
- SET_RUBY = new TextureSet("RUBY"),
- SET_OPAL = new TextureSet("OPAL"),
- SET_LEAF = new TextureSet("LEAF"),
- SET_WOOD = new TextureSet("WOOD"),
- SET_SAND = new TextureSet("SAND"),
- SET_FINE = new TextureSet("FINE"),
- SET_FIERY = new TextureSet("FIERY"),
- SET_FLUID = new TextureSet("FLUID"),
- SET_ROUGH = new TextureSet("ROUGH"),
- SET_PAPER = new TextureSet("PAPER"),
- SET_GLASS = new TextureSet("GLASS"),
- SET_FLINT = new TextureSet("FLINT"),
- SET_LAPIS = new TextureSet("LAPIS"),
- SET_SHINY = new TextureSet("SHINY"),
- SET_SHARDS = new TextureSet("SHARDS"),
- SET_POWDER = new TextureSet("POWDER"),
- SET_QUARTZ = new TextureSet("QUARTZ"),
- SET_EMERALD = new TextureSet("EMERALD"),
- SET_DIAMOND = new TextureSet("DIAMOND"),
- SET_LIGNITE = new TextureSet("LIGNITE"),
- SET_MAGNETIC = new TextureSet("MAGNETIC"),
- SET_METALLIC = new TextureSet("METALLIC"),
- SET_NETHERSTAR = new TextureSet("NETHERSTAR"),
- SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL"),
- SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL");
-
- /**
- * For the Indices of OrePrefixes you need to look into the OrePrefix Enum.
- */
- public static final short
- INDEX_wire = 69,
- INDEX_foil = 70,
- INDEX_block1 = 71,
- INDEX_block2 = 72,
- INDEX_block3 = 73,
- INDEX_block4 = 74,
- INDEX_block5 = 75,
- INDEX_block6 = 76;
-
- public final IIconContainer[] mTextures = new IIconContainer[128];
- public final String mSetName;
- private final static String aTextMatIconDir = "materialicons/";
- private final static String aTextVoidDir = "/void";
-
- public TextureSet(String aSetName) {
- mSetName = aSetName;
- mTextures[0] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustTiny");
- mTextures[1] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustSmall");
- mTextures[2] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dust");
- mTextures[3] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustImpure");
- mTextures[4] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustPure");
- mTextures[5] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushed");
- mTextures[6] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedPurified");
- mTextures[7] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedCentrifuged");
- mTextures[8] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gem");
- mTextures[9] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/nugget");
- mTextures[10] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/casingSmall");
- mTextures[11] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingot");
- mTextures[12] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotHot");
- mTextures[13] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotDouble");
- mTextures[14] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotTriple");
- mTextures[15] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuadruple");
- mTextures[16] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuintuple");
- mTextures[17] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plate");
- mTextures[18] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDouble");
- mTextures[19] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateTriple");
- mTextures[20] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuadruple");
- mTextures[21] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuintuple");
- mTextures[22] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDense");
- mTextures[23] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stick");
- mTextures[24] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/lens");
- mTextures[25] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/round");
- mTextures[26] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/bolt");
- mTextures[27] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/screw");
- mTextures[28] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ring");
- mTextures[29] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
- mTextures[30] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cell");
- mTextures[31] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cellPlasma");
- mTextures[32] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSword");
- mTextures[33] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPickaxe");
- mTextures[34] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadShovel");
- mTextures[35] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadAxe");
- mTextures[36] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHoe");
- mTextures[37] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHammer");
- mTextures[38] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadFile");
- mTextures[39] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSaw");
- mTextures[40] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadDrill");
- mTextures[41] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadChainsaw");
- mTextures[42] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadWrench");
- mTextures[43] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadUniversalSpade");
- mTextures[44] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSense");
- mTextures[45] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPlow");
- mTextures[46] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadArrow");
- mTextures[47] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadScrewdriver");
- mTextures[48] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadBuzzSaw");
- mTextures[49] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSoldering");
- mTextures[50] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[51] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/wireFine");
- mTextures[52] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGtSmall");
- mTextures[53] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/rotor");
- mTextures[54] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stickLong");
- mTextures[55] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/springSmall");
- mTextures[56] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/spring");
- mTextures[57] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtWood");
- mTextures[58] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtPlastic");
- mTextures[59] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemChipped");
- mTextures[60] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawed");
- mTextures[61] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawless");
- mTextures[62] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemExquisite");
- mTextures[63] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGt");
- mTextures[64] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[65] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[66] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[67] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/oreSmall");
- mTextures[68] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/ore");
- mTextures[69] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/wire");
- mTextures[70] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
- mTextures[71] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block1");
- mTextures[72] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block2");
- mTextures[73] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block3");
- mTextures[74] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block4");
- mTextures[75] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block5");
- mTextures[76] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block6");
- mTextures[77] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSide");
- mTextures[78] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeTiny");
- mTextures[79] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSmall");
- mTextures[80] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeMedium");
- mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge");
- mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge");
- mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt");
- mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeQuadruple");
- mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeNonuple");
- mTextures[86] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[87] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[88] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[89] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[90] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[91] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[92] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[93] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[94] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[95] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[96] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtDust");
- mTextures[97] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtIngot");
- mTextures[98] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtGem");
- mTextures[99] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtPlate");
- mTextures[100] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/turbineBlade");
- mTextures[101] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[102] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[103] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[104] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[105] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[106] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[107] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[108] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[109] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[110] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[111] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[112] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[113] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[114] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[115] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[116] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[117] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[118] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[119] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[120] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[121] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[122] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[123] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[124] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[125] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
- mTextures[126] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/handleMallet");
- mTextures[127] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadMallet");
- }
+package gregtech.api.enums;
+
+import gregtech.api.interfaces.IIconContainer;
+
+public class TextureSet {
+ public static final TextureSet
+ SET_NONE = new TextureSet("NONE"),
+ SET_DULL = new TextureSet("DULL"),
+ SET_RUBY = new TextureSet("RUBY"),
+ SET_OPAL = new TextureSet("OPAL"),
+ SET_LEAF = new TextureSet("LEAF"),
+ SET_WOOD = new TextureSet("WOOD"),
+ SET_SAND = new TextureSet("SAND"),
+ SET_FINE = new TextureSet("FINE"),
+ SET_FIERY = new TextureSet("FIERY"),
+ SET_FLUID = new TextureSet("FLUID"),
+ SET_ROUGH = new TextureSet("ROUGH"),
+ SET_PAPER = new TextureSet("PAPER"),
+ SET_GLASS = new TextureSet("GLASS"),
+ SET_FLINT = new TextureSet("FLINT"),
+ SET_LAPIS = new TextureSet("LAPIS"),
+ SET_SHINY = new TextureSet("SHINY"),
+ SET_SHARDS = new TextureSet("SHARDS"),
+ SET_POWDER = new TextureSet("POWDER"),
+ SET_QUARTZ = new TextureSet("QUARTZ"),
+ SET_EMERALD = new TextureSet("EMERALD"),
+ SET_DIAMOND = new TextureSet("DIAMOND"),
+ SET_LIGNITE = new TextureSet("LIGNITE"),
+ SET_MAGNETIC = new TextureSet("MAGNETIC"),
+ SET_METALLIC = new TextureSet("METALLIC"),
+ SET_NETHERSTAR = new TextureSet("NETHERSTAR"),
+ SET_GEM_VERTICAL = new TextureSet("GEM_VERTICAL"),
+ SET_GEM_HORIZONTAL = new TextureSet("GEM_HORIZONTAL");
+
+ /**
+ * For the Indices of OrePrefixes you need to look into the OrePrefix Enum.
+ */
+ public static final short
+ INDEX_wire = 69,
+ INDEX_foil = 70,
+ INDEX_block1 = 71,
+ INDEX_block2 = 72,
+ INDEX_block3 = 73,
+ INDEX_block4 = 74,
+ INDEX_block5 = 75,
+ INDEX_block6 = 76;
+
+ public final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
+ private final static String aTextMatIconDir = "materialicons/";
+ private final static String aTextVoidDir = "/void";
+
+ public TextureSet(String aSetName) {
+ mSetName = aSetName;
+ mTextures[0] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustTiny");
+ mTextures[1] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustSmall");
+ mTextures[2] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dust");
+ mTextures[3] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustImpure");
+ mTextures[4] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/dustPure");
+ mTextures[5] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushed");
+ mTextures[6] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedPurified");
+ mTextures[7] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crushedCentrifuged");
+ mTextures[8] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gem");
+ mTextures[9] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/nugget");
+ mTextures[10] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/casingSmall");
+ mTextures[11] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingot");
+ mTextures[12] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotHot");
+ mTextures[13] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotDouble");
+ mTextures[14] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotTriple");
+ mTextures[15] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuadruple");
+ mTextures[16] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ingotQuintuple");
+ mTextures[17] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plate");
+ mTextures[18] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDouble");
+ mTextures[19] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateTriple");
+ mTextures[20] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuadruple");
+ mTextures[21] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateQuintuple");
+ mTextures[22] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/plateDense");
+ mTextures[23] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stick");
+ mTextures[24] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/lens");
+ mTextures[25] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/round");
+ mTextures[26] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/bolt");
+ mTextures[27] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/screw");
+ mTextures[28] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/ring");
+ mTextures[29] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
+ mTextures[30] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cell");
+ mTextures[31] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/cellPlasma");
+ mTextures[32] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSword");
+ mTextures[33] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPickaxe");
+ mTextures[34] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadShovel");
+ mTextures[35] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadAxe");
+ mTextures[36] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHoe");
+ mTextures[37] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadHammer");
+ mTextures[38] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadFile");
+ mTextures[39] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSaw");
+ mTextures[40] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadDrill");
+ mTextures[41] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadChainsaw");
+ mTextures[42] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadWrench");
+ mTextures[43] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadUniversalSpade");
+ mTextures[44] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSense");
+ mTextures[45] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadPlow");
+ mTextures[46] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadArrow");
+ mTextures[47] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadScrewdriver");
+ mTextures[48] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadBuzzSaw");
+ mTextures[49] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadSoldering");
+ mTextures[50] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[51] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/wireFine");
+ mTextures[52] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGtSmall");
+ mTextures[53] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/rotor");
+ mTextures[54] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/stickLong");
+ mTextures[55] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/springSmall");
+ mTextures[56] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/spring");
+ mTextures[57] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtWood");
+ mTextures[58] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/arrowGtPlastic");
+ mTextures[59] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemChipped");
+ mTextures[60] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawed");
+ mTextures[61] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemFlawless");
+ mTextures[62] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gemExquisite");
+ mTextures[63] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/gearGt");
+ mTextures[64] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[65] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[66] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[67] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/oreSmall");
+ mTextures[68] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/ore");
+ mTextures[69] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/wire");
+ mTextures[70] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/foil");
+ mTextures[71] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block1");
+ mTextures[72] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block2");
+ mTextures[73] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block3");
+ mTextures[74] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block4");
+ mTextures[75] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block5");
+ mTextures[76] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/block6");
+ mTextures[77] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSide");
+ mTextures[78] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeTiny");
+ mTextures[79] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeSmall");
+ mTextures[80] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeMedium");
+ mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge");
+ mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge");
+ mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt");
+ mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeQuadruple");
+ mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeNonuple");
+ mTextures[86] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[87] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[88] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[89] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[90] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[91] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[92] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[93] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[94] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[95] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[96] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtDust");
+ mTextures[97] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtIngot");
+ mTextures[98] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtGem");
+ mTextures[99] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/crateGtPlate");
+ mTextures[100] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/turbineBlade");
+ mTextures[101] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[102] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[103] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[104] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[105] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[106] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[107] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[108] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[109] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[110] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[111] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[112] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[113] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[114] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[115] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[116] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[117] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[118] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[119] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[120] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[121] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[122] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[123] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[124] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[125] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
+ mTextures[126] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/handleMallet");
+ mTextures[127] = new Textures.ItemIcons.CustomIcon(aTextMatIconDir + mSetName + "/toolHeadMallet");
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java
index 6468f63a2e..a813eacd57 100644
--- a/src/main/java/gregtech/api/enums/Textures.java
+++ b/src/main/java/gregtech/api/enums/Textures.java
@@ -1,1681 +1,1681 @@
-package gregtech.api.enums;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.GT_SidedTexture;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
-import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
-import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
-
-public class Textures {
- public enum BlockIcons implements IIconContainer, Runnable {
- //ADDED
- MACHINE_UEV_SIDE,
- MACHINE_UIV_SIDE,
-
- MACHINE_UMV_SIDE,
- MACHINE_UXV_SIDE,
-
- MACHINE_OPV_SIDE,
- MACHINE_MAXV_SIDE,
-
- MACHINE_UEV_TOP,
- MACHINE_UIV_TOP,
-
- MACHINE_UMV_TOP,
- MACHINE_UXV_TOP,
-
- MACHINE_OPV_TOP,
- MACHINE_MAXV_TOP,
-
- MACHINE_UEV_BOTTOM,
- MACHINE_UIV_BOTTOM,
-
- MACHINE_UMV_BOTTOM,
- MACHINE_UXV_BOTTOM,
-
- MACHINE_OPV_BOTTOM,
- MACHINE_MAXV_BOTTOM,
-
- OVERLAY_SCHEST,
- OVERLAY_STANK,
-
- MACHINE_CASING_TANK_1,
- MACHINE_CASING_TANK_2,
- MACHINE_CASING_TANK_3,
- MACHINE_CASING_TANK_4,
-
- MACHINE_CASING_TANK_5,
- MACHINE_CASING_TANK_6,
- MACHINE_CASING_TANK_7,
- MACHINE_CASING_TANK_8,
-
- MACHINE_CASING_TANK_9,
- MACHINE_CASING_TANK_10,
- MACHINE_CASING_TANK_11,
- MACHINE_CASING_TANK_12,
-
- MACHINE_CASING_TANK_13,
- MACHINE_CASING_TANK_14,
- MACHINE_CASING_TANK_15,
- MACHINE_CASING_TANK_0,
-
- BLOCK_STEELEAF,
- BLOCK_ICHORIUM,
- BLOCK_FIRESTONE,
-
- OVERLAY_ENERGY_IN_POWER,
- OVERLAY_ENERGY_OUT_POWER,
- OVERLAY_AUTOMAINTENANCE,
- OVERLAY_AUTOMAINTENANCE_IDLE,
- OVERLAY_TELEPORTER_SIDES,
-
- //
- VOID // The Empty Texture
- ,
- RENDERING_ERROR,
- PIPE_RESTRICTOR,
- INSULATION_FULL,
- INSULATION_TINY,
- INSULATION_SMALL,
- INSULATION_MEDIUM,
- INSULATION_MEDIUM_PLUS,
- INSULATION_LARGE,
- INSULATION_HUGE,
- CFOAM_FRESH,
-
- CFOAM_HARDENED,
- SOLARPANEL,
- SOLARPANEL_8V,
- SOLARPANEL_LV,
- SOLARPANEL_MV,
- SOLARPANEL_HV,
- SOLARPANEL_EV,
- SOLARPANEL_IV,
- SOLARPANEL_LuV,
- SOLARPANEL_ZPM,
-
- SOLARPANEL_UV,
- SOLARPANEL_UHV,
- SOLARPANEL_UEV,
- SOLARPANEL_UIV,
- VENT_NORMAL,
- VENT_ADVANCED,
- COVER_WOOD_PLATE,
- ARROW_UP,
- ARROW_DOWN,
- ARROW_LEFT,
- ARROW_RIGHT,
- AUTOMATION_FILTER,
- AUTOMATION_TYPEFILTER,
-
- AUTOMATION_CHESTBUFFER,
- AUTOMATION_SUPERBUFFER,
- AUTOMATION_REGULATOR,
- AUTOMATION_ITEMDISTRIBUTOR,
- CONCRETE_LIGHT_STONE,
- CONCRETE_LIGHT_COBBLE,
- CONCRETE_LIGHT_COBBLE_MOSSY,
-
- CONCRETE_LIGHT_BRICKS,
- CONCRETE_LIGHT_BRICKS_CRACKED,
- CONCRETE_LIGHT_BRICKS_MOSSY,
- CONCRETE_LIGHT_BRICKS_CHISELED,
- CONCRETE_LIGHT_SMOOTH,
- CONCRETE_DARK_STONE,
-
- CONCRETE_DARK_COBBLE,
- CONCRETE_DARK_COBBLE_MOSSY,
- CONCRETE_DARK_BRICKS,
- CONCRETE_DARK_BRICKS_CRACKED,
- CONCRETE_DARK_BRICKS_MOSSY,
- CONCRETE_DARK_BRICKS_CHISELED,
-
- CONCRETE_DARK_SMOOTH,
- GRANITE_BLACK_STONE,
- GRANITE_BLACK_COBBLE,
- GRANITE_BLACK_COBBLE_MOSSY,
- GRANITE_BLACK_BRICKS,
- GRANITE_BLACK_BRICKS_CRACKED,
- GRANITE_BLACK_BRICKS_MOSSY,
-
- GRANITE_BLACK_BRICKS_CHISELED,
- GRANITE_BLACK_SMOOTH,
- GRANITE_RED_STONE,
- GRANITE_RED_COBBLE,
- GRANITE_RED_COBBLE_MOSSY,
- GRANITE_RED_BRICKS,
- GRANITE_RED_BRICKS_CRACKED,
-
- GRANITE_RED_BRICKS_MOSSY,
- GRANITE_RED_BRICKS_CHISELED,
- GRANITE_RED_SMOOTH,
- MACHINE_BRONZEBRICKS_TOP,
- MACHINE_BRONZEBRICKS_SIDE,
- MACHINE_BRONZEBRICKS_BOTTOM,
-
- MACHINE_STEELBRICKS_TOP,
- MACHINE_STEELBRICKS_SIDE,
- MACHINE_STEELBRICKS_BOTTOM,
- MACHINE_BRONZE_TOP,
- MACHINE_BRONZE_SIDE,
- MACHINE_BRONZE_BOTTOM,
- MACHINE_STEEL_TOP,
-
- MACHINE_STEEL_SIDE,
- MACHINE_STEEL_BOTTOM,
- MACHINE_8V_TOP,
- MACHINE_8V_SIDE,
- MACHINE_8V_BOTTOM,
- MACHINE_LV_TOP,
- MACHINE_LV_SIDE,
- MACHINE_LV_BOTTOM,
- MACHINE_MV_TOP,
-
- MACHINE_MV_SIDE,
- MACHINE_MV_BOTTOM,
- MACHINE_HV_TOP,
- MACHINE_HV_SIDE,
- MACHINE_HV_BOTTOM,
- MACHINE_EV_TOP,
- MACHINE_EV_SIDE,
- MACHINE_EV_BOTTOM,
- MACHINE_IV_TOP,
-
- MACHINE_IV_SIDE,
- MACHINE_IV_BOTTOM,
- MACHINE_LuV_TOP,
- MACHINE_LuV_SIDE,
- MACHINE_LuV_BOTTOM,
- MACHINE_ZPM_TOP,
- MACHINE_ZPM_SIDE,
- MACHINE_ZPM_BOTTOM,
- MACHINE_UV_TOP,
-
- MACHINE_UV_SIDE,
- MACHINE_UV_BOTTOM,
- MACHINE_MAX_TOP,
- MACHINE_MAX_SIDE,
- MACHINE_MAX_BOTTOM,
- MACHINE_BRONZEPLATEDBRICKS,
- MACHINE_HEATPROOFCASING,
- MACHINE_COIL_SUPERCONDUCTOR,
-
- MACHINE_BRONZEBLASTFURNACE,
- MACHINE_BRONZEBLASTFURNACE_ACTIVE,
- MACHINE_CASING_ROBUST_TUNGSTENSTEEL,
- MACHINE_CASING_CLEAN_STAINLESSSTEEL,
- MACHINE_CASING_STABLE_TITANIUM,
- MACHINE_CASING_MINING_OSMIRIDIUM,
- MACHINE_CASING_MINING_NEUTRONIUM,
- MACHINE_CASING_MINING_BLACKPLUTONIUM,
-
- MACHINE_CASING_FIREBOX_TITANIUM,
- MACHINE_CASING_FUSION_COIL,
- MACHINE_CASING_FUSION,
- MACHINE_CASING_FUSION_GLASS,
- MACHINE_CASING_FUSION_GLASS_YELLOW,
- MACHINE_CASING_FUSION_2,
-
- MACHINE_CASING_MAGIC,
- MACHINE_CASING_MAGIC_ACTIVE,
- MACHINE_CASING_MAGIC_FRONT,
- MACHINE_CASING_MAGIC_FRONT_ACTIVE,
- MACHINE_CASING_DRAGONEGG,
- MACHINE_CASING_SOLID_STEEL,
-
- MACHINE_CASING_FROST_PROOF,
- MACHINE_CASING_PUMP,
- MACHINE_CASING_MOTOR,
- MACHINE_CASING_PIPE_BRONZE,
- MACHINE_CASING_PIPE_STEEL,
- MACHINE_CASING_PIPE_TITANIUM,
- MACHINE_CASING_PIPE_TUNGSTENSTEEL,
- MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE,
-
- MACHINE_CASING_GEARBOX_BRONZE,
- MACHINE_CASING_GEARBOX_STEEL,
- MACHINE_CASING_GEARBOX_TITANIUM,
- MACHINE_CASING_GEARBOX_TUNGSTENSTEEL,
- MACHINE_CASING_DATA_DRIVE,
- MACHINE_CASING_CONTAINMENT_FIELD,
-
- MACHINE_CASING_ASSEMBLER,
- MACHINE_CASING_PROCESSOR,
- MACHINE_CASING_STRIPES_A,
- MACHINE_CASING_STRIPES_B,
- MACHINE_CASING_RADIOACTIVEHAZARD,
- MACHINE_CASING_BIOHAZARD,
- MACHINE_CASING_EXPLOSIONHAZARD,
-
- MACHINE_CASING_FIREHAZARD,
- MACHINE_CASING_ACIDHAZARD,
- MACHINE_CASING_MAGICHAZARD,
- MACHINE_CASING_FROSTHAZARD,
- MACHINE_CASING_NOISEHAZARD,
- MACHINE_CASING_GRATE,
- MACHINE_CASING_VENT,
-
- MACHINE_CASING_RADIATIONPROOF,
- MACHINE_CASING_FIREBOX_BRONZE,
- MACHINE_CASING_FIREBOX_STEEL,
- MACHINE_CASING_FIREBOX_TUNGSTENSTEEL,
- MACHINE_CASING_ENGINE_INTAKE,
- MACHINE_CASING_CHEMICALLY_INERT,
- MACHINE_COIL_CUPRONICKEL,
-
- MACHINE_CASING_DENSEBRICKS,
- MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE,
- MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE,
-
- MACHINE_COIL_KANTHAL,
- MACHINE_COIL_NICHROME,
- MACHINE_COIL_TUNGSTENSTEEL,
- MACHINE_COIL_HSSG,
- MACHINE_COIL_NAQUADAH,
- MACHINE_COIL_NAQUADAHALLOY,
- MACHINE_COIL_ELECTRUMFLUX,
- MACHINE_COIL_AWAKENEDDRACONIUM,
- BOILER_SOLAR,
- BOILER_FRONT,
-
- BOILER_FRONT_ACTIVE,
- BOILER_LAVA_FRONT,
- BOILER_LAVA_FRONT_ACTIVE,
- NAQUADAH_REACTOR_SOLID_BACK,
- NAQUADAH_REACTOR_SOLID_FRONT,
- NAQUADAH_REACTOR_SOLID_SIDE,
- NAQUADAH_REACTOR_SOLID_BOTTOM,
-
- NAQUADAH_REACTOR_SOLID_TOP,
- NAQUADAH_REACTOR_SOLID_BACK_ACTIVE,
- NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE,
- NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE,
- NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE,
-
- NAQUADAH_REACTOR_SOLID_TOP_ACTIVE,
- NAQUADAH_REACTOR_FLUID_BACK,
- NAQUADAH_REACTOR_FLUID_FRONT,
- NAQUADAH_REACTOR_FLUID_SIDE,
- NAQUADAH_REACTOR_FLUID_BOTTOM,
- NAQUADAH_REACTOR_FLUID_TOP,
-
- NAQUADAH_REACTOR_FLUID_BACK_ACTIVE,
- NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE,
- NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE,
- NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE,
- NAQUADAH_REACTOR_FLUID_TOP_ACTIVE,
-
- DIESEL_GENERATOR_BACK,
- DIESEL_GENERATOR_FRONT,
- DIESEL_GENERATOR_SIDE,
- DIESEL_GENERATOR_BOTTOM,
- DIESEL_GENERATOR_TOP,
- DIESEL_GENERATOR_BACK_ACTIVE,
- DIESEL_GENERATOR_FRONT_ACTIVE,
-
- DIESEL_GENERATOR_SIDE_ACTIVE,
- DIESEL_GENERATOR_BOTTOM_ACTIVE,
- DIESEL_GENERATOR_TOP_ACTIVE,
- GAS_TURBINE_BACK,
- GAS_TURBINE_FRONT,
- GAS_TURBINE_SIDE,
- GAS_TURBINE_BOTTOM,
-
- GAS_TURBINE_TOP,
- GAS_TURBINE_BACK_ACTIVE,
- GAS_TURBINE_FRONT_ACTIVE,
- GAS_TURBINE_SIDE_ACTIVE,
- GAS_TURBINE_BOTTOM_ACTIVE,
- GAS_TURBINE_TOP_ACTIVE,
- STEAM_TURBINE_BACK,
-
- STEAM_TURBINE_FRONT,
- STEAM_TURBINE_SIDE,
- STEAM_TURBINE_BOTTOM,
- STEAM_TURBINE_TOP,
- STEAM_TURBINE_BACK_ACTIVE,
- STEAM_TURBINE_FRONT_ACTIVE,
- STEAM_TURBINE_SIDE_ACTIVE,
-
- STEAM_TURBINE_BOTTOM_ACTIVE,
- STEAM_TURBINE_TOP_ACTIVE,
- BLOCK_BRONZEPREIN,
- BLOCK_STEELPREIN,
- BLOCK_TITANIUMPREIN,
- BLOCK_NAQUADAHPREIN,
- BLOCK_NEUTRONIUMPREIN,
- BLOCK_IRREIN,
- BLOCK_PLASCRETE,
- BLOCK_TSREIN,
- OVERLAY_LOCKER,
- OVERLAY_LOCKER_000,
- OVERLAY_LOCKER_001,
-
- OVERLAY_LOCKER_002,
- OVERLAY_LOCKER_003,
- OVERLAY_LOCKER_004,
- OVERLAY_LOCKER_005,
- OVERLAY_LOCKER_006,
- OVERLAY_LOCKER_007,
- OVERLAY_LOCKER_008,
- OVERLAY_LOCKER_009,
- OVERLAY_LOCKER_010,
-
- OVERLAY_LOCKER_011,
- OVERLAY_LOCKER_012,
- OVERLAY_LOCKER_013,
- OVERLAY_LENS,
- OVERLAY_PIPE,
- OVERLAY_PIPE_IN,
- OVERLAY_PIPE_OUT,
- OVERLAY_MUFFLER,
- OVERLAY_CONTROLLER,
- OVERLAY_ACTIVITYDETECTOR,
-
- OVERLAY_ENERGYDETECTOR,
- OVERLAY_FLUIDDETECTOR,
- OVERLAY_ITEMDETECTOR,
- OVERLAY_FUSION1,
- OVERLAY_FUSION2,
- OVERLAY_FUSION3,
- OVERLAY_SCREEN,
- OVERLAY_QTANK,
- OVERLAY_QCHEST,
- OVERLAY_SHUTTER,
-
- OVERLAY_CLOSET,
- OVERLAY_DUCTTAPE,
- OVERLAY_MAINTENANCE,
- OVERLAY_DATA_ACCESS,
- OVERLAY_CONVEYOR,
- OVERLAY_PUMP,
- OVERLAY_ARM,
- OVERLAY_DRAIN,
- OVERLAY_CRAFTING,
- OVERLAY_ENERGY_IN,
- OVERLAY_ENERGY_OUT,
-
- OVERLAY_ENERGY_IN_MULTI,
- OVERLAY_ENERGY_OUT_MULTI,
- OVERLAY_FRONT_LARGE_BOILER,
- OVERLAY_FRONT_LARGE_BOILER_ACTIVE,
- OVERLAY_FRONT_VACUUM_FREEZER,
- OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE,
-
- OVERLAY_FRONT_MULTI_SMELTER,
- OVERLAY_FRONT_MULTI_SMELTER_ACTIVE,
- OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE,
- OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE,
- OVERLAY_FRONT_IMPLOSION_COMPRESSOR,
-
- OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE,
- OVERLAY_TOP_POTIONBREWER,
- OVERLAY_TOP_REPLICATOR,
- OVERLAY_TOP_MASSFAB,
- OVERLAY_TOP_STEAM_HAMMER,
- OVERLAY_TOP_STEAM_FURNACE,
- OVERLAY_TOP_STEAM_ALLOY_SMELTER,
-
- OVERLAY_TOP_STEAM_MACERATOR,
- OVERLAY_TOP_STEAM_COMPRESSOR,
- OVERLAY_TOP_STEAM_EXTRACTOR,
- OVERLAY_TOP_DISASSEMBLER,
- OVERLAY_TOP_BOXINATOR,
- OVERLAY_TOP_ROCK_BREAKER,
- OVERLAY_TOP_SCANNER,
-
- OVERLAY_FRONT_POTIONBREWER,
- OVERLAY_FRONT_REPLICATOR,
- OVERLAY_FRONT_MASSFAB,
- OVERLAY_FRONT_STEAM_HAMMER,
- OVERLAY_FRONT_STEAM_FURNACE,
- OVERLAY_FRONT_STEAM_ALLOY_SMELTER,
-
- OVERLAY_FRONT_STEAM_MACERATOR,
- OVERLAY_FRONT_STEAM_COMPRESSOR,
- OVERLAY_FRONT_STEAM_EXTRACTOR,
- OVERLAY_FRONT_DISASSEMBLER,
- OVERLAY_FRONT_BOXINATOR,
- OVERLAY_FRONT_ROCK_BREAKER,
-
- OVERLAY_FRONT_SCANNER,
- OVERLAY_BOTTOM_POTIONBREWER,
- OVERLAY_BOTTOM_REPLICATOR,
- OVERLAY_BOTTOM_MASSFAB,
- OVERLAY_BOTTOM_STEAM_HAMMER,
- OVERLAY_BOTTOM_STEAM_FURNACE,
-
- OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER,
- OVERLAY_BOTTOM_STEAM_MACERATOR,
- OVERLAY_BOTTOM_STEAM_COMPRESSOR,
- OVERLAY_BOTTOM_STEAM_EXTRACTOR,
- OVERLAY_BOTTOM_DISASSEMBLER,
-
- OVERLAY_BOTTOM_BOXINATOR,
- OVERLAY_BOTTOM_ROCK_BREAKER,
- OVERLAY_BOTTOM_SCANNER,
- OVERLAY_SIDE_POTIONBREWER,
- OVERLAY_SIDE_REPLICATOR,
- OVERLAY_SIDE_MASSFAB,
- OVERLAY_SIDE_STEAM_HAMMER,
-
- OVERLAY_SIDE_STEAM_FURNACE,
- OVERLAY_SIDE_STEAM_ALLOY_SMELTER,
- OVERLAY_SIDE_STEAM_MACERATOR,
- OVERLAY_SIDE_STEAM_COMPRESSOR,
- OVERLAY_SIDE_STEAM_EXTRACTOR,
- OVERLAY_SIDE_DISASSEMBLER,
-
- OVERLAY_SIDE_BOXINATOR,
- OVERLAY_SIDE_ROCK_BREAKER,
- OVERLAY_SIDE_SCANNER,
- OVERLAY_TOP_POTIONBREWER_ACTIVE,
- OVERLAY_TOP_REPLICATOR_ACTIVE,
- OVERLAY_TOP_MASSFAB_ACTIVE,
-
- OVERLAY_TOP_STEAM_HAMMER_ACTIVE,
- OVERLAY_TOP_STEAM_FURNACE_ACTIVE,
- OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE,
- OVERLAY_TOP_STEAM_MACERATOR_ACTIVE,
- OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE,
-
- OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE,
- OVERLAY_TOP_DISASSEMBLER_ACTIVE,
- OVERLAY_TOP_BOXINATOR_ACTIVE,
- OVERLAY_TOP_ROCK_BREAKER_ACTIVE,
- OVERLAY_TOP_SCANNER_ACTIVE,
- OVERLAY_FRONT_POTIONBREWER_ACTIVE,
-
- OVERLAY_FRONT_REPLICATOR_ACTIVE,
- OVERLAY_FRONT_MASSFAB_ACTIVE,
- OVERLAY_FRONT_STEAM_HAMMER_ACTIVE,
- OVERLAY_FRONT_STEAM_FURNACE_ACTIVE,
- OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE,
-
- OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE,
- OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE,
- OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE,
- OVERLAY_FRONT_DISASSEMBLER_ACTIVE,
- OVERLAY_FRONT_BOXINATOR_ACTIVE,
-
- OVERLAY_FRONT_ROCK_BREAKER_ACTIVE,
- OVERLAY_FRONT_SCANNER_ACTIVE,
- OVERLAY_BOTTOM_POTIONBREWER_ACTIVE,
- OVERLAY_BOTTOM_REPLICATOR_ACTIVE,
- OVERLAY_BOTTOM_MASSFAB_ACTIVE,
-
- OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE,
- OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE,
- OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE,
- OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE,
- OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE,
-
- OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE,
- OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE,
- OVERLAY_BOTTOM_BOXINATOR_ACTIVE,
- OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE,
- OVERLAY_BOTTOM_SCANNER_ACTIVE,
-
- OVERLAY_SIDE_POTIONBREWER_ACTIVE,
- OVERLAY_SIDE_REPLICATOR_ACTIVE,
- OVERLAY_SIDE_MASSFAB_ACTIVE,
- OVERLAY_SIDE_STEAM_HAMMER_ACTIVE,
- OVERLAY_SIDE_STEAM_FURNACE_ACTIVE,
- OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE,
-
- OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE,
- OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE,
- OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE,
- OVERLAY_SIDE_DISASSEMBLER_ACTIVE,
- OVERLAY_SIDE_BOXINATOR_ACTIVE,
-
- OVERLAY_SIDE_ROCK_BREAKER_ACTIVE,
- OVERLAY_SIDE_SCANNER_ACTIVE,
- OVERLAY_ADV_PUMP,
- OVERLAY_TELEPORTER,
- OVERLAY_TELEPORTER_ACTIVE,
- FUSIONI_1,
- FUSIONI_2,
- FUSIONI_3,
- FUSIONI_4,
- FUSIONI_5,
-
- FUSIONI_6,
- FUSIONI_7,
- FUSIONI_8,
- FUSIONI_9,
- FUSIONI_10,
- FUSIONI_11,
- FUSIONI_12,
- FUSIONII_1,
- FUSIONII_2,
- FUSIONII_3,
- FUSIONII_4,
- FUSIONII_5,
- FUSIONII_6,
- FUSIONII_7,
- FUSIONII_8,
- FUSIONII_9,
-
- FUSIONII_10,
- FUSIONII_11,
- FUSIONII_12,
- LARGETURBINE_ST1,
- LARGETURBINE_ST2,
- LARGETURBINE_ST3,
- LARGETURBINE_ST4,
- LARGETURBINE_ST5,
- LARGETURBINE_ST6,
- LARGETURBINE_ST7,
- LARGETURBINE_ST8,
-
- LARGETURBINE_ST9,
- LARGETURBINE_ST_ACTIVE1,
- LARGETURBINE_ST_ACTIVE2,
- LARGETURBINE_ST_ACTIVE3,
- LARGETURBINE_ST_ACTIVE4,
- LARGETURBINE_ST_ACTIVE5,
- LARGETURBINE_ST_ACTIVE6,
- LARGETURBINE_ST_ACTIVE7,
-
- LARGETURBINE_ST_ACTIVE8,
- LARGETURBINE_ST_ACTIVE9,
- LARGETURBINE_SS1,
- LARGETURBINE_SS2,
- LARGETURBINE_SS3,
- LARGETURBINE_SS4,
- LARGETURBINE_SS5,
- LARGETURBINE_SS6,
- LARGETURBINE_SS7,
- LARGETURBINE_SS8,
-
- LARGETURBINE_SS9,
- LARGETURBINE_SS_ACTIVE1,
- LARGETURBINE_SS_ACTIVE2,
- LARGETURBINE_SS_ACTIVE3,
- LARGETURBINE_SS_ACTIVE4,
- LARGETURBINE_SS_ACTIVE5,
- LARGETURBINE_SS_ACTIVE6,
- LARGETURBINE_SS_ACTIVE7,
-
- LARGETURBINE_SS_ACTIVE8,
- LARGETURBINE_SS_ACTIVE9,
- LARGETURBINE_TI1,
- LARGETURBINE_TI2,
- LARGETURBINE_TI3,
- LARGETURBINE_TI4,
- LARGETURBINE_TI5,
- LARGETURBINE_TI6,
- LARGETURBINE_TI7,
-
- LARGETURBINE_TI8,
- LARGETURBINE_TI9,
- LARGETURBINE_TI_ACTIVE1,
- LARGETURBINE_TI_ACTIVE2,
- LARGETURBINE_TI_ACTIVE3,
- LARGETURBINE_TI_ACTIVE4,
- LARGETURBINE_TI_ACTIVE5,
- LARGETURBINE_TI_ACTIVE6,
-
- LARGETURBINE_TI_ACTIVE7,
- LARGETURBINE_TI_ACTIVE8,
- LARGETURBINE_TI_ACTIVE9,
- LARGETURBINE_TU1,
- LARGETURBINE_TU2,
- LARGETURBINE_TU3,
- LARGETURBINE_TU4,
- LARGETURBINE_TU5,
- LARGETURBINE_TU6,
-
- LARGETURBINE_TU7,
- LARGETURBINE_TU8,
- LARGETURBINE_TU9,
- LARGETURBINE_TU_ACTIVE1,
- LARGETURBINE_TU_ACTIVE2,
- LARGETURBINE_TU_ACTIVE3,
- LARGETURBINE_TU_ACTIVE4,
- LARGETURBINE_TU_ACTIVE5,
-
- LARGETURBINE_TU_ACTIVE6,
- LARGETURBINE_TU_ACTIVE7,
- LARGETURBINE_TU_ACTIVE8,
- LARGETURBINE_TU_ACTIVE9,
- MACHINE_CASING_TURBINE,
- BLOCK_ADAMANTIUM,
- BLOCK_ALUMINIUM,
- BLOCK_AMERICIUM,
-
- BLOCK_ANNEALEDCOPPER,
- BLOCK_ANTIMONY,
- BLOCK_ARSENIC,
- BLOCK_ASTRALSILVER,
- BLOCK_BATTERYALLOY,
- BLOCK_BERYLLIUM,
- BLOCK_BISMUTH,
- BLOCK_BISMUTHBRONZE,
- BLOCK_BLACKBRONZE,
- BLOCK_BLACKSTEEL,
-
- BLOCK_BLUEALLOY,
- BLOCK_BLUESTEEL,
- BLOCK_BRASS,
- BLOCK_BRONZE,
- BLOCK_CAESIUM,
- BLOCK_CERIUM,
- BLOCK_CHROME,
- BLOCK_CHROMIUMDIOXIDE,
- BLOCK_COBALT,
- BLOCK_COBALTBRASS,
- BLOCK_COPPER,
-
- BLOCK_CUPRONICKEL,
- BLOCK_DAMASCUSSTEEL,
- BLOCK_DARKIRON,
- BLOCK_DEEPIRON,
- BLOCK_DESH,
- BLOCK_DURANIUM,
- BLOCK_DYSPROSIUM,
- BLOCK_ELECTRUM,
- BLOCK_ELECTRUMFLUX,
- BLOCK_ENDERIUM,
-
- BLOCK_ERBIUM,
- BLOCK_EUROPIUM,
- BLOCK_FIERYSTEEL,
- BLOCK_GADOLINIUM,
- BLOCK_GALLIUM,
- BLOCK_HOLMIUM,
- BLOCK_HSLA,
- BLOCK_INDIUM,
- BLOCK_INFUSEDGOLD,
- BLOCK_INVAR,
- BLOCK_IRIDIUM,
-
- BLOCK_IRONMAGNETIC,
- BLOCK_IRONWOOD,
- BLOCK_KANTHAL,
- BLOCK_KNIGHTMETAL,
- BLOCK_LANTHANUM,
- BLOCK_LEAD,
- BLOCK_LUTETIUM,
- BLOCK_MAGNALIUM,
- BLOCK_MAGNESIUM,
- BLOCK_MANGANESE,
- BLOCK_METEORICIRON,
-
- BLOCK_METEORICSTEEL,
- BLOCK_MIDASIUM,
- BLOCK_TRINIUM,
- BLOCK_MITHRIL,
- BLOCK_MOLYBDENUM,
- BLOCK_NAQUADAH,
- BLOCK_NAQUADAHALLOY,
- BLOCK_NAQUADAHENRICHED,
- BLOCK_NAQUADRIA,
- BLOCK_NEODYMIUM,
- BLOCK_NEODYMIUMMAGNETIC,
-
- BLOCK_NEUTRONIUM,
- BLOCK_NICHROME,
- BLOCK_NICKEL,
- BLOCK_NIOBIUM,
- BLOCK_NIOBIUMNITRIDE,
- BLOCK_NIOBIUMTITANIUM,
- BLOCK_OSMIRIDIUM,
- BLOCK_OSMIUM,
- BLOCK_PALLADIUM,
- BLOCK_PIGIRON,
- BLOCK_PLATINUM,
-
- BLOCK_PLUTONIUM,
- BLOCK_PLUTONIUM241,
- BLOCK_PRASEODYMIUM,
- BLOCK_PROMETHIUM,
- BLOCK_REDALLOY,
- BLOCK_REDSTEEL,
- BLOCK_ROSEGOLD,
- BLOCK_RUBIDIUM,
- BLOCK_SAMARIUM,
- BLOCK_SCANDIUM,
- BLOCK_SHADOWIRON,
-
- BLOCK_SHADOWSTEEL,
- BLOCK_SILICON,
- BLOCK_SILVER,
- BLOCK_SOLDERINGALLOY,
- BLOCK_STAINLESSSTEEL,
- BLOCK_STEEL,
- BLOCK_STEELMAGNETIC,
- BLOCK_STERLINGSILVER,
- BLOCK_SUNNARIUM,
- BLOCK_TANTALUM,
-
- BLOCK_TELLURIUM,
- BLOCK_TERBIUM,
- BLOCK_THAUMIUM,
- BLOCK_THORIUM,
- BLOCK_THULIUM,
- BLOCK_TIN,
- BLOCK_TINALLOY,
- BLOCK_TITANIUM,
- BLOCK_TRITANIUM,
- BLOCK_TUNGSTEN,
- BLOCK_TUNGSTENSTEEL,
- BLOCK_ULTIMET,
-
- BLOCK_URANIUM,
- BLOCK_URANIUM235,
- BLOCK_VANADIUM,
- BLOCK_VANADIUMGALLIUM,
- BLOCK_WROUGHTIRON,
- BLOCK_YTTRBIUM,
- BLOCK_YTTRIUM,
- BLOCK_YTTRIUMBARIUMCUPRATE,
- BLOCK_ZINC,
- BLOCK_TUNGSTENCARBIDE,
-
- BLOCK_VANADIUMSTEEL,
- BLOCK_HSSG,
- BLOCK_HSSE,
- BLOCK_HSSS,
- BLOCK_AERCRYSTAL,
- BLOCK_AMBER,
- BLOCK_AMETHYST,
- BLOCK_AQUACRYSTAL,
- BLOCK_BLUETOPAZ,
- BLOCK_CERTUSQUARTZ,
- BLOCK_DILITHIUM,
-
- BLOCK_ENDEREYE,
- BLOCK_ENDERPEARL,
- BLOCK_FOOLSRUBY,
- BLOCK_FORCE,
- BLOCK_FORCICIUM,
- BLOCK_FORCILLIUM,
- BLOCK_GREENSAPPHIRE,
- BLOCK_IGNISCRYSTAL,
- BLOCK_JASPER,
- BLOCK_LAZURITE,
-
- BLOCK_LIGNITE,
- BLOCK_MONAZITE,
- BLOCK_NITER,
- BLOCK_OLIVINE,
- BLOCK_OPAL,
- BLOCK_ORDOCRYSTAL,
- BLOCK_PERDITIOCRYSTAL,
- BLOCK_PHOSPHORUS,
- BLOCK_QUARTZITE,
- BLOCK_REDGARNET,
- BLOCK_RUBY,
-
- BLOCK_SAPPHIRE,
- BLOCK_SODALITE,
- BLOCK_TANZANITE,
- BLOCK_TERRACRYSTAL,
- BLOCK_TOPAZ,
- BLOCK_VINTEUM,
- BLOCK_YELLOWGARNET,
- BLOCK_NETHERSTAR,
- BLOCK_CHARCOAL,
- BLOCK_BLAZE,
- MARBLE_STONE,
- MARBLE_COBBLE,
-
- MARBLE_COBBLE_MOSSY,
- MARBLE_BRICKS,
- MARBLE_BRICKS_CRACKED,
- MARBLE_BRICKS_MOSSY,
- MARBLE_BRICKS_CHISELED,
- MARBLE_SMOOTH,
- BASALT_STONE,
- BASALT_COBBLE,
- BASALT_COBBLE_MOSSY,
- BASALT_BRICKS,
-
- BASALT_BRICKS_CRACKED,
- BASALT_BRICKS_MOSSY,
- BASALT_BRICKS_CHISELED,
- BASALT_SMOOTH,
- OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE,
- OVERLAY_FRONT_HEAT_EXCHANGER,
- OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE,
-
- OVERLAY_FRONT_PROCESSING_ARRAY,
- OVERLAY_FRONT_OIL_DRILL_ACTIVE,
- OVERLAY_FRONT_OIL_DRILL,
- OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE,
- OVERLAY_FRONT_DIESEL_ENGINE,
- OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE,
-
- OVERLAY_FRONT_PYROLYSE_OVEN,
- OVERLAY_FRONT_OIL_CRACKER_ACTIVE,
- OVERLAY_FRONT_OIL_CRACKER,
- OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE,
- OVERLAY_FRONT_DISTILLATION_TOWER,
-
- OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE,
- OVERLAY_FRONT_ASSEMBLY_LINE,
- OVERLAY_FRONT_ORE_DRILL_ACTIVE,
- OVERLAY_FRONT_ORE_DRILL,
- OVERLAY_TOP_CLEANROOM_ACTIVE,
- OVERLAY_TOP_CLEANROOM,
-
- OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR,
- OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE,
-
- PIPE_RESTRICTOR_UP,
- PIPE_RESTRICTOR_DOWN,
- PIPE_RESTRICTOR_LEFT,
- PIPE_RESTRICTOR_RIGHT,
- PIPE_RESTRICTOR_NU,
- PIPE_RESTRICTOR_ND,
- PIPE_RESTRICTOR_NL,
- PIPE_RESTRICTOR_NR,
-
- PIPE_RESTRICTOR_UD,
- PIPE_RESTRICTOR_UL,
- PIPE_RESTRICTOR_UR,
- PIPE_RESTRICTOR_DL,
- PIPE_RESTRICTOR_DR,
- PIPE_RESTRICTOR_LR;
-
- /**
- * Icon for Fresh CFoam
- */
- public static final ITexture[] FRESHFOAM = new ITexture[]{new GT_RenderedTexture(CFOAM_FRESH)};
- /**
- * Icons for Hardened CFoam
- * 0 = No Color
- * 1 - 16 = Colors
- */
- public static final ITexture[][] HARDENEDFOAMS = new ITexture[][]{
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
- new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
- };
- /**
- * Machine Casings by Tier
- * 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV
- */
- public static final IIconContainer[]
- MACHINECASINGS_SIDE = new IIconContainer[]{
- MACHINE_8V_SIDE,
- MACHINE_LV_SIDE,
- MACHINE_MV_SIDE,
- MACHINE_HV_SIDE,
- MACHINE_EV_SIDE,
- MACHINE_IV_SIDE,
- MACHINE_LuV_SIDE,
- MACHINE_ZPM_SIDE,
- MACHINE_UV_SIDE,
- MACHINE_MAX_SIDE,
- MACHINE_UEV_SIDE,
- MACHINE_UIV_SIDE,
- MACHINE_UMV_SIDE,
- MACHINE_UXV_SIDE,
- MACHINE_OPV_SIDE,
- MACHINE_MAXV_SIDE,
- },
- MACHINECASINGS_TOP = new IIconContainer[]{
- MACHINE_8V_TOP,
- MACHINE_LV_TOP,
- MACHINE_MV_TOP,
- MACHINE_HV_TOP,
- MACHINE_EV_TOP,
- MACHINE_IV_TOP,
- MACHINE_LuV_TOP,
- MACHINE_ZPM_TOP,
- MACHINE_UV_TOP,
- MACHINE_MAX_TOP,
- MACHINE_UEV_TOP,
- MACHINE_UIV_TOP,
- MACHINE_UMV_TOP,
- MACHINE_UXV_TOP,
- MACHINE_OPV_TOP,
- MACHINE_MAXV_TOP,
- },
- MACHINECASINGS_BOTTOM = new IIconContainer[]{
- MACHINE_8V_BOTTOM,
- MACHINE_LV_BOTTOM,
- MACHINE_MV_BOTTOM,
- MACHINE_HV_BOTTOM,
- MACHINE_EV_BOTTOM,
- MACHINE_IV_BOTTOM,
- MACHINE_LuV_BOTTOM,
- MACHINE_ZPM_BOTTOM,
- MACHINE_UV_BOTTOM,
- MACHINE_MAX_BOTTOM,
- MACHINE_UEV_BOTTOM,
- MACHINE_UIV_BOTTOM,
- MACHINE_UMV_BOTTOM,
- MACHINE_UXV_BOTTOM,
- MACHINE_OPV_BOTTOM,
- MACHINE_MAXV_BOTTOM,
- },
- GRANITES = new IIconContainer[]{
- GRANITE_BLACK_STONE,
- GRANITE_BLACK_COBBLE,
- GRANITE_BLACK_COBBLE_MOSSY,
- GRANITE_BLACK_BRICKS,
- GRANITE_BLACK_BRICKS_CRACKED,
- GRANITE_BLACK_BRICKS_MOSSY,
- GRANITE_BLACK_BRICKS_CHISELED,
- GRANITE_BLACK_SMOOTH,
- GRANITE_RED_STONE,
- GRANITE_RED_COBBLE,
- GRANITE_RED_COBBLE_MOSSY,
- GRANITE_RED_BRICKS,
- GRANITE_RED_BRICKS_CRACKED,
- GRANITE_RED_BRICKS_MOSSY,
- GRANITE_RED_BRICKS_CHISELED,
- GRANITE_RED_SMOOTH,
- },
- CONCRETES = new IIconContainer[]{
- CONCRETE_DARK_STONE,
- CONCRETE_DARK_COBBLE,
- CONCRETE_DARK_COBBLE_MOSSY,
- CONCRETE_DARK_BRICKS,
- CONCRETE_DARK_BRICKS_CRACKED,
- CONCRETE_DARK_BRICKS_MOSSY,
- CONCRETE_DARK_BRICKS_CHISELED,
- CONCRETE_DARK_SMOOTH,
- CONCRETE_LIGHT_STONE,
- CONCRETE_LIGHT_COBBLE,
- CONCRETE_LIGHT_COBBLE_MOSSY,
- CONCRETE_LIGHT_BRICKS,
- CONCRETE_LIGHT_BRICKS_CRACKED,
- CONCRETE_LIGHT_BRICKS_MOSSY,
- CONCRETE_LIGHT_BRICKS_CHISELED,
- CONCRETE_LIGHT_SMOOTH,
- },
- STONES = new IIconContainer[]{
- MARBLE_STONE,
- MARBLE_COBBLE,
- MARBLE_COBBLE_MOSSY,
- MARBLE_BRICKS,
- MARBLE_BRICKS_CRACKED,
- MARBLE_BRICKS_MOSSY,
- MARBLE_BRICKS_CHISELED,
- MARBLE_SMOOTH,
- BASALT_STONE,
- BASALT_COBBLE,
- BASALT_COBBLE_MOSSY,
- BASALT_BRICKS,
- BASALT_BRICKS_CRACKED,
- BASALT_BRICKS_MOSSY,
- BASALT_BRICKS_CHISELED,
- BASALT_SMOOTH,
- },
- TURBINE = new IIconContainer[]{
- LARGETURBINE_ST1,
- LARGETURBINE_ST2,
- LARGETURBINE_ST3,
- LARGETURBINE_ST4,
- LARGETURBINE_ST5,
- LARGETURBINE_ST6,
- LARGETURBINE_ST7,
- LARGETURBINE_ST8,
- LARGETURBINE_ST9
- },
- TURBINE_ACTIVE = new IIconContainer[]{
- LARGETURBINE_ST_ACTIVE1,
- LARGETURBINE_ST_ACTIVE2,
- LARGETURBINE_ST_ACTIVE3,
- LARGETURBINE_ST_ACTIVE4,
- LARGETURBINE_ST_ACTIVE5,
- LARGETURBINE_ST_ACTIVE6,
- LARGETURBINE_ST_ACTIVE7,
- LARGETURBINE_ST_ACTIVE8,
- LARGETURBINE_ST_ACTIVE9
- },
- TURBINE1 = new IIconContainer[]{
- LARGETURBINE_SS1,
- LARGETURBINE_SS2,
- LARGETURBINE_SS3,
- LARGETURBINE_SS4,
- LARGETURBINE_SS5,
- LARGETURBINE_SS6,
- LARGETURBINE_SS7,
- LARGETURBINE_SS8,
- LARGETURBINE_SS9
- },
- TURBINE_ACTIVE1 = new IIconContainer[]{
- LARGETURBINE_SS_ACTIVE1,
- LARGETURBINE_SS_ACTIVE2,
- LARGETURBINE_SS_ACTIVE3,
- LARGETURBINE_SS_ACTIVE4,
- LARGETURBINE_SS_ACTIVE5,
- LARGETURBINE_SS_ACTIVE6,
- LARGETURBINE_SS_ACTIVE7,
- LARGETURBINE_SS_ACTIVE8,
- LARGETURBINE_SS_ACTIVE9
- },
- TURBINE2 = new IIconContainer[]{
- LARGETURBINE_TI1,
- LARGETURBINE_TI2,
- LARGETURBINE_TI3,
- LARGETURBINE_TI4,
- LARGETURBINE_TI5,
- LARGETURBINE_TI6,
- LARGETURBINE_TI7,
- LARGETURBINE_TI8,
- LARGETURBINE_TI9
- },
- TURBINE_ACTIVE2 = new IIconContainer[]{
- LARGETURBINE_TI_ACTIVE1,
- LARGETURBINE_TI_ACTIVE2,
- LARGETURBINE_TI_ACTIVE3,
- LARGETURBINE_TI_ACTIVE4,
- LARGETURBINE_TI_ACTIVE5,
- LARGETURBINE_TI_ACTIVE6,
- LARGETURBINE_TI_ACTIVE7,
- LARGETURBINE_TI_ACTIVE8,
- LARGETURBINE_TI_ACTIVE9
- },
- TURBINE3 = new IIconContainer[]{
- LARGETURBINE_TU1,
- LARGETURBINE_TU2,
- LARGETURBINE_TU3,
- LARGETURBINE_TU4,
- LARGETURBINE_TU5,
- LARGETURBINE_TU6,
- LARGETURBINE_TU7,
- LARGETURBINE_TU8,
- LARGETURBINE_TU9
- },
- TURBINE_ACTIVE3 = new IIconContainer[]{
- LARGETURBINE_TU_ACTIVE1,
- LARGETURBINE_TU_ACTIVE2,
- LARGETURBINE_TU_ACTIVE3,
- LARGETURBINE_TU_ACTIVE4,
- LARGETURBINE_TU_ACTIVE5,
- LARGETURBINE_TU_ACTIVE6,
- LARGETURBINE_TU_ACTIVE7,
- LARGETURBINE_TU_ACTIVE8,
- LARGETURBINE_TU_ACTIVE9
- },
- CONNECTED_HULLS = new IIconContainer[]{
- CONCRETE_DARK_STONE,
- FUSIONI_1,
- FUSIONI_2,
- FUSIONI_3,
- FUSIONI_4,
- FUSIONI_5,
- FUSIONI_6,
- FUSIONI_7,
- FUSIONI_8,
- FUSIONI_9,
- FUSIONI_10,
- FUSIONI_11,
- FUSIONI_12,
- FUSIONII_1,
- FUSIONII_2,
- FUSIONII_3,
- FUSIONII_4,
- FUSIONII_5,
- FUSIONII_6,
- FUSIONII_7,
- FUSIONII_8,
- FUSIONII_9,
- FUSIONII_10,
- FUSIONII_11,
- FUSIONII_12,
- },
- STORAGE_BLOCKS1 = new IIconContainer[]{
- BLOCK_ADAMANTIUM,
- BLOCK_ALUMINIUM,
- BLOCK_AMERICIUM,
- BLOCK_ANNEALEDCOPPER,
- BLOCK_ANTIMONY,
- BLOCK_ARSENIC,
- BLOCK_ASTRALSILVER,
- BLOCK_BATTERYALLOY,
- BLOCK_BERYLLIUM,
- BLOCK_BISMUTH,
- BLOCK_BISMUTHBRONZE,
- BLOCK_BLACKBRONZE,
- BLOCK_BLACKSTEEL,
- BLOCK_BLUEALLOY,
- BLOCK_BLUESTEEL,
- BLOCK_BRASS
- },
- STORAGE_BLOCKS2 = new IIconContainer[]{
- BLOCK_BRONZE,
- BLOCK_CAESIUM,
- BLOCK_CERIUM,
- BLOCK_CHROME,
- BLOCK_CHROMIUMDIOXIDE,
- BLOCK_COBALT,
- BLOCK_COBALTBRASS,
- BLOCK_COPPER,
- BLOCK_CUPRONICKEL,
- BLOCK_DAMASCUSSTEEL,
- BLOCK_DARKIRON,
- BLOCK_DEEPIRON,
- BLOCK_DESH,
- BLOCK_DURANIUM,
- BLOCK_DYSPROSIUM,
- BLOCK_ELECTRUM
- },
- STORAGE_BLOCKS3 = new IIconContainer[]{
- BLOCK_ELECTRUMFLUX,
- BLOCK_ENDERIUM,
- BLOCK_ERBIUM,
- BLOCK_EUROPIUM,
- BLOCK_FIERYSTEEL,
- BLOCK_GADOLINIUM,
- BLOCK_GALLIUM,
- BLOCK_HOLMIUM,
- BLOCK_HSLA,
- BLOCK_INDIUM,
- BLOCK_INFUSEDGOLD,
- BLOCK_INVAR,
- BLOCK_IRIDIUM,
- BLOCK_IRONMAGNETIC,
- BLOCK_IRONWOOD,
- BLOCK_KANTHAL
- },
- STORAGE_BLOCKS4 = new IIconContainer[]{
- BLOCK_KNIGHTMETAL,
- BLOCK_LANTHANUM,
- BLOCK_LEAD,
- BLOCK_LUTETIUM,
- BLOCK_MAGNALIUM,
- BLOCK_MAGNESIUM,
- BLOCK_MANGANESE,
- BLOCK_METEORICIRON,
- BLOCK_METEORICSTEEL,
- BLOCK_TRINIUM,
- BLOCK_MITHRIL,
- BLOCK_MOLYBDENUM,
- BLOCK_NAQUADAH,
- BLOCK_NAQUADAHALLOY,
- BLOCK_NAQUADAHENRICHED,
- BLOCK_NAQUADRIA
- },
- STORAGE_BLOCKS5 = new IIconContainer[]{
- BLOCK_NEODYMIUM,
- BLOCK_NEODYMIUMMAGNETIC,
- BLOCK_NEUTRONIUM,
- BLOCK_NICHROME,
- BLOCK_NICKEL,
- BLOCK_NIOBIUM,
- BLOCK_NIOBIUMNITRIDE,
- BLOCK_NIOBIUMTITANIUM,
- BLOCK_OSMIRIDIUM,
- BLOCK_OSMIUM,
- BLOCK_PALLADIUM,
- BLOCK_PIGIRON,
- BLOCK_PLATINUM,
- BLOCK_PLUTONIUM,
- BLOCK_PLUTONIUM241,
- BLOCK_PRASEODYMIUM
- },
- STORAGE_BLOCKS6 = new IIconContainer[]{
- BLOCK_PROMETHIUM,
- BLOCK_REDALLOY,
- BLOCK_REDSTEEL,
- BLOCK_ROSEGOLD,
- BLOCK_RUBIDIUM,
- BLOCK_SAMARIUM,
- BLOCK_SCANDIUM,
- BLOCK_SHADOWIRON,
- BLOCK_SHADOWSTEEL,
- BLOCK_SILICON,
- BLOCK_SILVER,
- BLOCK_SOLDERINGALLOY,
- BLOCK_STAINLESSSTEEL,
- BLOCK_STEEL,
- BLOCK_STEELMAGNETIC,
- BLOCK_STERLINGSILVER
- },
- STORAGE_BLOCKS7 = new IIconContainer[]{
- BLOCK_SUNNARIUM,
- BLOCK_TANTALUM,
- BLOCK_TELLURIUM,
- BLOCK_TERBIUM,
- BLOCK_THAUMIUM,
- BLOCK_THORIUM,
- BLOCK_THULIUM,
- BLOCK_TIN,
- BLOCK_TINALLOY,
- BLOCK_TITANIUM,
- BLOCK_TRITANIUM,
- BLOCK_TUNGSTEN,
- BLOCK_TUNGSTENSTEEL,
- BLOCK_ULTIMET,
- BLOCK_URANIUM,
- BLOCK_URANIUM235
- },
- STORAGE_BLOCKS8 = new IIconContainer[]{
- BLOCK_VANADIUM,
- BLOCK_VANADIUMGALLIUM,
- BLOCK_WROUGHTIRON,
- BLOCK_YTTRBIUM,
- BLOCK_YTTRIUM,
- BLOCK_YTTRIUMBARIUMCUPRATE,
- BLOCK_ZINC,
- BLOCK_TUNGSTENCARBIDE,
- BLOCK_VANADIUMSTEEL,
- BLOCK_HSSG,
- BLOCK_HSSE,
- BLOCK_HSSS,
- BLOCK_STEELEAF,
- BLOCK_ICHORIUM,
- BLOCK_FIRESTONE
- },
- STORAGE_BLOCKS9 = new IIconContainer[]{
- BLOCK_AERCRYSTAL,
- BLOCK_AMBER,
- BLOCK_AMETHYST,
- BLOCK_AQUACRYSTAL,
- BLOCK_BLUETOPAZ,
- BLOCK_CERTUSQUARTZ,
- BLOCK_DILITHIUM,
- BLOCK_ENDEREYE,
- BLOCK_ENDERPEARL,
- BLOCK_FOOLSRUBY,
- BLOCK_FORCE,
- BLOCK_FORCICIUM,
- BLOCK_FORCILLIUM,
- BLOCK_GREENSAPPHIRE,
- BLOCK_IGNISCRYSTAL,
- BLOCK_JASPER
- },
- STORAGE_BLOCKS10 = new IIconContainer[]{
- BLOCK_LAZURITE,
- BLOCK_LIGNITE,
- BLOCK_MONAZITE,
- BLOCK_NITER,
- BLOCK_OLIVINE,
- BLOCK_OPAL,
- BLOCK_ORDOCRYSTAL,
- BLOCK_PERDITIOCRYSTAL,
- BLOCK_PHOSPHORUS,
- BLOCK_QUARTZITE,
- BLOCK_REDGARNET,
- BLOCK_RUBY,
- BLOCK_SAPPHIRE,
- BLOCK_SODALITE,
- BLOCK_TANZANITE,
- BLOCK_TERRACRYSTAL
- },
- STORAGE_BLOCKS11 = new IIconContainer[]{
- BLOCK_TOPAZ,
- BLOCK_VINTEUM,
- BLOCK_YELLOWGARNET,
- BLOCK_NETHERSTAR,
- BLOCK_CHARCOAL,
- BLOCK_BLAZE
- };
- public static ITexture[]
- ERROR_RENDERING = new ITexture[]{
- new GT_RenderedTexture(RENDERING_ERROR)
- };
- public static ITexture[] OVERLAYS_ENERGY_IN = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
- };
- public static ITexture[] OVERLAYS_ENERGY_OUT = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
- };
- public static ITexture[] OVERLAYS_ENERGY_IN_MULTI = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
- };
- public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
- };
- public static ITexture[] OVERLAYS_ENERGY_IN_POWER = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
- };
- public static ITexture[] OVERLAYS_ENERGY_OUT_POWER = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
- new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
- };
- public static ITexture[] LOCKERS = new ITexture[]{
- new GT_RenderedTexture(OVERLAY_LOCKER_000),
- new GT_RenderedTexture(OVERLAY_LOCKER_001),
- new GT_RenderedTexture(OVERLAY_LOCKER_002),
- new GT_RenderedTexture(OVERLAY_LOCKER_003),
- new GT_RenderedTexture(OVERLAY_LOCKER_004),
- new GT_RenderedTexture(OVERLAY_LOCKER_005),
- new GT_RenderedTexture(OVERLAY_LOCKER_006),
- new GT_RenderedTexture(OVERLAY_LOCKER_007),
- new GT_RenderedTexture(OVERLAY_LOCKER_008),
- new GT_RenderedTexture(OVERLAY_LOCKER_009),
- new GT_RenderedTexture(OVERLAY_LOCKER_010),
- new GT_RenderedTexture(OVERLAY_LOCKER_011),
- new GT_RenderedTexture(OVERLAY_LOCKER_012),
- new GT_RenderedTexture(OVERLAY_LOCKER_013),
- };
- /**
- * USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0]
- */
- @Deprecated
- public static ITexture[] CASING_BLOCKS = new ITexture[128];//original variable still limited to 128
- public static ITexture[][] MACHINE_CASINGS = new ITexture[16][17];
- /**
- * by Default pages are null
- */
- public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
-
- public static ITexture getCasingTextureForId(int id){
- return casingTexturePages[(id>>7)&0x7f][id&0x7f];
- }
- public static void setCasingTextureForId(int id,ITexture iTexture){
- casingTexturePages[(id>>7)&0x7f][id&0x7f]=iTexture;
- }
- public static void setCasingTexture(byte page,byte index,ITexture iTexture){
- casingTexturePages[page][index]=iTexture;
- }
-
- static {
- for (byte i = 0; i < MACHINE_CASINGS.length; i++)
- for (byte j = 0; j < MACHINE_CASINGS[i].length; j++)
- MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
- casingTexturePages[0] = CASING_BLOCKS;
- //adds some known pages, modders also can do it...
- GT_Utility.addTexturePage((byte)1);
- GT_Utility.addTexturePage((byte)8);
- }
-
- protected IIcon mIcon;
-
- BlockIcons() {
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon;
- protected String mIconName;
-
- public CustomIcon(String aIconName) {
- mIconName = aIconName;
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName);
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
- }
- }
-
- public enum ItemIcons implements IIconContainer, Runnable {
- VOID, // The Empty Texture
- RENDERING_ERROR,
- WRENCH,
- MORTAR,
- CROWBAR,
- JACKHAMMER,
- WIRE_CUTTER,
- KNIFE,
- BUTCHERYKNIFE,
- SICKLE,
- SCOOP,
- GRAFTER,
- PLUNGER,
- ROLLING_PIN,
- HANDLE_SWORD,
- HANDLE_FILE,
- HANDLE_SAW,
- HANDLE_SCREWDRIVER,
- HANDLE_BUZZSAW,
- HANDLE_ELECTRIC_SCREWDRIVER,
- HANDLE_SOLDERING,
- POWER_UNIT_LV,
- POWER_UNIT_MV,
- POWER_UNIT_HV,
- DURABILITY_BAR_0,
- DURABILITY_BAR_1,
- DURABILITY_BAR_2,
- DURABILITY_BAR_3,
- DURABILITY_BAR_4,
- DURABILITY_BAR_5,
- DURABILITY_BAR_6,
- DURABILITY_BAR_7,
- DURABILITY_BAR_8,
- ENERGY_BAR_0,
- ENERGY_BAR_1,
- ENERGY_BAR_2,
- ENERGY_BAR_3,
- ENERGY_BAR_4,
- ENERGY_BAR_5,
- ENERGY_BAR_6,
- ENERGY_BAR_7,
- ENERGY_BAR_8,
- TURBINE,
- TURBINE_SMALL,
- TURBINE_LARGE,
- TURBINE_HUGE;
-
- public static final IIconContainer[]
- DURABILITY_BAR = new IIconContainer[]{
- DURABILITY_BAR_0,
- DURABILITY_BAR_1,
- DURABILITY_BAR_2,
- DURABILITY_BAR_3,
- DURABILITY_BAR_4,
- DURABILITY_BAR_5,
- DURABILITY_BAR_6,
- DURABILITY_BAR_7,
- DURABILITY_BAR_8,
- },
- ENERGY_BAR = new IIconContainer[]{
- ENERGY_BAR_0,
- ENERGY_BAR_1,
- ENERGY_BAR_2,
- ENERGY_BAR_3,
- ENERGY_BAR_4,
- ENERGY_BAR_5,
- ENERGY_BAR_6,
- ENERGY_BAR_7,
- ENERGY_BAR_8,
- };
-
- public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
-
- protected IIcon mIcon, mOverlay;
-
- ItemIcons() {
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return mOverlay;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this);
- mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
- }
-
- public static class CustomIcon implements IIconContainer, Runnable {
- protected IIcon mIcon, mOverlay;
- protected String mIconName;
-
- public CustomIcon(String aIconName) {
- mIconName = aIconName;
- GregTech_API.sGTItemIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return mOverlay;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName);
- mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY");
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationItemsTexture;
- }
- }
- }
-}
+package gregtech.api.enums;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.GT_SidedTexture;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
+import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
+
+public class Textures {
+ public enum BlockIcons implements IIconContainer, Runnable {
+ //ADDED
+ MACHINE_UEV_SIDE,
+ MACHINE_UIV_SIDE,
+
+ MACHINE_UMV_SIDE,
+ MACHINE_UXV_SIDE,
+
+ MACHINE_OPV_SIDE,
+ MACHINE_MAXV_SIDE,
+
+ MACHINE_UEV_TOP,
+ MACHINE_UIV_TOP,
+
+ MACHINE_UMV_TOP,
+ MACHINE_UXV_TOP,
+
+ MACHINE_OPV_TOP,
+ MACHINE_MAXV_TOP,
+
+ MACHINE_UEV_BOTTOM,
+ MACHINE_UIV_BOTTOM,
+
+ MACHINE_UMV_BOTTOM,
+ MACHINE_UXV_BOTTOM,
+
+ MACHINE_OPV_BOTTOM,
+ MACHINE_MAXV_BOTTOM,
+
+ OVERLAY_SCHEST,
+ OVERLAY_STANK,
+
+ MACHINE_CASING_TANK_1,
+ MACHINE_CASING_TANK_2,
+ MACHINE_CASING_TANK_3,
+ MACHINE_CASING_TANK_4,
+
+ MACHINE_CASING_TANK_5,
+ MACHINE_CASING_TANK_6,
+ MACHINE_CASING_TANK_7,
+ MACHINE_CASING_TANK_8,
+
+ MACHINE_CASING_TANK_9,
+ MACHINE_CASING_TANK_10,
+ MACHINE_CASING_TANK_11,
+ MACHINE_CASING_TANK_12,
+
+ MACHINE_CASING_TANK_13,
+ MACHINE_CASING_TANK_14,
+ MACHINE_CASING_TANK_15,
+ MACHINE_CASING_TANK_0,
+
+ BLOCK_STEELEAF,
+ BLOCK_ICHORIUM,
+ BLOCK_FIRESTONE,
+
+ OVERLAY_ENERGY_IN_POWER,
+ OVERLAY_ENERGY_OUT_POWER,
+ OVERLAY_AUTOMAINTENANCE,
+ OVERLAY_AUTOMAINTENANCE_IDLE,
+ OVERLAY_TELEPORTER_SIDES,
+
+ //
+ VOID // The Empty Texture
+ ,
+ RENDERING_ERROR,
+ PIPE_RESTRICTOR,
+ INSULATION_FULL,
+ INSULATION_TINY,
+ INSULATION_SMALL,
+ INSULATION_MEDIUM,
+ INSULATION_MEDIUM_PLUS,
+ INSULATION_LARGE,
+ INSULATION_HUGE,
+ CFOAM_FRESH,
+
+ CFOAM_HARDENED,
+ SOLARPANEL,
+ SOLARPANEL_8V,
+ SOLARPANEL_LV,
+ SOLARPANEL_MV,
+ SOLARPANEL_HV,
+ SOLARPANEL_EV,
+ SOLARPANEL_IV,
+ SOLARPANEL_LuV,
+ SOLARPANEL_ZPM,
+
+ SOLARPANEL_UV,
+ SOLARPANEL_UHV,
+ SOLARPANEL_UEV,
+ SOLARPANEL_UIV,
+ VENT_NORMAL,
+ VENT_ADVANCED,
+ COVER_WOOD_PLATE,
+ ARROW_UP,
+ ARROW_DOWN,
+ ARROW_LEFT,
+ ARROW_RIGHT,
+ AUTOMATION_FILTER,
+ AUTOMATION_TYPEFILTER,
+
+ AUTOMATION_CHESTBUFFER,
+ AUTOMATION_SUPERBUFFER,
+ AUTOMATION_REGULATOR,
+ AUTOMATION_ITEMDISTRIBUTOR,
+ CONCRETE_LIGHT_STONE,
+ CONCRETE_LIGHT_COBBLE,
+ CONCRETE_LIGHT_COBBLE_MOSSY,
+
+ CONCRETE_LIGHT_BRICKS,
+ CONCRETE_LIGHT_BRICKS_CRACKED,
+ CONCRETE_LIGHT_BRICKS_MOSSY,
+ CONCRETE_LIGHT_BRICKS_CHISELED,
+ CONCRETE_LIGHT_SMOOTH,
+ CONCRETE_DARK_STONE,
+
+ CONCRETE_DARK_COBBLE,
+ CONCRETE_DARK_COBBLE_MOSSY,
+ CONCRETE_DARK_BRICKS,
+ CONCRETE_DARK_BRICKS_CRACKED,
+ CONCRETE_DARK_BRICKS_MOSSY,
+ CONCRETE_DARK_BRICKS_CHISELED,
+
+ CONCRETE_DARK_SMOOTH,
+ GRANITE_BLACK_STONE,
+ GRANITE_BLACK_COBBLE,
+ GRANITE_BLACK_COBBLE_MOSSY,
+ GRANITE_BLACK_BRICKS,
+ GRANITE_BLACK_BRICKS_CRACKED,
+ GRANITE_BLACK_BRICKS_MOSSY,
+
+ GRANITE_BLACK_BRICKS_CHISELED,
+ GRANITE_BLACK_SMOOTH,
+ GRANITE_RED_STONE,
+ GRANITE_RED_COBBLE,
+ GRANITE_RED_COBBLE_MOSSY,
+ GRANITE_RED_BRICKS,
+ GRANITE_RED_BRICKS_CRACKED,
+
+ GRANITE_RED_BRICKS_MOSSY,
+ GRANITE_RED_BRICKS_CHISELED,
+ GRANITE_RED_SMOOTH,
+ MACHINE_BRONZEBRICKS_TOP,
+ MACHINE_BRONZEBRICKS_SIDE,
+ MACHINE_BRONZEBRICKS_BOTTOM,
+
+ MACHINE_STEELBRICKS_TOP,
+ MACHINE_STEELBRICKS_SIDE,
+ MACHINE_STEELBRICKS_BOTTOM,
+ MACHINE_BRONZE_TOP,
+ MACHINE_BRONZE_SIDE,
+ MACHINE_BRONZE_BOTTOM,
+ MACHINE_STEEL_TOP,
+
+ MACHINE_STEEL_SIDE,
+ MACHINE_STEEL_BOTTOM,
+ MACHINE_8V_TOP,
+ MACHINE_8V_SIDE,
+ MACHINE_8V_BOTTOM,
+ MACHINE_LV_TOP,
+ MACHINE_LV_SIDE,
+ MACHINE_LV_BOTTOM,
+ MACHINE_MV_TOP,
+
+ MACHINE_MV_SIDE,
+ MACHINE_MV_BOTTOM,
+ MACHINE_HV_TOP,
+ MACHINE_HV_SIDE,
+ MACHINE_HV_BOTTOM,
+ MACHINE_EV_TOP,
+ MACHINE_EV_SIDE,
+ MACHINE_EV_BOTTOM,
+ MACHINE_IV_TOP,
+
+ MACHINE_IV_SIDE,
+ MACHINE_IV_BOTTOM,
+ MACHINE_LuV_TOP,
+ MACHINE_LuV_SIDE,
+ MACHINE_LuV_BOTTOM,
+ MACHINE_ZPM_TOP,
+ MACHINE_ZPM_SIDE,
+ MACHINE_ZPM_BOTTOM,
+ MACHINE_UV_TOP,
+
+ MACHINE_UV_SIDE,
+ MACHINE_UV_BOTTOM,
+ MACHINE_MAX_TOP,
+ MACHINE_MAX_SIDE,
+ MACHINE_MAX_BOTTOM,
+ MACHINE_BRONZEPLATEDBRICKS,
+ MACHINE_HEATPROOFCASING,
+ MACHINE_COIL_SUPERCONDUCTOR,
+
+ MACHINE_BRONZEBLASTFURNACE,
+ MACHINE_BRONZEBLASTFURNACE_ACTIVE,
+ MACHINE_CASING_ROBUST_TUNGSTENSTEEL,
+ MACHINE_CASING_CLEAN_STAINLESSSTEEL,
+ MACHINE_CASING_STABLE_TITANIUM,
+ MACHINE_CASING_MINING_OSMIRIDIUM,
+ MACHINE_CASING_MINING_NEUTRONIUM,
+ MACHINE_CASING_MINING_BLACKPLUTONIUM,
+
+ MACHINE_CASING_FIREBOX_TITANIUM,
+ MACHINE_CASING_FUSION_COIL,
+ MACHINE_CASING_FUSION,
+ MACHINE_CASING_FUSION_GLASS,
+ MACHINE_CASING_FUSION_GLASS_YELLOW,
+ MACHINE_CASING_FUSION_2,
+
+ MACHINE_CASING_MAGIC,
+ MACHINE_CASING_MAGIC_ACTIVE,
+ MACHINE_CASING_MAGIC_FRONT,
+ MACHINE_CASING_MAGIC_FRONT_ACTIVE,
+ MACHINE_CASING_DRAGONEGG,
+ MACHINE_CASING_SOLID_STEEL,
+
+ MACHINE_CASING_FROST_PROOF,
+ MACHINE_CASING_PUMP,
+ MACHINE_CASING_MOTOR,
+ MACHINE_CASING_PIPE_BRONZE,
+ MACHINE_CASING_PIPE_STEEL,
+ MACHINE_CASING_PIPE_TITANIUM,
+ MACHINE_CASING_PIPE_TUNGSTENSTEEL,
+ MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE,
+
+ MACHINE_CASING_GEARBOX_BRONZE,
+ MACHINE_CASING_GEARBOX_STEEL,
+ MACHINE_CASING_GEARBOX_TITANIUM,
+ MACHINE_CASING_GEARBOX_TUNGSTENSTEEL,
+ MACHINE_CASING_DATA_DRIVE,
+ MACHINE_CASING_CONTAINMENT_FIELD,
+
+ MACHINE_CASING_ASSEMBLER,
+ MACHINE_CASING_PROCESSOR,
+ MACHINE_CASING_STRIPES_A,
+ MACHINE_CASING_STRIPES_B,
+ MACHINE_CASING_RADIOACTIVEHAZARD,
+ MACHINE_CASING_BIOHAZARD,
+ MACHINE_CASING_EXPLOSIONHAZARD,
+
+ MACHINE_CASING_FIREHAZARD,
+ MACHINE_CASING_ACIDHAZARD,
+ MACHINE_CASING_MAGICHAZARD,
+ MACHINE_CASING_FROSTHAZARD,
+ MACHINE_CASING_NOISEHAZARD,
+ MACHINE_CASING_GRATE,
+ MACHINE_CASING_VENT,
+
+ MACHINE_CASING_RADIATIONPROOF,
+ MACHINE_CASING_FIREBOX_BRONZE,
+ MACHINE_CASING_FIREBOX_STEEL,
+ MACHINE_CASING_FIREBOX_TUNGSTENSTEEL,
+ MACHINE_CASING_ENGINE_INTAKE,
+ MACHINE_CASING_CHEMICALLY_INERT,
+ MACHINE_COIL_CUPRONICKEL,
+
+ MACHINE_CASING_DENSEBRICKS,
+ MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE,
+ MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE,
+
+ MACHINE_COIL_KANTHAL,
+ MACHINE_COIL_NICHROME,
+ MACHINE_COIL_TUNGSTENSTEEL,
+ MACHINE_COIL_HSSG,
+ MACHINE_COIL_NAQUADAH,
+ MACHINE_COIL_NAQUADAHALLOY,
+ MACHINE_COIL_ELECTRUMFLUX,
+ MACHINE_COIL_AWAKENEDDRACONIUM,
+ BOILER_SOLAR,
+ BOILER_FRONT,
+
+ BOILER_FRONT_ACTIVE,
+ BOILER_LAVA_FRONT,
+ BOILER_LAVA_FRONT_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_BACK,
+ NAQUADAH_REACTOR_SOLID_FRONT,
+ NAQUADAH_REACTOR_SOLID_SIDE,
+ NAQUADAH_REACTOR_SOLID_BOTTOM,
+
+ NAQUADAH_REACTOR_SOLID_TOP,
+ NAQUADAH_REACTOR_SOLID_BACK_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE,
+ NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE,
+
+ NAQUADAH_REACTOR_SOLID_TOP_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_BACK,
+ NAQUADAH_REACTOR_FLUID_FRONT,
+ NAQUADAH_REACTOR_FLUID_SIDE,
+ NAQUADAH_REACTOR_FLUID_BOTTOM,
+ NAQUADAH_REACTOR_FLUID_TOP,
+
+ NAQUADAH_REACTOR_FLUID_BACK_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE,
+ NAQUADAH_REACTOR_FLUID_TOP_ACTIVE,
+
+ DIESEL_GENERATOR_BACK,
+ DIESEL_GENERATOR_FRONT,
+ DIESEL_GENERATOR_SIDE,
+ DIESEL_GENERATOR_BOTTOM,
+ DIESEL_GENERATOR_TOP,
+ DIESEL_GENERATOR_BACK_ACTIVE,
+ DIESEL_GENERATOR_FRONT_ACTIVE,
+
+ DIESEL_GENERATOR_SIDE_ACTIVE,
+ DIESEL_GENERATOR_BOTTOM_ACTIVE,
+ DIESEL_GENERATOR_TOP_ACTIVE,
+ GAS_TURBINE_BACK,
+ GAS_TURBINE_FRONT,
+ GAS_TURBINE_SIDE,
+ GAS_TURBINE_BOTTOM,
+
+ GAS_TURBINE_TOP,
+ GAS_TURBINE_BACK_ACTIVE,
+ GAS_TURBINE_FRONT_ACTIVE,
+ GAS_TURBINE_SIDE_ACTIVE,
+ GAS_TURBINE_BOTTOM_ACTIVE,
+ GAS_TURBINE_TOP_ACTIVE,
+ STEAM_TURBINE_BACK,
+
+ STEAM_TURBINE_FRONT,
+ STEAM_TURBINE_SIDE,
+ STEAM_TURBINE_BOTTOM,
+ STEAM_TURBINE_TOP,
+ STEAM_TURBINE_BACK_ACTIVE,
+ STEAM_TURBINE_FRONT_ACTIVE,
+ STEAM_TURBINE_SIDE_ACTIVE,
+
+ STEAM_TURBINE_BOTTOM_ACTIVE,
+ STEAM_TURBINE_TOP_ACTIVE,
+ BLOCK_BRONZEPREIN,
+ BLOCK_STEELPREIN,
+ BLOCK_TITANIUMPREIN,
+ BLOCK_NAQUADAHPREIN,
+ BLOCK_NEUTRONIUMPREIN,
+ BLOCK_IRREIN,
+ BLOCK_PLASCRETE,
+ BLOCK_TSREIN,
+ OVERLAY_LOCKER,
+ OVERLAY_LOCKER_000,
+ OVERLAY_LOCKER_001,
+
+ OVERLAY_LOCKER_002,
+ OVERLAY_LOCKER_003,
+ OVERLAY_LOCKER_004,
+ OVERLAY_LOCKER_005,
+ OVERLAY_LOCKER_006,
+ OVERLAY_LOCKER_007,
+ OVERLAY_LOCKER_008,
+ OVERLAY_LOCKER_009,
+ OVERLAY_LOCKER_010,
+
+ OVERLAY_LOCKER_011,
+ OVERLAY_LOCKER_012,
+ OVERLAY_LOCKER_013,
+ OVERLAY_LENS,
+ OVERLAY_PIPE,
+ OVERLAY_PIPE_IN,
+ OVERLAY_PIPE_OUT,
+ OVERLAY_MUFFLER,
+ OVERLAY_CONTROLLER,
+ OVERLAY_ACTIVITYDETECTOR,
+
+ OVERLAY_ENERGYDETECTOR,
+ OVERLAY_FLUIDDETECTOR,
+ OVERLAY_ITEMDETECTOR,
+ OVERLAY_FUSION1,
+ OVERLAY_FUSION2,
+ OVERLAY_FUSION3,
+ OVERLAY_SCREEN,
+ OVERLAY_QTANK,
+ OVERLAY_QCHEST,
+ OVERLAY_SHUTTER,
+
+ OVERLAY_CLOSET,
+ OVERLAY_DUCTTAPE,
+ OVERLAY_MAINTENANCE,
+ OVERLAY_DATA_ACCESS,
+ OVERLAY_CONVEYOR,
+ OVERLAY_PUMP,
+ OVERLAY_ARM,
+ OVERLAY_DRAIN,
+ OVERLAY_CRAFTING,
+ OVERLAY_ENERGY_IN,
+ OVERLAY_ENERGY_OUT,
+
+ OVERLAY_ENERGY_IN_MULTI,
+ OVERLAY_ENERGY_OUT_MULTI,
+ OVERLAY_FRONT_LARGE_BOILER,
+ OVERLAY_FRONT_LARGE_BOILER_ACTIVE,
+ OVERLAY_FRONT_VACUUM_FREEZER,
+ OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE,
+
+ OVERLAY_FRONT_MULTI_SMELTER,
+ OVERLAY_FRONT_MULTI_SMELTER_ACTIVE,
+ OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE,
+ OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE,
+ OVERLAY_FRONT_IMPLOSION_COMPRESSOR,
+
+ OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE,
+ OVERLAY_TOP_POTIONBREWER,
+ OVERLAY_TOP_REPLICATOR,
+ OVERLAY_TOP_MASSFAB,
+ OVERLAY_TOP_STEAM_HAMMER,
+ OVERLAY_TOP_STEAM_FURNACE,
+ OVERLAY_TOP_STEAM_ALLOY_SMELTER,
+
+ OVERLAY_TOP_STEAM_MACERATOR,
+ OVERLAY_TOP_STEAM_COMPRESSOR,
+ OVERLAY_TOP_STEAM_EXTRACTOR,
+ OVERLAY_TOP_DISASSEMBLER,
+ OVERLAY_TOP_BOXINATOR,
+ OVERLAY_TOP_ROCK_BREAKER,
+ OVERLAY_TOP_SCANNER,
+
+ OVERLAY_FRONT_POTIONBREWER,
+ OVERLAY_FRONT_REPLICATOR,
+ OVERLAY_FRONT_MASSFAB,
+ OVERLAY_FRONT_STEAM_HAMMER,
+ OVERLAY_FRONT_STEAM_FURNACE,
+ OVERLAY_FRONT_STEAM_ALLOY_SMELTER,
+
+ OVERLAY_FRONT_STEAM_MACERATOR,
+ OVERLAY_FRONT_STEAM_COMPRESSOR,
+ OVERLAY_FRONT_STEAM_EXTRACTOR,
+ OVERLAY_FRONT_DISASSEMBLER,
+ OVERLAY_FRONT_BOXINATOR,
+ OVERLAY_FRONT_ROCK_BREAKER,
+
+ OVERLAY_FRONT_SCANNER,
+ OVERLAY_BOTTOM_POTIONBREWER,
+ OVERLAY_BOTTOM_REPLICATOR,
+ OVERLAY_BOTTOM_MASSFAB,
+ OVERLAY_BOTTOM_STEAM_HAMMER,
+ OVERLAY_BOTTOM_STEAM_FURNACE,
+
+ OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER,
+ OVERLAY_BOTTOM_STEAM_MACERATOR,
+ OVERLAY_BOTTOM_STEAM_COMPRESSOR,
+ OVERLAY_BOTTOM_STEAM_EXTRACTOR,
+ OVERLAY_BOTTOM_DISASSEMBLER,
+
+ OVERLAY_BOTTOM_BOXINATOR,
+ OVERLAY_BOTTOM_ROCK_BREAKER,
+ OVERLAY_BOTTOM_SCANNER,
+ OVERLAY_SIDE_POTIONBREWER,
+ OVERLAY_SIDE_REPLICATOR,
+ OVERLAY_SIDE_MASSFAB,
+ OVERLAY_SIDE_STEAM_HAMMER,
+
+ OVERLAY_SIDE_STEAM_FURNACE,
+ OVERLAY_SIDE_STEAM_ALLOY_SMELTER,
+ OVERLAY_SIDE_STEAM_MACERATOR,
+ OVERLAY_SIDE_STEAM_COMPRESSOR,
+ OVERLAY_SIDE_STEAM_EXTRACTOR,
+ OVERLAY_SIDE_DISASSEMBLER,
+
+ OVERLAY_SIDE_BOXINATOR,
+ OVERLAY_SIDE_ROCK_BREAKER,
+ OVERLAY_SIDE_SCANNER,
+ OVERLAY_TOP_POTIONBREWER_ACTIVE,
+ OVERLAY_TOP_REPLICATOR_ACTIVE,
+ OVERLAY_TOP_MASSFAB_ACTIVE,
+
+ OVERLAY_TOP_STEAM_HAMMER_ACTIVE,
+ OVERLAY_TOP_STEAM_FURNACE_ACTIVE,
+ OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE,
+ OVERLAY_TOP_STEAM_MACERATOR_ACTIVE,
+ OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE,
+
+ OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE,
+ OVERLAY_TOP_DISASSEMBLER_ACTIVE,
+ OVERLAY_TOP_BOXINATOR_ACTIVE,
+ OVERLAY_TOP_ROCK_BREAKER_ACTIVE,
+ OVERLAY_TOP_SCANNER_ACTIVE,
+ OVERLAY_FRONT_POTIONBREWER_ACTIVE,
+
+ OVERLAY_FRONT_REPLICATOR_ACTIVE,
+ OVERLAY_FRONT_MASSFAB_ACTIVE,
+ OVERLAY_FRONT_STEAM_HAMMER_ACTIVE,
+ OVERLAY_FRONT_STEAM_FURNACE_ACTIVE,
+ OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE,
+
+ OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE,
+ OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE,
+ OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE,
+ OVERLAY_FRONT_DISASSEMBLER_ACTIVE,
+ OVERLAY_FRONT_BOXINATOR_ACTIVE,
+
+ OVERLAY_FRONT_ROCK_BREAKER_ACTIVE,
+ OVERLAY_FRONT_SCANNER_ACTIVE,
+ OVERLAY_BOTTOM_POTIONBREWER_ACTIVE,
+ OVERLAY_BOTTOM_REPLICATOR_ACTIVE,
+ OVERLAY_BOTTOM_MASSFAB_ACTIVE,
+
+ OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE,
+ OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE,
+ OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE,
+ OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE,
+ OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE,
+
+ OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE,
+ OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE,
+ OVERLAY_BOTTOM_BOXINATOR_ACTIVE,
+ OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE,
+ OVERLAY_BOTTOM_SCANNER_ACTIVE,
+
+ OVERLAY_SIDE_POTIONBREWER_ACTIVE,
+ OVERLAY_SIDE_REPLICATOR_ACTIVE,
+ OVERLAY_SIDE_MASSFAB_ACTIVE,
+ OVERLAY_SIDE_STEAM_HAMMER_ACTIVE,
+ OVERLAY_SIDE_STEAM_FURNACE_ACTIVE,
+ OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE,
+
+ OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE,
+ OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE,
+ OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE,
+ OVERLAY_SIDE_DISASSEMBLER_ACTIVE,
+ OVERLAY_SIDE_BOXINATOR_ACTIVE,
+
+ OVERLAY_SIDE_ROCK_BREAKER_ACTIVE,
+ OVERLAY_SIDE_SCANNER_ACTIVE,
+ OVERLAY_ADV_PUMP,
+ OVERLAY_TELEPORTER,
+ OVERLAY_TELEPORTER_ACTIVE,
+ FUSIONI_1,
+ FUSIONI_2,
+ FUSIONI_3,
+ FUSIONI_4,
+ FUSIONI_5,
+
+ FUSIONI_6,
+ FUSIONI_7,
+ FUSIONI_8,
+ FUSIONI_9,
+ FUSIONI_10,
+ FUSIONI_11,
+ FUSIONI_12,
+ FUSIONII_1,
+ FUSIONII_2,
+ FUSIONII_3,
+ FUSIONII_4,
+ FUSIONII_5,
+ FUSIONII_6,
+ FUSIONII_7,
+ FUSIONII_8,
+ FUSIONII_9,
+
+ FUSIONII_10,
+ FUSIONII_11,
+ FUSIONII_12,
+ LARGETURBINE_ST1,
+ LARGETURBINE_ST2,
+ LARGETURBINE_ST3,
+ LARGETURBINE_ST4,
+ LARGETURBINE_ST5,
+ LARGETURBINE_ST6,
+ LARGETURBINE_ST7,
+ LARGETURBINE_ST8,
+
+ LARGETURBINE_ST9,
+ LARGETURBINE_ST_ACTIVE1,
+ LARGETURBINE_ST_ACTIVE2,
+ LARGETURBINE_ST_ACTIVE3,
+ LARGETURBINE_ST_ACTIVE4,
+ LARGETURBINE_ST_ACTIVE5,
+ LARGETURBINE_ST_ACTIVE6,
+ LARGETURBINE_ST_ACTIVE7,
+
+ LARGETURBINE_ST_ACTIVE8,
+ LARGETURBINE_ST_ACTIVE9,
+ LARGETURBINE_SS1,
+ LARGETURBINE_SS2,
+ LARGETURBINE_SS3,
+ LARGETURBINE_SS4,
+ LARGETURBINE_SS5,
+ LARGETURBINE_SS6,
+ LARGETURBINE_SS7,
+ LARGETURBINE_SS8,
+
+ LARGETURBINE_SS9,
+ LARGETURBINE_SS_ACTIVE1,
+ LARGETURBINE_SS_ACTIVE2,
+ LARGETURBINE_SS_ACTIVE3,
+ LARGETURBINE_SS_ACTIVE4,
+ LARGETURBINE_SS_ACTIVE5,
+ LARGETURBINE_SS_ACTIVE6,
+ LARGETURBINE_SS_ACTIVE7,
+
+ LARGETURBINE_SS_ACTIVE8,
+ LARGETURBINE_SS_ACTIVE9,
+ LARGETURBINE_TI1,
+ LARGETURBINE_TI2,
+ LARGETURBINE_TI3,
+ LARGETURBINE_TI4,
+ LARGETURBINE_TI5,
+ LARGETURBINE_TI6,
+ LARGETURBINE_TI7,
+
+ LARGETURBINE_TI8,
+ LARGETURBINE_TI9,
+ LARGETURBINE_TI_ACTIVE1,
+ LARGETURBINE_TI_ACTIVE2,
+ LARGETURBINE_TI_ACTIVE3,
+ LARGETURBINE_TI_ACTIVE4,
+ LARGETURBINE_TI_ACTIVE5,
+ LARGETURBINE_TI_ACTIVE6,
+
+ LARGETURBINE_TI_ACTIVE7,
+ LARGETURBINE_TI_ACTIVE8,
+ LARGETURBINE_TI_ACTIVE9,
+ LARGETURBINE_TU1,
+ LARGETURBINE_TU2,
+ LARGETURBINE_TU3,
+ LARGETURBINE_TU4,
+ LARGETURBINE_TU5,
+ LARGETURBINE_TU6,
+
+ LARGETURBINE_TU7,
+ LARGETURBINE_TU8,
+ LARGETURBINE_TU9,
+ LARGETURBINE_TU_ACTIVE1,
+ LARGETURBINE_TU_ACTIVE2,
+ LARGETURBINE_TU_ACTIVE3,
+ LARGETURBINE_TU_ACTIVE4,
+ LARGETURBINE_TU_ACTIVE5,
+
+ LARGETURBINE_TU_ACTIVE6,
+ LARGETURBINE_TU_ACTIVE7,
+ LARGETURBINE_TU_ACTIVE8,
+ LARGETURBINE_TU_ACTIVE9,
+ MACHINE_CASING_TURBINE,
+ BLOCK_ADAMANTIUM,
+ BLOCK_ALUMINIUM,
+ BLOCK_AMERICIUM,
+
+ BLOCK_ANNEALEDCOPPER,
+ BLOCK_ANTIMONY,
+ BLOCK_ARSENIC,
+ BLOCK_ASTRALSILVER,
+ BLOCK_BATTERYALLOY,
+ BLOCK_BERYLLIUM,
+ BLOCK_BISMUTH,
+ BLOCK_BISMUTHBRONZE,
+ BLOCK_BLACKBRONZE,
+ BLOCK_BLACKSTEEL,
+
+ BLOCK_BLUEALLOY,
+ BLOCK_BLUESTEEL,
+ BLOCK_BRASS,
+ BLOCK_BRONZE,
+ BLOCK_CAESIUM,
+ BLOCK_CERIUM,
+ BLOCK_CHROME,
+ BLOCK_CHROMIUMDIOXIDE,
+ BLOCK_COBALT,
+ BLOCK_COBALTBRASS,
+ BLOCK_COPPER,
+
+ BLOCK_CUPRONICKEL,
+ BLOCK_DAMASCUSSTEEL,
+ BLOCK_DARKIRON,
+ BLOCK_DEEPIRON,
+ BLOCK_DESH,
+ BLOCK_DURANIUM,
+ BLOCK_DYSPROSIUM,
+ BLOCK_ELECTRUM,
+ BLOCK_ELECTRUMFLUX,
+ BLOCK_ENDERIUM,
+
+ BLOCK_ERBIUM,
+ BLOCK_EUROPIUM,
+ BLOCK_FIERYSTEEL,
+ BLOCK_GADOLINIUM,
+ BLOCK_GALLIUM,
+ BLOCK_HOLMIUM,
+ BLOCK_HSLA,
+ BLOCK_INDIUM,
+ BLOCK_INFUSEDGOLD,
+ BLOCK_INVAR,
+ BLOCK_IRIDIUM,
+
+ BLOCK_IRONMAGNETIC,
+ BLOCK_IRONWOOD,
+ BLOCK_KANTHAL,
+ BLOCK_KNIGHTMETAL,
+ BLOCK_LANTHANUM,
+ BLOCK_LEAD,
+ BLOCK_LUTETIUM,
+ BLOCK_MAGNALIUM,
+ BLOCK_MAGNESIUM,
+ BLOCK_MANGANESE,
+ BLOCK_METEORICIRON,
+
+ BLOCK_METEORICSTEEL,
+ BLOCK_MIDASIUM,
+ BLOCK_TRINIUM,
+ BLOCK_MITHRIL,
+ BLOCK_MOLYBDENUM,
+ BLOCK_NAQUADAH,
+ BLOCK_NAQUADAHALLOY,
+ BLOCK_NAQUADAHENRICHED,
+ BLOCK_NAQUADRIA,
+ BLOCK_NEODYMIUM,
+ BLOCK_NEODYMIUMMAGNETIC,
+
+ BLOCK_NEUTRONIUM,
+ BLOCK_NICHROME,
+ BLOCK_NICKEL,
+ BLOCK_NIOBIUM,
+ BLOCK_NIOBIUMNITRIDE,
+ BLOCK_NIOBIUMTITANIUM,
+ BLOCK_OSMIRIDIUM,
+ BLOCK_OSMIUM,
+ BLOCK_PALLADIUM,
+ BLOCK_PIGIRON,
+ BLOCK_PLATINUM,
+
+ BLOCK_PLUTONIUM,
+ BLOCK_PLUTONIUM241,
+ BLOCK_PRASEODYMIUM,
+ BLOCK_PROMETHIUM,
+ BLOCK_REDALLOY,
+ BLOCK_REDSTEEL,
+ BLOCK_ROSEGOLD,
+ BLOCK_RUBIDIUM,
+ BLOCK_SAMARIUM,
+ BLOCK_SCANDIUM,
+ BLOCK_SHADOWIRON,
+
+ BLOCK_SHADOWSTEEL,
+ BLOCK_SILICON,
+ BLOCK_SILVER,
+ BLOCK_SOLDERINGALLOY,
+ BLOCK_STAINLESSSTEEL,
+ BLOCK_STEEL,
+ BLOCK_STEELMAGNETIC,
+ BLOCK_STERLINGSILVER,
+ BLOCK_SUNNARIUM,
+ BLOCK_TANTALUM,
+
+ BLOCK_TELLURIUM,
+ BLOCK_TERBIUM,
+ BLOCK_THAUMIUM,
+ BLOCK_THORIUM,
+ BLOCK_THULIUM,
+ BLOCK_TIN,
+ BLOCK_TINALLOY,
+ BLOCK_TITANIUM,
+ BLOCK_TRITANIUM,
+ BLOCK_TUNGSTEN,
+ BLOCK_TUNGSTENSTEEL,
+ BLOCK_ULTIMET,
+
+ BLOCK_URANIUM,
+ BLOCK_URANIUM235,
+ BLOCK_VANADIUM,
+ BLOCK_VANADIUMGALLIUM,
+ BLOCK_WROUGHTIRON,
+ BLOCK_YTTRBIUM,
+ BLOCK_YTTRIUM,
+ BLOCK_YTTRIUMBARIUMCUPRATE,
+ BLOCK_ZINC,
+ BLOCK_TUNGSTENCARBIDE,
+
+ BLOCK_VANADIUMSTEEL,
+ BLOCK_HSSG,
+ BLOCK_HSSE,
+ BLOCK_HSSS,
+ BLOCK_AERCRYSTAL,
+ BLOCK_AMBER,
+ BLOCK_AMETHYST,
+ BLOCK_AQUACRYSTAL,
+ BLOCK_BLUETOPAZ,
+ BLOCK_CERTUSQUARTZ,
+ BLOCK_DILITHIUM,
+
+ BLOCK_ENDEREYE,
+ BLOCK_ENDERPEARL,
+ BLOCK_FOOLSRUBY,
+ BLOCK_FORCE,
+ BLOCK_FORCICIUM,
+ BLOCK_FORCILLIUM,
+ BLOCK_GREENSAPPHIRE,
+ BLOCK_IGNISCRYSTAL,
+ BLOCK_JASPER,
+ BLOCK_LAZURITE,
+
+ BLOCK_LIGNITE,
+ BLOCK_MONAZITE,
+ BLOCK_NITER,
+ BLOCK_OLIVINE,
+ BLOCK_OPAL,
+ BLOCK_ORDOCRYSTAL,
+ BLOCK_PERDITIOCRYSTAL,
+ BLOCK_PHOSPHORUS,
+ BLOCK_QUARTZITE,
+ BLOCK_REDGARNET,
+ BLOCK_RUBY,
+
+ BLOCK_SAPPHIRE,
+ BLOCK_SODALITE,
+ BLOCK_TANZANITE,
+ BLOCK_TERRACRYSTAL,
+ BLOCK_TOPAZ,
+ BLOCK_VINTEUM,
+ BLOCK_YELLOWGARNET,
+ BLOCK_NETHERSTAR,
+ BLOCK_CHARCOAL,
+ BLOCK_BLAZE,
+ MARBLE_STONE,
+ MARBLE_COBBLE,
+
+ MARBLE_COBBLE_MOSSY,
+ MARBLE_BRICKS,
+ MARBLE_BRICKS_CRACKED,
+ MARBLE_BRICKS_MOSSY,
+ MARBLE_BRICKS_CHISELED,
+ MARBLE_SMOOTH,
+ BASALT_STONE,
+ BASALT_COBBLE,
+ BASALT_COBBLE_MOSSY,
+ BASALT_BRICKS,
+
+ BASALT_BRICKS_CRACKED,
+ BASALT_BRICKS_MOSSY,
+ BASALT_BRICKS_CHISELED,
+ BASALT_SMOOTH,
+ OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE,
+ OVERLAY_FRONT_HEAT_EXCHANGER,
+ OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE,
+
+ OVERLAY_FRONT_PROCESSING_ARRAY,
+ OVERLAY_FRONT_OIL_DRILL_ACTIVE,
+ OVERLAY_FRONT_OIL_DRILL,
+ OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE,
+ OVERLAY_FRONT_DIESEL_ENGINE,
+ OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE,
+
+ OVERLAY_FRONT_PYROLYSE_OVEN,
+ OVERLAY_FRONT_OIL_CRACKER_ACTIVE,
+ OVERLAY_FRONT_OIL_CRACKER,
+ OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE,
+ OVERLAY_FRONT_DISTILLATION_TOWER,
+
+ OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE,
+ OVERLAY_FRONT_ASSEMBLY_LINE,
+ OVERLAY_FRONT_ORE_DRILL_ACTIVE,
+ OVERLAY_FRONT_ORE_DRILL,
+ OVERLAY_TOP_CLEANROOM_ACTIVE,
+ OVERLAY_TOP_CLEANROOM,
+
+ OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR,
+ OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE,
+
+ PIPE_RESTRICTOR_UP,
+ PIPE_RESTRICTOR_DOWN,
+ PIPE_RESTRICTOR_LEFT,
+ PIPE_RESTRICTOR_RIGHT,
+ PIPE_RESTRICTOR_NU,
+ PIPE_RESTRICTOR_ND,
+ PIPE_RESTRICTOR_NL,
+ PIPE_RESTRICTOR_NR,
+
+ PIPE_RESTRICTOR_UD,
+ PIPE_RESTRICTOR_UL,
+ PIPE_RESTRICTOR_UR,
+ PIPE_RESTRICTOR_DL,
+ PIPE_RESTRICTOR_DR,
+ PIPE_RESTRICTOR_LR;
+
+ /**
+ * Icon for Fresh CFoam
+ */
+ public static final ITexture[] FRESHFOAM = new ITexture[]{new GT_RenderedTexture(CFOAM_FRESH)};
+ /**
+ * Icons for Hardened CFoam
+ * 0 = No Color
+ * 1 - 16 = Colors
+ */
+ public static final ITexture[][] HARDENEDFOAMS = new ITexture[][]{
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.CONSTRUCTION_FOAM.mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[0].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[1].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[2].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[3].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[4].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[5].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[6].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[7].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[8].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[9].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[10].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[11].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[12].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[13].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[14].mRGBa)},
+ new ITexture[]{new GT_RenderedTexture(CFOAM_HARDENED, Dyes.VALUES[15].mRGBa)}
+ };
+ /**
+ * Machine Casings by Tier
+ * 0 = 8V, 1 = LV, 2 = MV, 3 = HV, 4 = EV, 5 = IV, 6 = IV, 7 = IV, 8 = IV, 9 = IV
+ */
+ public static final IIconContainer[]
+ MACHINECASINGS_SIDE = new IIconContainer[]{
+ MACHINE_8V_SIDE,
+ MACHINE_LV_SIDE,
+ MACHINE_MV_SIDE,
+ MACHINE_HV_SIDE,
+ MACHINE_EV_SIDE,
+ MACHINE_IV_SIDE,
+ MACHINE_LuV_SIDE,
+ MACHINE_ZPM_SIDE,
+ MACHINE_UV_SIDE,
+ MACHINE_MAX_SIDE,
+ MACHINE_UEV_SIDE,
+ MACHINE_UIV_SIDE,
+ MACHINE_UMV_SIDE,
+ MACHINE_UXV_SIDE,
+ MACHINE_OPV_SIDE,
+ MACHINE_MAXV_SIDE,
+ },
+ MACHINECASINGS_TOP = new IIconContainer[]{
+ MACHINE_8V_TOP,
+ MACHINE_LV_TOP,
+ MACHINE_MV_TOP,
+ MACHINE_HV_TOP,
+ MACHINE_EV_TOP,
+ MACHINE_IV_TOP,
+ MACHINE_LuV_TOP,
+ MACHINE_ZPM_TOP,
+ MACHINE_UV_TOP,
+ MACHINE_MAX_TOP,
+ MACHINE_UEV_TOP,
+ MACHINE_UIV_TOP,
+ MACHINE_UMV_TOP,
+ MACHINE_UXV_TOP,
+ MACHINE_OPV_TOP,
+ MACHINE_MAXV_TOP,
+ },
+ MACHINECASINGS_BOTTOM = new IIconContainer[]{
+ MACHINE_8V_BOTTOM,
+ MACHINE_LV_BOTTOM,
+ MACHINE_MV_BOTTOM,
+ MACHINE_HV_BOTTOM,
+ MACHINE_EV_BOTTOM,
+ MACHINE_IV_BOTTOM,
+ MACHINE_LuV_BOTTOM,
+ MACHINE_ZPM_BOTTOM,
+ MACHINE_UV_BOTTOM,
+ MACHINE_MAX_BOTTOM,
+ MACHINE_UEV_BOTTOM,
+ MACHINE_UIV_BOTTOM,
+ MACHINE_UMV_BOTTOM,
+ MACHINE_UXV_BOTTOM,
+ MACHINE_OPV_BOTTOM,
+ MACHINE_MAXV_BOTTOM,
+ },
+ GRANITES = new IIconContainer[]{
+ GRANITE_BLACK_STONE,
+ GRANITE_BLACK_COBBLE,
+ GRANITE_BLACK_COBBLE_MOSSY,
+ GRANITE_BLACK_BRICKS,
+ GRANITE_BLACK_BRICKS_CRACKED,
+ GRANITE_BLACK_BRICKS_MOSSY,
+ GRANITE_BLACK_BRICKS_CHISELED,
+ GRANITE_BLACK_SMOOTH,
+ GRANITE_RED_STONE,
+ GRANITE_RED_COBBLE,
+ GRANITE_RED_COBBLE_MOSSY,
+ GRANITE_RED_BRICKS,
+ GRANITE_RED_BRICKS_CRACKED,
+ GRANITE_RED_BRICKS_MOSSY,
+ GRANITE_RED_BRICKS_CHISELED,
+ GRANITE_RED_SMOOTH,
+ },
+ CONCRETES = new IIconContainer[]{
+ CONCRETE_DARK_STONE,
+ CONCRETE_DARK_COBBLE,
+ CONCRETE_DARK_COBBLE_MOSSY,
+ CONCRETE_DARK_BRICKS,
+ CONCRETE_DARK_BRICKS_CRACKED,
+ CONCRETE_DARK_BRICKS_MOSSY,
+ CONCRETE_DARK_BRICKS_CHISELED,
+ CONCRETE_DARK_SMOOTH,
+ CONCRETE_LIGHT_STONE,
+ CONCRETE_LIGHT_COBBLE,
+ CONCRETE_LIGHT_COBBLE_MOSSY,
+ CONCRETE_LIGHT_BRICKS,
+ CONCRETE_LIGHT_BRICKS_CRACKED,
+ CONCRETE_LIGHT_BRICKS_MOSSY,
+ CONCRETE_LIGHT_BRICKS_CHISELED,
+ CONCRETE_LIGHT_SMOOTH,
+ },
+ STONES = new IIconContainer[]{
+ MARBLE_STONE,
+ MARBLE_COBBLE,
+ MARBLE_COBBLE_MOSSY,
+ MARBLE_BRICKS,
+ MARBLE_BRICKS_CRACKED,
+ MARBLE_BRICKS_MOSSY,
+ MARBLE_BRICKS_CHISELED,
+ MARBLE_SMOOTH,
+ BASALT_STONE,
+ BASALT_COBBLE,
+ BASALT_COBBLE_MOSSY,
+ BASALT_BRICKS,
+ BASALT_BRICKS_CRACKED,
+ BASALT_BRICKS_MOSSY,
+ BASALT_BRICKS_CHISELED,
+ BASALT_SMOOTH,
+ },
+ TURBINE = new IIconContainer[]{
+ LARGETURBINE_ST1,
+ LARGETURBINE_ST2,
+ LARGETURBINE_ST3,
+ LARGETURBINE_ST4,
+ LARGETURBINE_ST5,
+ LARGETURBINE_ST6,
+ LARGETURBINE_ST7,
+ LARGETURBINE_ST8,
+ LARGETURBINE_ST9
+ },
+ TURBINE_ACTIVE = new IIconContainer[]{
+ LARGETURBINE_ST_ACTIVE1,
+ LARGETURBINE_ST_ACTIVE2,
+ LARGETURBINE_ST_ACTIVE3,
+ LARGETURBINE_ST_ACTIVE4,
+ LARGETURBINE_ST_ACTIVE5,
+ LARGETURBINE_ST_ACTIVE6,
+ LARGETURBINE_ST_ACTIVE7,
+ LARGETURBINE_ST_ACTIVE8,
+ LARGETURBINE_ST_ACTIVE9
+ },
+ TURBINE1 = new IIconContainer[]{
+ LARGETURBINE_SS1,
+ LARGETURBINE_SS2,
+ LARGETURBINE_SS3,
+ LARGETURBINE_SS4,
+ LARGETURBINE_SS5,
+ LARGETURBINE_SS6,
+ LARGETURBINE_SS7,
+ LARGETURBINE_SS8,
+ LARGETURBINE_SS9
+ },
+ TURBINE_ACTIVE1 = new IIconContainer[]{
+ LARGETURBINE_SS_ACTIVE1,
+ LARGETURBINE_SS_ACTIVE2,
+ LARGETURBINE_SS_ACTIVE3,
+ LARGETURBINE_SS_ACTIVE4,
+ LARGETURBINE_SS_ACTIVE5,
+ LARGETURBINE_SS_ACTIVE6,
+ LARGETURBINE_SS_ACTIVE7,
+ LARGETURBINE_SS_ACTIVE8,
+ LARGETURBINE_SS_ACTIVE9
+ },
+ TURBINE2 = new IIconContainer[]{
+ LARGETURBINE_TI1,
+ LARGETURBINE_TI2,
+ LARGETURBINE_TI3,
+ LARGETURBINE_TI4,
+ LARGETURBINE_TI5,
+ LARGETURBINE_TI6,
+ LARGETURBINE_TI7,
+ LARGETURBINE_TI8,
+ LARGETURBINE_TI9
+ },
+ TURBINE_ACTIVE2 = new IIconContainer[]{
+ LARGETURBINE_TI_ACTIVE1,
+ LARGETURBINE_TI_ACTIVE2,
+ LARGETURBINE_TI_ACTIVE3,
+ LARGETURBINE_TI_ACTIVE4,
+ LARGETURBINE_TI_ACTIVE5,
+ LARGETURBINE_TI_ACTIVE6,
+ LARGETURBINE_TI_ACTIVE7,
+ LARGETURBINE_TI_ACTIVE8,
+ LARGETURBINE_TI_ACTIVE9
+ },
+ TURBINE3 = new IIconContainer[]{
+ LARGETURBINE_TU1,
+ LARGETURBINE_TU2,
+ LARGETURBINE_TU3,
+ LARGETURBINE_TU4,
+ LARGETURBINE_TU5,
+ LARGETURBINE_TU6,
+ LARGETURBINE_TU7,
+ LARGETURBINE_TU8,
+ LARGETURBINE_TU9
+ },
+ TURBINE_ACTIVE3 = new IIconContainer[]{
+ LARGETURBINE_TU_ACTIVE1,
+ LARGETURBINE_TU_ACTIVE2,
+ LARGETURBINE_TU_ACTIVE3,
+ LARGETURBINE_TU_ACTIVE4,
+ LARGETURBINE_TU_ACTIVE5,
+ LARGETURBINE_TU_ACTIVE6,
+ LARGETURBINE_TU_ACTIVE7,
+ LARGETURBINE_TU_ACTIVE8,
+ LARGETURBINE_TU_ACTIVE9
+ },
+ CONNECTED_HULLS = new IIconContainer[]{
+ CONCRETE_DARK_STONE,
+ FUSIONI_1,
+ FUSIONI_2,
+ FUSIONI_3,
+ FUSIONI_4,
+ FUSIONI_5,
+ FUSIONI_6,
+ FUSIONI_7,
+ FUSIONI_8,
+ FUSIONI_9,
+ FUSIONI_10,
+ FUSIONI_11,
+ FUSIONI_12,
+ FUSIONII_1,
+ FUSIONII_2,
+ FUSIONII_3,
+ FUSIONII_4,
+ FUSIONII_5,
+ FUSIONII_6,
+ FUSIONII_7,
+ FUSIONII_8,
+ FUSIONII_9,
+ FUSIONII_10,
+ FUSIONII_11,
+ FUSIONII_12,
+ },
+ STORAGE_BLOCKS1 = new IIconContainer[]{
+ BLOCK_ADAMANTIUM,
+ BLOCK_ALUMINIUM,
+ BLOCK_AMERICIUM,
+ BLOCK_ANNEALEDCOPPER,
+ BLOCK_ANTIMONY,
+ BLOCK_ARSENIC,
+ BLOCK_ASTRALSILVER,
+ BLOCK_BATTERYALLOY,
+ BLOCK_BERYLLIUM,
+ BLOCK_BISMUTH,
+ BLOCK_BISMUTHBRONZE,
+ BLOCK_BLACKBRONZE,
+ BLOCK_BLACKSTEEL,
+ BLOCK_BLUEALLOY,
+ BLOCK_BLUESTEEL,
+ BLOCK_BRASS
+ },
+ STORAGE_BLOCKS2 = new IIconContainer[]{
+ BLOCK_BRONZE,
+ BLOCK_CAESIUM,
+ BLOCK_CERIUM,
+ BLOCK_CHROME,
+ BLOCK_CHROMIUMDIOXIDE,
+ BLOCK_COBALT,
+ BLOCK_COBALTBRASS,
+ BLOCK_COPPER,
+ BLOCK_CUPRONICKEL,
+ BLOCK_DAMASCUSSTEEL,
+ BLOCK_DARKIRON,
+ BLOCK_DEEPIRON,
+ BLOCK_DESH,
+ BLOCK_DURANIUM,
+ BLOCK_DYSPROSIUM,
+ BLOCK_ELECTRUM
+ },
+ STORAGE_BLOCKS3 = new IIconContainer[]{
+ BLOCK_ELECTRUMFLUX,
+ BLOCK_ENDERIUM,
+ BLOCK_ERBIUM,
+ BLOCK_EUROPIUM,
+ BLOCK_FIERYSTEEL,
+ BLOCK_GADOLINIUM,
+ BLOCK_GALLIUM,
+ BLOCK_HOLMIUM,
+ BLOCK_HSLA,
+ BLOCK_INDIUM,
+ BLOCK_INFUSEDGOLD,
+ BLOCK_INVAR,
+ BLOCK_IRIDIUM,
+ BLOCK_IRONMAGNETIC,
+ BLOCK_IRONWOOD,
+ BLOCK_KANTHAL
+ },
+ STORAGE_BLOCKS4 = new IIconContainer[]{
+ BLOCK_KNIGHTMETAL,
+ BLOCK_LANTHANUM,
+ BLOCK_LEAD,
+ BLOCK_LUTETIUM,
+ BLOCK_MAGNALIUM,
+ BLOCK_MAGNESIUM,
+ BLOCK_MANGANESE,
+ BLOCK_METEORICIRON,
+ BLOCK_METEORICSTEEL,
+ BLOCK_TRINIUM,
+ BLOCK_MITHRIL,
+ BLOCK_MOLYBDENUM,
+ BLOCK_NAQUADAH,
+ BLOCK_NAQUADAHALLOY,
+ BLOCK_NAQUADAHENRICHED,
+ BLOCK_NAQUADRIA
+ },
+ STORAGE_BLOCKS5 = new IIconContainer[]{
+ BLOCK_NEODYMIUM,
+ BLOCK_NEODYMIUMMAGNETIC,
+ BLOCK_NEUTRONIUM,
+ BLOCK_NICHROME,
+ BLOCK_NICKEL,
+ BLOCK_NIOBIUM,
+ BLOCK_NIOBIUMNITRIDE,
+ BLOCK_NIOBIUMTITANIUM,
+ BLOCK_OSMIRIDIUM,
+ BLOCK_OSMIUM,
+ BLOCK_PALLADIUM,
+ BLOCK_PIGIRON,
+ BLOCK_PLATINUM,
+ BLOCK_PLUTONIUM,
+ BLOCK_PLUTONIUM241,
+ BLOCK_PRASEODYMIUM
+ },
+ STORAGE_BLOCKS6 = new IIconContainer[]{
+ BLOCK_PROMETHIUM,
+ BLOCK_REDALLOY,
+ BLOCK_REDSTEEL,
+ BLOCK_ROSEGOLD,
+ BLOCK_RUBIDIUM,
+ BLOCK_SAMARIUM,
+ BLOCK_SCANDIUM,
+ BLOCK_SHADOWIRON,
+ BLOCK_SHADOWSTEEL,
+ BLOCK_SILICON,
+ BLOCK_SILVER,
+ BLOCK_SOLDERINGALLOY,
+ BLOCK_STAINLESSSTEEL,
+ BLOCK_STEEL,
+ BLOCK_STEELMAGNETIC,
+ BLOCK_STERLINGSILVER
+ },
+ STORAGE_BLOCKS7 = new IIconContainer[]{
+ BLOCK_SUNNARIUM,
+ BLOCK_TANTALUM,
+ BLOCK_TELLURIUM,
+ BLOCK_TERBIUM,
+ BLOCK_THAUMIUM,
+ BLOCK_THORIUM,
+ BLOCK_THULIUM,
+ BLOCK_TIN,
+ BLOCK_TINALLOY,
+ BLOCK_TITANIUM,
+ BLOCK_TRITANIUM,
+ BLOCK_TUNGSTEN,
+ BLOCK_TUNGSTENSTEEL,
+ BLOCK_ULTIMET,
+ BLOCK_URANIUM,
+ BLOCK_URANIUM235
+ },
+ STORAGE_BLOCKS8 = new IIconContainer[]{
+ BLOCK_VANADIUM,
+ BLOCK_VANADIUMGALLIUM,
+ BLOCK_WROUGHTIRON,
+ BLOCK_YTTRBIUM,
+ BLOCK_YTTRIUM,
+ BLOCK_YTTRIUMBARIUMCUPRATE,
+ BLOCK_ZINC,
+ BLOCK_TUNGSTENCARBIDE,
+ BLOCK_VANADIUMSTEEL,
+ BLOCK_HSSG,
+ BLOCK_HSSE,
+ BLOCK_HSSS,
+ BLOCK_STEELEAF,
+ BLOCK_ICHORIUM,
+ BLOCK_FIRESTONE
+ },
+ STORAGE_BLOCKS9 = new IIconContainer[]{
+ BLOCK_AERCRYSTAL,
+ BLOCK_AMBER,
+ BLOCK_AMETHYST,
+ BLOCK_AQUACRYSTAL,
+ BLOCK_BLUETOPAZ,
+ BLOCK_CERTUSQUARTZ,
+ BLOCK_DILITHIUM,
+ BLOCK_ENDEREYE,
+ BLOCK_ENDERPEARL,
+ BLOCK_FOOLSRUBY,
+ BLOCK_FORCE,
+ BLOCK_FORCICIUM,
+ BLOCK_FORCILLIUM,
+ BLOCK_GREENSAPPHIRE,
+ BLOCK_IGNISCRYSTAL,
+ BLOCK_JASPER
+ },
+ STORAGE_BLOCKS10 = new IIconContainer[]{
+ BLOCK_LAZURITE,
+ BLOCK_LIGNITE,
+ BLOCK_MONAZITE,
+ BLOCK_NITER,
+ BLOCK_OLIVINE,
+ BLOCK_OPAL,
+ BLOCK_ORDOCRYSTAL,
+ BLOCK_PERDITIOCRYSTAL,
+ BLOCK_PHOSPHORUS,
+ BLOCK_QUARTZITE,
+ BLOCK_REDGARNET,
+ BLOCK_RUBY,
+ BLOCK_SAPPHIRE,
+ BLOCK_SODALITE,
+ BLOCK_TANZANITE,
+ BLOCK_TERRACRYSTAL
+ },
+ STORAGE_BLOCKS11 = new IIconContainer[]{
+ BLOCK_TOPAZ,
+ BLOCK_VINTEUM,
+ BLOCK_YELLOWGARNET,
+ BLOCK_NETHERSTAR,
+ BLOCK_CHARCOAL,
+ BLOCK_BLAZE
+ };
+ public static ITexture[]
+ ERROR_RENDERING = new ITexture[]{
+ new GT_RenderedTexture(RENDERING_ERROR)
+ };
+ public static ITexture[] OVERLAYS_ENERGY_IN = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN, new short[]{40, 40, 245, 0}),
+ };
+ public static ITexture[] OVERLAYS_ENERGY_OUT = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT, new short[]{40, 40, 245, 0}),
+ };
+ public static ITexture[] OVERLAYS_ENERGY_IN_MULTI = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[]{40, 40, 245, 0}),
+ };
+ public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[]{40, 40, 245, 0}),
+ };
+ public static ITexture[] OVERLAYS_ENERGY_IN_POWER = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[]{40, 40, 245, 0}),
+ };
+ public static ITexture[] OVERLAYS_ENERGY_OUT_POWER = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 180, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 220, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 100, 0, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{255, 255, 30, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{128, 128, 128, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{240, 240, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{220, 220, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{200, 200, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{180, 180, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{160, 160, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{140, 140, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{120, 120, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{100, 100, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}),
+ new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}),
+ };
+ public static ITexture[] LOCKERS = new ITexture[]{
+ new GT_RenderedTexture(OVERLAY_LOCKER_000),
+ new GT_RenderedTexture(OVERLAY_LOCKER_001),
+ new GT_RenderedTexture(OVERLAY_LOCKER_002),
+ new GT_RenderedTexture(OVERLAY_LOCKER_003),
+ new GT_RenderedTexture(OVERLAY_LOCKER_004),
+ new GT_RenderedTexture(OVERLAY_LOCKER_005),
+ new GT_RenderedTexture(OVERLAY_LOCKER_006),
+ new GT_RenderedTexture(OVERLAY_LOCKER_007),
+ new GT_RenderedTexture(OVERLAY_LOCKER_008),
+ new GT_RenderedTexture(OVERLAY_LOCKER_009),
+ new GT_RenderedTexture(OVERLAY_LOCKER_010),
+ new GT_RenderedTexture(OVERLAY_LOCKER_011),
+ new GT_RenderedTexture(OVERLAY_LOCKER_012),
+ new GT_RenderedTexture(OVERLAY_LOCKER_013),
+ };
+ /**
+ * USE casingTexturePages[page] instead of CASING_BLOCKS since it is casingTexturePages[0]
+ */
+ @Deprecated
+ public static ITexture[] CASING_BLOCKS = new ITexture[128];//original variable still limited to 128
+ public static ITexture[][] MACHINE_CASINGS = new ITexture[16][17];
+ /**
+ * by Default pages are null
+ */
+ public static ITexture[][] casingTexturePages = new ITexture[128][];//page holder so we don't make an short long array
+
+ public static ITexture getCasingTextureForId(int id){
+ return casingTexturePages[(id>>7)&0x7f][id&0x7f];
+ }
+ public static void setCasingTextureForId(int id,ITexture iTexture){
+ casingTexturePages[(id>>7)&0x7f][id&0x7f]=iTexture;
+ }
+ public static void setCasingTexture(byte page,byte index,ITexture iTexture){
+ casingTexturePages[page][index]=iTexture;
+ }
+
+ static {
+ for (byte i = 0; i < MACHINE_CASINGS.length; i++)
+ for (byte j = 0; j < MACHINE_CASINGS[i].length; j++)
+ MACHINE_CASINGS[i][j] = new GT_SidedTexture(MACHINECASINGS_BOTTOM[i], MACHINECASINGS_TOP[i], MACHINECASINGS_SIDE[i], Dyes.getModulation(j - 1, Dyes.MACHINE_METAL.mRGBa));
+ casingTexturePages[0] = CASING_BLOCKS;
+ //adds some known pages, modders also can do it...
+ GT_Utility.addTexturePage((byte)1);
+ GT_Utility.addTexturePage((byte)8);
+ }
+
+ protected IIcon mIcon;
+
+ BlockIcons() {
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+ }
+
+ public enum ItemIcons implements IIconContainer, Runnable {
+ VOID, // The Empty Texture
+ RENDERING_ERROR,
+ WRENCH,
+ MORTAR,
+ CROWBAR,
+ JACKHAMMER,
+ WIRE_CUTTER,
+ KNIFE,
+ BUTCHERYKNIFE,
+ SICKLE,
+ SCOOP,
+ GRAFTER,
+ PLUNGER,
+ ROLLING_PIN,
+ HANDLE_SWORD,
+ HANDLE_FILE,
+ HANDLE_SAW,
+ HANDLE_SCREWDRIVER,
+ HANDLE_BUZZSAW,
+ HANDLE_ELECTRIC_SCREWDRIVER,
+ HANDLE_SOLDERING,
+ POWER_UNIT_LV,
+ POWER_UNIT_MV,
+ POWER_UNIT_HV,
+ DURABILITY_BAR_0,
+ DURABILITY_BAR_1,
+ DURABILITY_BAR_2,
+ DURABILITY_BAR_3,
+ DURABILITY_BAR_4,
+ DURABILITY_BAR_5,
+ DURABILITY_BAR_6,
+ DURABILITY_BAR_7,
+ DURABILITY_BAR_8,
+ ENERGY_BAR_0,
+ ENERGY_BAR_1,
+ ENERGY_BAR_2,
+ ENERGY_BAR_3,
+ ENERGY_BAR_4,
+ ENERGY_BAR_5,
+ ENERGY_BAR_6,
+ ENERGY_BAR_7,
+ ENERGY_BAR_8,
+ TURBINE,
+ TURBINE_SMALL,
+ TURBINE_LARGE,
+ TURBINE_HUGE;
+
+ public static final IIconContainer[]
+ DURABILITY_BAR = new IIconContainer[]{
+ DURABILITY_BAR_0,
+ DURABILITY_BAR_1,
+ DURABILITY_BAR_2,
+ DURABILITY_BAR_3,
+ DURABILITY_BAR_4,
+ DURABILITY_BAR_5,
+ DURABILITY_BAR_6,
+ DURABILITY_BAR_7,
+ DURABILITY_BAR_8,
+ },
+ ENERGY_BAR = new IIconContainer[]{
+ ENERGY_BAR_0,
+ ENERGY_BAR_1,
+ ENERGY_BAR_2,
+ ENERGY_BAR_3,
+ ENERGY_BAR_4,
+ ENERGY_BAR_5,
+ ENERGY_BAR_6,
+ ENERGY_BAR_7,
+ ENERGY_BAR_8,
+ };
+
+ public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ ItemIcons() {
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + "iconsets/" + this + "_OVERLAY");
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(RES_PATH_ITEM + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
index 16fe07812f..bc822250fd 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java
@@ -1,19 +1,19 @@
-package gregtech.api.interfaces.metatileentity;
-
-/**
- * For pipes, wires, and other MetaTiles which need to be decided whether they should connect to the block at each side.
- */
-public interface IConnectable {
- /**
- * Try to connect to the Block at the specified side
- * returns the connection state. Non-positive values for failed, others for succeeded.
- */
- int connect(byte aSide);
-
- /**
- * Try to disconnect to the Block at the specified side
- */
- void disconnect(byte aSide);
-
- boolean isConnectedAtSide(int aSide);
-}
+package gregtech.api.interfaces.metatileentity;
+
+/**
+ * For pipes, wires, and other MetaTiles which need to be decided whether they should connect to the block at each side.
+ */
+public interface IConnectable {
+ /**
+ * Try to connect to the Block at the specified side
+ * returns the connection state. Non-positive values for failed, others for succeeded.
+ */
+ int connect(byte aSide);
+
+ /**
+ * Try to disconnect to the Block at the specified side
+ */
+ void disconnect(byte aSide);
+
+ boolean isConnectedAtSide(int aSide);
+}
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java
index b61fe99904..f136f4f32b 100644
--- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java
+++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java
@@ -1,101 +1,101 @@
-package gregtech.api.interfaces.metatileentity;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
-public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
- /**
- * @return if this Pipe can still be used.
- */
- boolean pipeCapacityCheck();
-
- /**
- * @return if this Pipe can still be used.
- */
- boolean incrementTransferCounter(int aIncrement);
-
- /**
- * Sends an ItemStack from aSender to the adjacent Blocks.
- *
- * @param aSender the BaseMetaTileEntity sending the Stack.
- * @return if it was able to send something
- */
- boolean sendItemStack(Object aSender);
-
- /**
- * Executes the Sending Code for inserting Stacks into the TileEntities.
- *
- * @param aSender the BaseMetaTileEntity sending the Stack.
- * @param aSide the Side of the PIPE facing the TileEntity.
- * @return if this Side was allowed to Output into the Block.
- */
- boolean insertItemStackIntoTileEntity(Object aSender, byte aSide);
-
- /**
- * Can be used to make flow control Pipes, like Redpowers Restriction Tubes.
- * Every normal Pipe returns a Value of 32768, so you can easily insert lower Numbers to set Routing priorities.
- * Negative Numbers to "suck" Items into a certain direction are also possible.
- */
- int getStepSize();
-
- /**
- * Utility for the Item Network
- */
- class Util {
- /**
- * @return a List of connected Item Pipes
- */
- public static Map<IMetaTileEntityItemPipe, Long> scanPipes(IMetaTileEntityItemPipe aMetaTileEntity, Map<IMetaTileEntityItemPipe, Long> aMap, long aStep, boolean aSuckItems, boolean aIgnoreCapacity) {
- aStep += aMetaTileEntity.getStepSize();
- if (aIgnoreCapacity || aMetaTileEntity.pipeCapacityCheck())
- if (aMap.get(aMetaTileEntity) == null || aMap.get(aMetaTileEntity) > aStep) {
- IGregTechTileEntity aBaseMetaTileEntity = aMetaTileEntity.getBaseMetaTileEntity();
- aMap.put(aMetaTileEntity, aStep);
- for (byte i = 0, j = 0; i < 6; i++) {
- if (aMetaTileEntity instanceof IConnectable && !((IConnectable) aMetaTileEntity).isConnectedAtSide(i))
- continue;
- j = GT_Utility.getOppositeSide(i);
- if (aSuckItems) {
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) {
- IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i);
- if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = tItemPipe.getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
- continue;
- }
- }
- if (tItemPipe instanceof BaseMetaPipeEntity) {
- IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity();
- if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsOut(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) {
- scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
- }
- }
- }
- } else {
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) {
- IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i);
- if (tItemPipe != null) {
- if (aBaseMetaTileEntity.getColorization() >= 0) {
- byte tColor = tItemPipe.getColorization();
- if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
- continue;
- }
- }
- if (tItemPipe instanceof BaseMetaPipeEntity) {
- IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity();
- if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsIn(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) {
- scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
- }
- }
- }
- }
- }
- }
- }
- return aMap;
- }
- }
-}
+package gregtech.api.interfaces.metatileentity;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Map;
+
+public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
+ /**
+ * @return if this Pipe can still be used.
+ */
+ boolean pipeCapacityCheck();
+
+ /**
+ * @return if this Pipe can still be used.
+ */
+ boolean incrementTransferCounter(int aIncrement);
+
+ /**
+ * Sends an ItemStack from aSender to the adjacent Blocks.
+ *
+ * @param aSender the BaseMetaTileEntity sending the Stack.
+ * @return if it was able to send something
+ */
+ boolean sendItemStack(Object aSender);
+
+ /**
+ * Executes the Sending Code for inserting Stacks into the TileEntities.
+ *
+ * @param aSender the BaseMetaTileEntity sending the Stack.
+ * @param aSide the Side of the PIPE facing the TileEntity.
+ * @return if this Side was allowed to Output into the Block.
+ */
+ boolean insertItemStackIntoTileEntity(Object aSender, byte aSide);
+
+ /**
+ * Can be used to make flow control Pipes, like Redpowers Restriction Tubes.
+ * Every normal Pipe returns a Value of 32768, so you can easily insert lower Numbers to set Routing priorities.
+ * Negative Numbers to "suck" Items into a certain direction are also possible.
+ */
+ int getStepSize();
+
+ /**
+ * Utility for the Item Network
+ */
+ class Util {
+ /**
+ * @return a List of connected Item Pipes
+ */
+ public static Map<IMetaTileEntityItemPipe, Long> scanPipes(IMetaTileEntityItemPipe aMetaTileEntity, Map<IMetaTileEntityItemPipe, Long> aMap, long aStep, boolean aSuckItems, boolean aIgnoreCapacity) {
+ aStep += aMetaTileEntity.getStepSize();
+ if (aIgnoreCapacity || aMetaTileEntity.pipeCapacityCheck())
+ if (aMap.get(aMetaTileEntity) == null || aMap.get(aMetaTileEntity) > aStep) {
+ IGregTechTileEntity aBaseMetaTileEntity = aMetaTileEntity.getBaseMetaTileEntity();
+ aMap.put(aMetaTileEntity, aStep);
+ for (byte i = 0, j = 0; i < 6; i++) {
+ if (aMetaTileEntity instanceof IConnectable && !((IConnectable) aMetaTileEntity).isConnectedAtSide(i))
+ continue;
+ j = GT_Utility.getOppositeSide(i);
+ if (aSuckItems) {
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) {
+ IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i);
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = tItemPipe.getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
+ continue;
+ }
+ }
+ if (tItemPipe instanceof BaseMetaPipeEntity) {
+ IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity();
+ if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsOut(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) {
+ scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
+ }
+ }
+ }
+ } else {
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) {
+ IGregTechTileEntity tItemPipe = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(i);
+ if (tItemPipe != null) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = tItemPipe.getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) {
+ continue;
+ }
+ }
+ if (tItemPipe instanceof BaseMetaPipeEntity) {
+ IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity();
+ if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsIn(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) {
+ scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return aMap;
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java
index bdeffc14c3..043a835fd5 100644
--- a/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java
+++ b/src/main/java/gregtech/api/items/GT_CoolantCell_Item.java
@@ -1,85 +1,85 @@
-package gregtech.api.items;
-
-import gregtech.api.GregTech_API;
-import ic2.core.util.StackUtil;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-
-import java.util.List;
-
-public class GT_CoolantCell_Item
- extends GT_Generic_Item {
- protected int heatStorage;
-
- public GT_CoolantCell_Item(String aUnlocalized, String aEnglish, int aMaxStore) {
- super(aUnlocalized, aEnglish, null);
- this.setMaxStackSize(1);
- this.setMaxDamage(100);
- setNoRepair();
- this.heatStorage = aMaxStore;
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- }
-
- protected static int getHeatOfStack(ItemStack aStack) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- aStack.setTagCompound(tNBT);
- }
- return tNBT.getInteger("heat");
- }
-
- protected void setHeatForStack(ItemStack aStack, int aHeat) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- aStack.setTagCompound(tNBT);
- }
- tNBT.setInteger("heat", aHeat);
- if (this.heatStorage > 0) {
- double var4 = (double) aHeat / (double) this.heatStorage;
- int var6 = (int) (aStack.getMaxDamage() * var4);
- if (var6 >= aStack.getMaxDamage()) {
- var6 = aStack.getMaxDamage() - 1;
- }
- aStack.setItemDamage(var6);
- }
- }
-
- public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- super.addAdditionalToolTips(aList, aStack, aPlayer);
- int rHeat = getHeatOfStack(aStack) * 10 / this.heatStorage;
- EnumChatFormatting color;
- switch (rHeat) {
- case 0: color = EnumChatFormatting.BLUE; break;
- case 1:
- case 2: color = EnumChatFormatting.GREEN; break;
- case 3:
- case 4:
- case 5:
- case 6: color = EnumChatFormatting.YELLOW; break;
- case 7:
- case 8: color = EnumChatFormatting.RED; break;
- default: color = EnumChatFormatting.DARK_RED; break;
- }
- aList.add(EnumChatFormatting.WHITE + String.format(trans("000", "Stored Heat: %s"), "" + color + getHeatOfStack(aStack)));
- switch (getControlTagOfStack(aStack)) {
- case 1:
- aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line1"));
- aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line2"));
- }
- }
-
- public int getControlTagOfStack(ItemStack stack) {
- NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
- return nbtData.getInteger("tag");
- }
-
- public void setControlTagOfStack(ItemStack stack, int tag) {
- NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
- nbtData.setInteger("tag", tag);
- }
-}
+package gregtech.api.items;
+
+import gregtech.api.GregTech_API;
+import ic2.core.util.StackUtil;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
+import java.util.List;
+
+public class GT_CoolantCell_Item
+ extends GT_Generic_Item {
+ protected int heatStorage;
+
+ public GT_CoolantCell_Item(String aUnlocalized, String aEnglish, int aMaxStore) {
+ super(aUnlocalized, aEnglish, null);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(100);
+ setNoRepair();
+ this.heatStorage = aMaxStore;
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ }
+
+ protected static int getHeatOfStack(ItemStack aStack) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
+ }
+ return tNBT.getInteger("heat");
+ }
+
+ protected void setHeatForStack(ItemStack aStack, int aHeat) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
+ }
+ tNBT.setInteger("heat", aHeat);
+ if (this.heatStorage > 0) {
+ double var4 = (double) aHeat / (double) this.heatStorage;
+ int var6 = (int) (aStack.getMaxDamage() * var4);
+ if (var6 >= aStack.getMaxDamage()) {
+ var6 = aStack.getMaxDamage() - 1;
+ }
+ aStack.setItemDamage(var6);
+ }
+ }
+
+ public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ super.addAdditionalToolTips(aList, aStack, aPlayer);
+ int rHeat = getHeatOfStack(aStack) * 10 / this.heatStorage;
+ EnumChatFormatting color;
+ switch (rHeat) {
+ case 0: color = EnumChatFormatting.BLUE; break;
+ case 1:
+ case 2: color = EnumChatFormatting.GREEN; break;
+ case 3:
+ case 4:
+ case 5:
+ case 6: color = EnumChatFormatting.YELLOW; break;
+ case 7:
+ case 8: color = EnumChatFormatting.RED; break;
+ default: color = EnumChatFormatting.DARK_RED; break;
+ }
+ aList.add(EnumChatFormatting.WHITE + String.format(trans("000", "Stored Heat: %s"), "" + color + getHeatOfStack(aStack)));
+ switch (getControlTagOfStack(aStack)) {
+ case 1:
+ aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line1"));
+ aList.add(StatCollector.translateToLocal("ic2.reactoritem.heatwarning.line2"));
+ }
+ }
+
+ public int getControlTagOfStack(ItemStack stack) {
+ NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
+ return nbtData.getInteger("tag");
+ }
+
+ public void setControlTagOfStack(ItemStack stack, int tag) {
+ NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
+ nbtData.setInteger("tag", tag);
+ }
+}
diff --git a/src/main/java/gregtech/api/items/GT_Generic_Item.java b/src/main/java/gregtech/api/items/GT_Generic_Item.java
index 52731f2f6c..70e5d23d5c 100644
--- a/src/main/java/gregtech/api/items/GT_Generic_Item.java
+++ b/src/main/java/gregtech/api/items/GT_Generic_Item.java
@@ -1,162 +1,162 @@
-package gregtech.api.items;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.SubTag;
-import gregtech.api.interfaces.IProjectileItem;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.BlockDispenser;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
-import net.minecraft.dispenser.BehaviorProjectileDispense;
-import net.minecraft.dispenser.IBlockSource;
-import net.minecraft.dispenser.IPosition;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.IProjectile;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.MOD_ID;
-import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
-
-/**
- * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur.
- */
-public class GT_Generic_Item extends Item implements IProjectileItem {
- private final String mName, mTooltip;
- protected IIcon mIcon;
-
- public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip) {
- this(aUnlocalized, aEnglish, aEnglishTooltip, true);
- }
-
- public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, boolean aWriteToolTipIntoLangFile) {
- super();
- mName = "gt." + aUnlocalized;
- GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish);
- if (GT_Utility.isStringValid(aEnglishTooltip))
- GT_LanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
- else mTooltip = null;
- setCreativeTab(GregTech_API.TAB_GREGTECH);
- GameRegistry.registerItem(this, mName, MOD_ID);
- BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
- }
-
- @Override
- public final Item setUnlocalizedName(String aName) {
- return this;
- }
-
- @Override
- public final String getUnlocalizedName() {
- return mName;
- }
-
- @Override
- public String getUnlocalizedName(ItemStack aStack) {
- return getHasSubtypes() ? mName + "." + getDamage(aStack) : mName;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aIconRegister) {
- mIcon = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : mName));
- }
-
- @Override
- public boolean doesSneakBypassUse(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public IIcon getIconFromDamage(int par1) {
- return mIcon;
- }
-
- public int getTier(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- if (getMaxDamage() > 0 && !getHasSubtypes())
- aList.add((aStack.getMaxDamage() - getDamage(aStack)) + " / " + aStack.getMaxDamage());
- if (mTooltip != null) aList.add(GT_LanguageManager.getTranslation(mTooltip));
- if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack));
- addAdditionalToolTips(aList, aStack, aPlayer);
- }
-
- protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- //
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- isItemStackUsable(aStack);
- }
-
- public boolean isItemStackUsable(ItemStack aStack) {
- return true;
- }
-
- public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
- EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
- IPosition iposition = BlockDispenser.func_149939_a(aSource);
- ItemStack itemstack1 = aStack.splitStack(1);
- BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
- return aStack;
- }
-
- @Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
- return null;
- }
-
- @Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
- return null;
- }
-
- @Override
- public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
- return false;
- }
-
- @Override
- public ItemStack getContainerItem(ItemStack aStack) {
- return null;
- }
-
- @Override
- public boolean hasContainerItem(ItemStack aStack) {
- return getContainerItem(aStack) != null;
- }
-
- public String trans(String aKey, String aEnglish){
- return GT_LanguageManager.addStringLocalization("Item_DESCRIPTION_Index_"+aKey, aEnglish, false);
- }
-
- public static class GT_Item_Dispense extends BehaviorProjectileDispense {
- @Override
- public ItemStack dispenseStack(IBlockSource aSource, ItemStack aStack) {
- return ((GT_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
- }
-
- @Override
- protected IProjectile getProjectileEntity(World aWorld, IPosition aPosition) {
- return null;
- }
- }
+package gregtech.api.items;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.SubTag;
+import gregtech.api.interfaces.IProjectileItem;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.block.BlockDispenser;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
+import net.minecraft.dispenser.BehaviorProjectileDispense;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.dispenser.IPosition;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.IProjectile;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumFacing;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+
+import java.util.List;
+
+import static gregtech.api.enums.GT_Values.MOD_ID;
+import static gregtech.api.enums.GT_Values.RES_PATH_ITEM;
+
+/**
+ * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur.
+ */
+public class GT_Generic_Item extends Item implements IProjectileItem {
+ private final String mName, mTooltip;
+ protected IIcon mIcon;
+
+ public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip) {
+ this(aUnlocalized, aEnglish, aEnglishTooltip, true);
+ }
+
+ public GT_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, boolean aWriteToolTipIntoLangFile) {
+ super();
+ mName = "gt." + aUnlocalized;
+ GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish);
+ if (GT_Utility.isStringValid(aEnglishTooltip))
+ GT_LanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
+ else mTooltip = null;
+ setCreativeTab(GregTech_API.TAB_GREGTECH);
+ GameRegistry.registerItem(this, mName, MOD_ID);
+ BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
+ }
+
+ @Override
+ public final Item setUnlocalizedName(String aName) {
+ return this;
+ }
+
+ @Override
+ public final String getUnlocalizedName() {
+ return mName;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack aStack) {
+ return getHasSubtypes() ? mName + "." + getDamage(aStack) : mName;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aIconRegister) {
+ mIcon = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : mName));
+ }
+
+ @Override
+ public boolean doesSneakBypassUse(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int par1) {
+ return mIcon;
+ }
+
+ public int getTier(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ if (getMaxDamage() > 0 && !getHasSubtypes())
+ aList.add((aStack.getMaxDamage() - getDamage(aStack)) + " / " + aStack.getMaxDamage());
+ if (mTooltip != null) aList.add(GT_LanguageManager.getTranslation(mTooltip));
+ if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack));
+ addAdditionalToolTips(aList, aStack, aPlayer);
+ }
+
+ protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ isItemStackUsable(aStack);
+ }
+
+ public boolean isItemStackUsable(ItemStack aStack) {
+ return true;
+ }
+
+ public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
+ EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
+ IPosition iposition = BlockDispenser.func_149939_a(aSource);
+ ItemStack itemstack1 = aStack.splitStack(1);
+ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
+ return aStack;
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ return null;
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ return null;
+ }
+
+ @Override
+ public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public boolean hasContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack) != null;
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Item_DESCRIPTION_Index_"+aKey, aEnglish, false);
+ }
+
+ public static class GT_Item_Dispense extends BehaviorProjectileDispense {
+ @Override
+ public ItemStack dispenseStack(IBlockSource aSource, ItemStack aStack) {
+ return ((GT_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
+ }
+
+ @Override
+ protected IProjectile getProjectileEntity(World aWorld, IPosition aPosition) {
+ return null;
+ }
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
index 2f5174beb7..264c510701 100644
--- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
+++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
@@ -1,616 +1,616 @@
-package gregtech.api.items;
-
-import gregtech.api.enums.SubTag;
-import gregtech.api.interfaces.IItemBehaviour;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import ic2.api.item.ElectricItem;
-import ic2.api.item.IElectricItem;
-import ic2.api.item.IElectricItemManager;
-import ic2.api.item.ISpecialElectricItem;
-import net.minecraft.dispenser.IBlockSource;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.inventory.Container;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidContainerItem;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.D1;
-import static gregtech.api.enums.GT_Values.V;
-
-public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final ConcurrentHashMap<Short, ArrayList<IItemBehaviour<GT_MetaBase_Item>>> mItemBehaviors = new ConcurrentHashMap<Short, ArrayList<IItemBehaviour<GT_MetaBase_Item>>>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
- */
- public GT_MetaBase_Item(String aUnlocalized) {
- super(aUnlocalized, "Generated Item", null, false);
- setHasSubtypes(true);
- setMaxDamage(0);
- }
-
- /**
- * Adds a special Item Behaviour to the Item.
- * <p/>
- * Note: the boolean Behaviours sometimes won't be executed if another boolean Behaviour returned true before.
- *
- * @param aMetaValue the Meta Value of the Item you want to add it to. [0 - 32765]
- * @param aBehavior the Click Behavior you want to add.
- * @return the Item itself for convenience in constructing.
- */
- public final GT_MetaBase_Item addItemBehavior(int aMetaValue, IItemBehaviour<GT_MetaBase_Item> aBehavior) {
- if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this;
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<IItemBehaviour<GT_MetaBase_Item>>(1);
- mItemBehaviors.put((short) aMetaValue, tList);
- }
- tList.add(aBehavior);
- return this;
- }
-
- public abstract Long[] getElectricStats(ItemStack aStack);
-
- public abstract Long[] getFluidContainerStats(ItemStack aStack);
-
- @Override
- public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true;
- return super.hasProjectile(aProjectileType, aStack);
- }
-
- @Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) {
- EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ);
- if (rArrow != null) return rArrow;
- }
- return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ);
- }
-
- @Override
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) {
- EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed);
- if (rArrow != null) return rArrow;
- }
- return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed);
- }
-
- @Override
- public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack);
- return super.onDispense(aSource, aStack);
- }
-
- @Override
- public boolean isItemStackUsable(ItemStack aStack) {
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- if (!tBehavior.isItemStackUsable(this, aStack)) return false;
- return super.isItemStackUsable(aStack);
- }
-
- @Override
- public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
- use(aStack, 0, aPlayer);
- isItemStackUsable(aStack);
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- return false;
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- return false;
- }
-
- @Override
- public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- use(aStack, 0, aPlayer);
- isItemStackUsable(aStack);
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- return false;
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- return false;
- }
-
- @Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- use(aStack, 0, aPlayer);
- isItemStackUsable(aStack);
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
- if (aStack.stackSize <= 0) {
- aPlayer.destroyCurrentEquippedItem();
- return false;
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- return false;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- use(aStack, 0, aPlayer);
- isItemStackUsable(aStack);
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- return aStack;
- }
-
- @Override
- public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- String tKey = getUnlocalizedName(aStack) + ".tooltip";
- String[] tStrings = GT_LanguageManager.getTranslation(tKey).split("/n ");
- for (String tString : tStrings)
- if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
-
- Long[]
- tStats = getElectricStats(aStack);
- if (tStats != null) {
- if (tStats[3] > 0) {
- aList.add(EnumChatFormatting.AQUA + String.format(trans("009", "Contains %s EU Tier: %s"), GT_Utility.formatNumbers(tStats[3]), "" + (tStats[2] >= 0 ? tStats[2] : 0)) + EnumChatFormatting.GRAY);
- } else {
- long tCharge = getRealCharge(aStack);
- if (tStats[3] == -2 && tCharge <= 0) {
- aList.add(EnumChatFormatting.AQUA + trans("010", "Empty. You should recycle it properly.") + EnumChatFormatting.GRAY);
- } else {
- aList.add(String.valueOf(EnumChatFormatting.AQUA) + String.format(trans("011", "%s / %s EU - Voltage: %s"), GT_Utility.formatNumbers(tCharge), GT_Utility.formatNumbers(Math.abs(tStats[0])), "" + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)]) + EnumChatFormatting.GRAY);
- }
- }
- }
-
- tStats = getFluidContainerStats(aStack);
- if (tStats != null && tStats[0] > 0) {
- FluidStack tFluid = getFluidContent(aStack);
- aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? trans("012", "No Fluids Contained") : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY);
- aList.add(EnumChatFormatting.BLUE + String.format(trans("013", "%sL / %sL"), "" + (tFluid == null ? 0 : tFluid.amount), "" + tStats[0]) + EnumChatFormatting.GRAY);
- }
-
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
-
- addAdditionalToolTips(aList, aStack, aPlayer);
- }
-
- @Override
- public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
- ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
- if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
- tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
- }
-
- @Override
- public final boolean canProvideEnergy(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null) return false;
- return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3));
- }
-
- @Override
- public final double getMaxCharge(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null) return 0;
- return Math.abs(tStats[0]);
- }
-
- @Override
- public final double getTransferLimit(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null) return 0;
- return Math.max(tStats[1], tStats[3]);
- }
-
- @Override
- public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1)
- return 0;
- //REALLY?? THIS IS THE CULPRIT THAT CHARGES ITEMS AT INSTANT!!!
- //long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- long tTransfer = aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge);
- long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.min(Math.abs(tStats[0]), Long.MAX_VALUE - tTransfer >= tChargeBefore ? tChargeBefore + tTransfer : Long.MAX_VALUE);
- if (!aSimulate) setCharge(aStack, tNewCharge);
- return tNewCharge - tChargeBefore;
- }
-
- @Override
- public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aBatteryAlike, boolean aSimulate) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier) return 0;
- if (aBatteryAlike && !canProvideEnergy(aStack)) return 0;
- if (tStats[3] > 0) {
- if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
- if (!aSimulate) aStack.stackSize--;
- return tStats[3];
- }
- long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) setCharge(aStack, tNewCharge);
- return tChargeBefore - tNewCharge;
- }
-
- @Override
- public final double getCharge(ItemStack aStack) {
- return getRealCharge(aStack);
- }
-
- @Override
- public final boolean canUse(ItemStack aStack, double aAmount) {
- return getRealCharge(aStack) >= aAmount;
- }
-
- @Override
- public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) {
- chargeFromArmor(aStack, aPlayer);
- if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true;
- double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
- if (Math.abs(tTransfer - aAmount) < .0000001) {
- discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- chargeFromArmor(aStack, aPlayer);
- return true;
- }
- discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- chargeFromArmor(aStack, aPlayer);
- return false;
- }
-
- @Override
- public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
- if (aPlayer == null || aPlayer.worldObj.isRemote) return;
- for (int i = 1; i < 5; i++) {
- ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) {
- double tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false);
- if (tCharge > 0) {
- charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- Container tContainer = ((EntityPlayer) aPlayer).openContainer;
- if (tContainer != null) tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
-
- /*
-
- @Override
- public final int getMaxCharge(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null) return 0;
- return (int)Math.abs(tStats[0]);
- }
-
- @Override
- public final int getTransferLimit(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null) return 0;
- return (int)Math.max(tStats[1], tStats[3]);
- }
-
- @Override
- public final int charge(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1) return 0;
- long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge==Integer.MAX_VALUE?Long.MAX_VALUE:Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit?aCharge:Math.min(tStats[1], aCharge)));
- if (!aSimulate) setCharge(aStack, tNewCharge);
- return (int)(tNewCharge-tChargeBefore);
- }
-
- @Override
- public final int discharge(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier) return 0;
- if (tStats[3] > 0) {
- if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
- if (!aSimulate) aStack.stackSize--;
- return (int)(long)tStats[3];
- }
- long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit?aCharge:Math.min(tStats[1], aCharge)));
- if (!aSimulate) setCharge(aStack, tNewCharge);
- return (int)(tChargeBefore-tNewCharge);
- }
-
- @Override
- public final int getCharge(ItemStack aStack) {
- return (int)Math.min(Integer.MAX_VALUE, getRealCharge(aStack));
- }
-
- @Override
- public final boolean canUse(ItemStack aStack, int aAmount) {
- return getRealCharge(aStack) >= aAmount;
- }
-
- @Override
- public final boolean use(ItemStack aStack, int aAmount, EntityLivingBase aPlayer) {
- chargeFromArmor(aStack, aPlayer);
- if (aPlayer instanceof EntityPlayer && ((EntityPlayer)aPlayer).capabilities.isCreativeMode) return true;
- int tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, true);
- if (tTransfer == aAmount) {
- discharge(aStack, aAmount, Integer.MAX_VALUE, true, false);
- chargeFromArmor(aStack, aPlayer);
- return true;
- }
- discharge(aStack, aAmount, Integer.MAX_VALUE, true, false);
- chargeFromArmor(aStack, aPlayer);
- return false;
- }
-
- @Override
- public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
- if (aPlayer == null || aPlayer.worldObj.isRemote) return;
- for (int i = 1; i < 5; i++) {
- ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- IElectricItem tArmorItem = (IElectricItem)tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) {
- int tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE-1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, false);
- if (tCharge > 0) {
- charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- Container tContainer = ((EntityPlayer)aPlayer).openContainer;
- if (tContainer != null) tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
- */
- public final long getRealCharge(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null) return 0;
- if (tStats[3] > 0) return (int) (long) tStats[3];
- NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
- }
-
- public final boolean setCharge(ItemStack aStack, long aCharge) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats == null || tStats[3] > 0) return false;
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) tNBT = new NBTTagCompound();
- tNBT.removeTag("GT.ItemCharge");
- aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
- if (aCharge > 0) {
- aStack.setItemDamage(getChargedMetaData(aStack));
- tNBT.setLong("GT.ItemCharge", aCharge);
- } else {
- aStack.setItemDamage(getEmptyMetaData(aStack));
- }
- if (tNBT.hasNoTags()) aStack.setTagCompound(null);
- else aStack.setTagCompound(tNBT);
- isItemStackUsable(aStack);
- return true;
- }
-
- public short getChargedMetaData(ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- public short getEmptyMetaData(ItemStack aStack) {
- return (short) aStack.getItemDamage();
- }
-
- @Override
- public FluidStack getFluid(ItemStack aStack) {
- return getFluidContent(aStack);
- }
-
- @Override
- public int getCapacity(ItemStack aStack) {
- Long[] tStats = getFluidContainerStats(aStack);
- return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
- }
-
- @Override
- public int fill(ItemStack aStack, FluidStack aFluid, boolean doFill) {
- if (aStack == null || aStack.stackSize != 1) return 0;
-
- ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false);
- if (tStack != null) {
- aStack.setItemDamage(tStack.getItemDamage());
- aStack.func_150996_a(tStack.getItem());
- return GT_Utility.getFluidForFilledItem(tStack, false).amount;
- }
-
- Long[] tStats = getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0)
- return 0;
-
- FluidStack tFluid = getFluidContent(aStack);
-
- if (tFluid == null || tFluid.getFluid().getID() <= 0) {
- if (aFluid.amount <= tStats[0]) {
- if (doFill) {
- setFluidContent(aStack, aFluid);
- }
- return aFluid.amount;
- }
- if (doFill) {
- tFluid = aFluid.copy();
- tFluid.amount = (int) (long) tStats[0];
- setFluidContent(aStack, tFluid);
- }
- return (int) (long) tStats[0];
- }
-
- if (!tFluid.isFluidEqual(aFluid)) return 0;
-
- int space = (int) (long) tStats[0] - tFluid.amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- tFluid.amount += aFluid.amount;
- setFluidContent(aStack, tFluid);
- }
- return aFluid.amount;
- }
- if (doFill) {
- tFluid.amount = (int) (long) tStats[0];
- setFluidContent(aStack, tFluid);
- }
- return space;
- }
-
- @Override
- public FluidStack drain(ItemStack aStack, int maxDrain, boolean doDrain) {
- if (aStack == null || aStack.stackSize != 1) return null;
-
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
- if (tFluid != null && maxDrain >= tFluid.amount) {
- ItemStack tStack = GT_Utility.getContainerItem(aStack, false);
- if (tStack == null) {
- aStack.stackSize = 0;
- return tFluid;
- }
- aStack.setItemDamage(tStack.getItemDamage());
- aStack.func_150996_a(tStack.getItem());
- return tFluid;
- }
-
- Long[] tStats = getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0) return null;
-
- tFluid = getFluidContent(aStack);
- if (tFluid == null) return null;
-
- int used = maxDrain;
- if (tFluid.amount < used) used = tFluid.amount;
- if (doDrain) {
- tFluid.amount -= used;
- setFluidContent(aStack, tFluid);
- }
-
- FluidStack drained = tFluid.copy();
- drained.amount = used;
- return drained;
- }
-
- public FluidStack getFluidContent(ItemStack aStack) {
- Long[] tStats = getFluidContainerStats(aStack);
- if (tStats == null || tStats[0] <= 0) return GT_Utility.getFluidForFilledItem(aStack, false);
- NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
- }
-
- public void setFluidContent(ItemStack aStack, FluidStack aFluid) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) tNBT = new NBTTagCompound();
- else tNBT.removeTag("GT.FluidContent");
- if (aFluid != null && aFluid.amount > 0)
- tNBT.setTag("GT.FluidContent", aFluid.writeToNBT(new NBTTagCompound()));
- if (tNBT.hasNoTags()) aStack.setTagCompound(null);
- else aStack.setTagCompound(tNBT);
- isItemStackUsable(aStack);
- }
-
- @Override
- public int getItemStackLimit(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- if (tStats != null && (tStats[3] == -1 || tStats[3] == -2 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1;
- tStats = getFluidContainerStats(aStack);
- if (tStats != null) return (int) (long) tStats[1];
- if(getDamage(aStack)==32763)return 1;
- return 64;
- }
-
- @Override
- public final Item getChargedItem(ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final Item getEmptyItem(ItemStack itemStack) {
- return this;
- }
-
- @Override
- public final int getTier(ItemStack aStack) {
- Long[] tStats = getElectricStats(aStack);
- return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
- }
-
- @Override
- public final String getToolTip(ItemStack aStack) {
- return null;
- } // This has its own ToolTip Handler, no need to let the IC2 Handler screw us up at this Point
-
- @Override
- public final IElectricItemManager getManager(ItemStack aStack) {
- return this;
- } // We are our own Manager
-
- @Override
- public final boolean getShareTag() {
- return true;
- } // just to be sure.
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
- return false;
- }
-}
+package gregtech.api.items;
+
+import gregtech.api.enums.SubTag;
+import gregtech.api.interfaces.IItemBehaviour;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+import ic2.api.item.ISpecialElectricItem;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.inventory.Container;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.GT_Values.V;
+
+public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ private final ConcurrentHashMap<Short, ArrayList<IItemBehaviour<GT_MetaBase_Item>>> mItemBehaviors = new ConcurrentHashMap<Short, ArrayList<IItemBehaviour<GT_MetaBase_Item>>>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
+ */
+ public GT_MetaBase_Item(String aUnlocalized) {
+ super(aUnlocalized, "Generated Item", null, false);
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ }
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * Note: the boolean Behaviours sometimes won't be executed if another boolean Behaviour returned true before.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to add it to. [0 - 32765]
+ * @param aBehavior the Click Behavior you want to add.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final GT_MetaBase_Item addItemBehavior(int aMetaValue, IItemBehaviour<GT_MetaBase_Item> aBehavior) {
+ if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this;
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<IItemBehaviour<GT_MetaBase_Item>>(1);
+ mItemBehaviors.put((short) aMetaValue, tList);
+ }
+ tList.add(aBehavior);
+ return this;
+ }
+
+ public abstract Long[] getElectricStats(ItemStack aStack);
+
+ public abstract Long[] getFluidContainerStats(ItemStack aStack);
+
+ @Override
+ public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true;
+ return super.hasProjectile(aProjectileType, aStack);
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) {
+ EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ);
+ if (rArrow != null) return rArrow;
+ }
+ return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList) {
+ EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed);
+ if (rArrow != null) return rArrow;
+ }
+ return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed);
+ }
+
+ @Override
+ public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack);
+ return super.onDispense(aSource, aStack);
+ }
+
+ @Override
+ public boolean isItemStackUsable(ItemStack aStack) {
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ if (!tBehavior.isItemStackUsable(this, aStack)) return false;
+ return super.isItemStackUsable(aStack);
+ }
+
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ try { if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return aStack;
+ }
+
+ @Override
+ public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ String tKey = getUnlocalizedName(aStack) + ".tooltip";
+ String[] tStrings = GT_LanguageManager.getTranslation(tKey).split("/n ");
+ for (String tString : tStrings)
+ if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
+
+ Long[]
+ tStats = getElectricStats(aStack);
+ if (tStats != null) {
+ if (tStats[3] > 0) {
+ aList.add(EnumChatFormatting.AQUA + String.format(trans("009", "Contains %s EU Tier: %s"), GT_Utility.formatNumbers(tStats[3]), "" + (tStats[2] >= 0 ? tStats[2] : 0)) + EnumChatFormatting.GRAY);
+ } else {
+ long tCharge = getRealCharge(aStack);
+ if (tStats[3] == -2 && tCharge <= 0) {
+ aList.add(EnumChatFormatting.AQUA + trans("010", "Empty. You should recycle it properly.") + EnumChatFormatting.GRAY);
+ } else {
+ aList.add(String.valueOf(EnumChatFormatting.AQUA) + String.format(trans("011", "%s / %s EU - Voltage: %s"), GT_Utility.formatNumbers(tCharge), GT_Utility.formatNumbers(Math.abs(tStats[0])), "" + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)]) + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+
+ tStats = getFluidContainerStats(aStack);
+ if (tStats != null && tStats[0] > 0) {
+ FluidStack tFluid = getFluidContent(aStack);
+ aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? trans("012", "No Fluids Contained") : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY);
+ aList.add(EnumChatFormatting.BLUE + String.format(trans("013", "%sL / %sL"), "" + (tFluid == null ? 0 : tFluid.amount), "" + tStats[0]) + EnumChatFormatting.GRAY);
+ }
+
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+
+ addAdditionalToolTips(aList, aStack, aPlayer);
+ }
+
+ @Override
+ public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
+ ArrayList<IItemBehaviour<GT_MetaBase_Item>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<GT_MetaBase_Item> tBehavior : tList)
+ tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
+ }
+
+ @Override
+ public final boolean canProvideEnergy(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return false;
+ return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3));
+ }
+
+ @Override
+ public final double getMaxCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final double getTransferLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1)
+ return 0;
+ //REALLY?? THIS IS THE CULPRIT THAT CHARGES ITEMS AT INSTANT!!!
+ //long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
+ long tTransfer = aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge);
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.min(Math.abs(tStats[0]), Long.MAX_VALUE - tTransfer >= tChargeBefore ? tChargeBefore + tTransfer : Long.MAX_VALUE);
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aBatteryAlike, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier) return 0;
+ if (aBatteryAlike && !canProvideEnergy(aStack)) return 0;
+ if (tStats[3] > 0) {
+ if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
+ if (!aSimulate) aStack.stackSize--;
+ return tStats[3];
+ }
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return tChargeBefore - tNewCharge;
+ }
+
+ @Override
+ public final double getCharge(ItemStack aStack) {
+ return getRealCharge(aStack);
+ }
+
+ @Override
+ public final boolean canUse(ItemStack aStack, double aAmount) {
+ return getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) {
+ chargeFromArmor(aStack, aPlayer);
+ if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true;
+ double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (Math.abs(tTransfer - aAmount) < .0000001) {
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
+ if (aPlayer == null || aPlayer.worldObj.isRemote) return;
+ for (int i = 1; i < 5; i++) {
+ ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) {
+ double tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false);
+ if (tCharge > 0) {
+ charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
+
+ @Override
+ public final int getMaxCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return (int)Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final int getTransferLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return (int)Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ public final int charge(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1) return 0;
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge==Integer.MAX_VALUE?Long.MAX_VALUE:Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit?aCharge:Math.min(tStats[1], aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return (int)(tNewCharge-tChargeBefore);
+ }
+
+ @Override
+ public final int discharge(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier) return 0;
+ if (tStats[3] > 0) {
+ if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
+ if (!aSimulate) aStack.stackSize--;
+ return (int)(long)tStats[3];
+ }
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit?aCharge:Math.min(tStats[1], aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return (int)(tChargeBefore-tNewCharge);
+ }
+
+ @Override
+ public final int getCharge(ItemStack aStack) {
+ return (int)Math.min(Integer.MAX_VALUE, getRealCharge(aStack));
+ }
+
+ @Override
+ public final boolean canUse(ItemStack aStack, int aAmount) {
+ return getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(ItemStack aStack, int aAmount, EntityLivingBase aPlayer) {
+ chargeFromArmor(aStack, aPlayer);
+ if (aPlayer instanceof EntityPlayer && ((EntityPlayer)aPlayer).capabilities.isCreativeMode) return true;
+ int tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, true);
+ if (tTransfer == aAmount) {
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false);
+ chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false);
+ chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
+ if (aPlayer == null || aPlayer.worldObj.isRemote) return;
+ for (int i = 1; i < 5; i++) {
+ ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ IElectricItem tArmorItem = (IElectricItem)tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) {
+ int tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE-1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, false);
+ if (tCharge > 0) {
+ charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ Container tContainer = ((EntityPlayer)aPlayer).openContainer;
+ if (tContainer != null) tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+ */
+ public final long getRealCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ if (tStats[3] > 0) return (int) (long) tStats[3];
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(ItemStack aStack, long aCharge) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[3] > 0) return false;
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ tNBT.removeTag("GT.ItemCharge");
+ aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
+ if (aCharge > 0) {
+ aStack.setItemDamage(getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ return true;
+ }
+
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public short getEmptyMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ @Override
+ public FluidStack getFluid(ItemStack aStack) {
+ return getFluidContent(aStack);
+ }
+
+ @Override
+ public int getCapacity(ItemStack aStack) {
+ Long[] tStats = getFluidContainerStats(aStack);
+ return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
+ }
+
+ @Override
+ public int fill(ItemStack aStack, FluidStack aFluid, boolean doFill) {
+ if (aStack == null || aStack.stackSize != 1) return 0;
+
+ ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false);
+ if (tStack != null) {
+ aStack.setItemDamage(tStack.getItemDamage());
+ aStack.func_150996_a(tStack.getItem());
+ return GT_Utility.getFluidForFilledItem(tStack, false).amount;
+ }
+
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0)
+ return 0;
+
+ FluidStack tFluid = getFluidContent(aStack);
+
+ if (tFluid == null || tFluid.getFluid().getID() <= 0) {
+ if (aFluid.amount <= tStats[0]) {
+ if (doFill) {
+ setFluidContent(aStack, aFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid = aFluid.copy();
+ tFluid.amount = (int) (long) tStats[0];
+ setFluidContent(aStack, tFluid);
+ }
+ return (int) (long) tStats[0];
+ }
+
+ if (!tFluid.isFluidEqual(aFluid)) return 0;
+
+ int space = (int) (long) tStats[0] - tFluid.amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ tFluid.amount += aFluid.amount;
+ setFluidContent(aStack, tFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid.amount = (int) (long) tStats[0];
+ setFluidContent(aStack, tFluid);
+ }
+ return space;
+ }
+
+ @Override
+ public FluidStack drain(ItemStack aStack, int maxDrain, boolean doDrain) {
+ if (aStack == null || aStack.stackSize != 1) return null;
+
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
+ if (tFluid != null && maxDrain >= tFluid.amount) {
+ ItemStack tStack = GT_Utility.getContainerItem(aStack, false);
+ if (tStack == null) {
+ aStack.stackSize = 0;
+ return tFluid;
+ }
+ aStack.setItemDamage(tStack.getItemDamage());
+ aStack.func_150996_a(tStack.getItem());
+ return tFluid;
+ }
+
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0) return null;
+
+ tFluid = getFluidContent(aStack);
+ if (tFluid == null) return null;
+
+ int used = maxDrain;
+ if (tFluid.amount < used) used = tFluid.amount;
+ if (doDrain) {
+ tFluid.amount -= used;
+ setFluidContent(aStack, tFluid);
+ }
+
+ FluidStack drained = tFluid.copy();
+ drained.amount = used;
+ return drained;
+ }
+
+ public FluidStack getFluidContent(ItemStack aStack) {
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0) return GT_Utility.getFluidForFilledItem(aStack, false);
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
+ }
+
+ public void setFluidContent(ItemStack aStack, FluidStack aFluid) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ else tNBT.removeTag("GT.FluidContent");
+ if (aFluid != null && aFluid.amount > 0)
+ tNBT.setTag("GT.FluidContent", aFluid.writeToNBT(new NBTTagCompound()));
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats != null && (tStats[3] == -1 || tStats[3] == -2 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1;
+ tStats = getFluidContainerStats(aStack);
+ if (tStats != null) return (int) (long) tStats[1];
+ if(getDamage(aStack)==32763)return 1;
+ return 64;
+ }
+
+ @Override
+ public final Item getChargedItem(ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final Item getEmptyItem(ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final int getTier(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
+ }
+
+ @Override
+ public final String getToolTip(ItemStack aStack) {
+ return null;
+ } // This has its own ToolTip Handler, no need to let the IC2 Handler screw us up at this Point
+
+ @Override
+ public final IElectricItemManager getManager(ItemStack aStack) {
+ return this;
+ } // We are our own Manager
+
+ @Override
+ public final boolean getShareTag() {
+ return true;
+ } // just to be sure.
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+}
diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java
index e80338540d..559c2b2fdc 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X01.java
@@ -1,191 +1,191 @@
-package gregtech.api.items;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.M;
-
-/**
- * @author Gregorius Techneticies
- * <p/>
- * One Item for everything!
- * <p/>
- * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar.
- * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material.
- * <p/>
- * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData.
- * <p/>
- * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item.
- */
-public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
-
- protected final OrePrefixes mPrefix;
- protected final int mIconSetIndex;
-
- /**
- * Creates the Item using these Parameters. This is for the new 1 Item = 1 Prefix System.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- * @param aGeneratedPrefix The OreDict Prefix you want to have generated.
- * @param aIconSetIndex The TextureSet Index to be used. -1 for Defaulting to the Data contained in the Prefix. (this is only to be used for selecting the Icon in getIconContainer, nothing else)
- */
- public GT_MetaGenerated_Item_X01(String aUnlocalized, OrePrefixes aGeneratedPrefix, int aIconSetIndex) {
- super(aUnlocalized, (short) 32000, (short) 766);
- mPrefix = aGeneratedPrefix;
- mIconSetIndex = aIconSetIndex >= 0 ? aIconSetIndex : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0;
-
- for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
- OrePrefixes tPrefix = mPrefix;
- if (tPrefix == null) continue;
- Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
- if (tMaterial == null) continue;
- if (mPrefix.doGenerateItem(tMaterial)) {
- ItemStack tStack = new ItemStack(this, 1, i);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) : getDefaultLocalization(tPrefix, tMaterial, i));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M));
- String tOreName = getOreDictString(tPrefix, tMaterial);
- tPrefix = OrePrefixes.getOrePrefix(tOreName);
- if (tPrefix != null && tPrefix.mIsUnificatable) {
- GT_OreDictUnificator.set(tPrefix, OrePrefixes.getMaterial(tOreName, tPrefix), tStack);
- } else {
- GT_OreDictUnificator.registerOre(tOreName, tStack);
- }
- }
- }
- }
-
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
-
- /**
- * @param aPrefix the OreDict Prefix
- * @param aMaterial the Material
- * @param aMetaData a Index from [0 - 31999]
- * @return the Localized Name when default LangFiles are used.
- */
- public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
- return aPrefix.getDefaultLocalNameForItem(aMaterial);
- }
-
- /**
- * @param aPrefix the OreDict Prefix
- * @param aMaterial the Material
- * @param aMetaData a Index from [0 - 31999]
- * @return the Localized Name Format when default LangFiles are used.
- */
- public String getDefaultLocalizationFormat(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
- return aPrefix.getDefaultLocalNameFormatForItem(aMaterial);
- }
-
- /**
- * @param aPrefix always != null
- * @param aMaterial always != null
- * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well.
- * @return if this Item should be visible in NEI or Creative
- */
- public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
- return true;
- }
-
- /**
- * @return the name of the Item to be registered at the OreDict.
- */
- public String getOreDictString(OrePrefixes aPrefix, Materials aMaterial) {
- return aPrefix.get(aMaterial).toString();
- }
-
- public IIconContainer getIconContainer(int aMetaData, Materials aMaterial) {
- return aMaterial.mIconSet.mTextures[mIconSetIndex];
- }
-
- /* ---------- INTERNAL OVERRIDES ---------- */
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- int aDamage = aStack.getItemDamage();
- if (aDamage < 32000 && aDamage >= 0)
- return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
- return aName;
- }
-
- @Override
- public ItemStack getContainerItem(ItemStack aStack) {
- int aMetaData = aStack.getItemDamage();
- if (aMetaData < GregTech_API.sGeneratedMaterials.length && aMetaData >= 0) {
- Materials aMaterial = GregTech_API.sGeneratedMaterials[aMetaData];
- if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
- return GT_Utility.copyAmount(1, mPrefix.mContainerItem);
- }
- }
- return null;
- }
-
- @Override
- public short[] getRGBa(ItemStack aStack) {
- int aMetaData = getDamage(aStack);
- return aMetaData < GregTech_API.sGeneratedMaterials.length && GregTech_API.sGeneratedMaterials[aMetaData] != null ? GregTech_API.sGeneratedMaterials[aMetaData].mRGBa : Materials._NULL.mRGBa;
- }
-
- @Override
- public final IIconContainer getIconContainer(int aMetaData) {
- return aMetaData < GregTech_API.sGeneratedMaterials.length && GregTech_API.sGeneratedMaterials[aMetaData] != null ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData]) : null;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
- for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++)
- if (mPrefix.doGenerateItem(GregTech_API.sGeneratedMaterials[i]) && doesShowInCreative(mPrefix, GregTech_API.sGeneratedMaterials[i], GregTech_API.sDoShowAllItemsInCreative)) {
- ItemStack tStack = new ItemStack(this, 1, i);
- isItemStackUsable(tStack);
- aList.add(tStack);
- }
- super.getSubItems(var1, aCreativeTab, aList);
- }
-
- @Override
- public final IIcon getIconFromDamage(int aMetaData) {
- if (aMetaData < 0) return null;
- if (aMetaData < GregTech_API.sGeneratedMaterials.length) {
- Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData];
- if (tMaterial == null) return null;
- IIconContainer tIcon = getIconContainer(aMetaData, tMaterial);
- if (tIcon != null) return tIcon.getIcon();
- return null;
- }
- return aMetaData >= mOffset && aMetaData - mOffset < mIconList.length ? mIconList[aMetaData - mOffset][0] : null;
- }
-
- @Override
- public int getItemStackLimit(ItemStack aStack) {
- return getDamage(aStack) < mOffset ? Math.min(super.getItemStackLimit(aStack), mPrefix.mDefaultStackSize) : super.getItemStackLimit(aStack);
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
- return false;
- }
+package gregtech.api.items;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+import java.util.List;
+
+import static gregtech.api.enums.GT_Values.M;
+
+/**
+ * @author Gregorius Techneticies
+ * <p/>
+ * One Item for everything!
+ * <p/>
+ * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar.
+ * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material.
+ * <p/>
+ * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData.
+ * <p/>
+ * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item.
+ */
+public abstract class GT_MetaGenerated_Item_X01 extends GT_MetaGenerated_Item {
+
+ protected final OrePrefixes mPrefix;
+ protected final int mIconSetIndex;
+
+ /**
+ * Creates the Item using these Parameters. This is for the new 1 Item = 1 Prefix System.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefix The OreDict Prefix you want to have generated.
+ * @param aIconSetIndex The TextureSet Index to be used. -1 for Defaulting to the Data contained in the Prefix. (this is only to be used for selecting the Icon in getIconContainer, nothing else)
+ */
+ public GT_MetaGenerated_Item_X01(String aUnlocalized, OrePrefixes aGeneratedPrefix, int aIconSetIndex) {
+ super(aUnlocalized, (short) 32000, (short) 766);
+ mPrefix = aGeneratedPrefix;
+ mIconSetIndex = aIconSetIndex >= 0 ? aIconSetIndex : aGeneratedPrefix.mTextureIndex >= 0 ? aGeneratedPrefix.mTextureIndex : 0;
+
+ for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
+ OrePrefixes tPrefix = mPrefix;
+ if (tPrefix == null) continue;
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
+ if (tMaterial == null) continue;
+ if (mPrefix.doGenerateItem(tMaterial)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) : getDefaultLocalization(tPrefix, tMaterial, i));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M));
+ String tOreName = getOreDictString(tPrefix, tMaterial);
+ tPrefix = OrePrefixes.getOrePrefix(tOreName);
+ if (tPrefix != null && tPrefix.mIsUnificatable) {
+ GT_OreDictUnificator.set(tPrefix, OrePrefixes.getMaterial(tOreName, tPrefix), tStack);
+ } else {
+ GT_OreDictUnificator.registerOre(tOreName, tStack);
+ }
+ }
+ }
+ }
+
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+
+ /**
+ * @param aPrefix the OreDict Prefix
+ * @param aMaterial the Material
+ * @param aMetaData a Index from [0 - 31999]
+ * @return the Localized Name when default LangFiles are used.
+ */
+ public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
+ return aPrefix.getDefaultLocalNameForItem(aMaterial);
+ }
+
+ /**
+ * @param aPrefix the OreDict Prefix
+ * @param aMaterial the Material
+ * @param aMetaData a Index from [0 - 31999]
+ * @return the Localized Name Format when default LangFiles are used.
+ */
+ public String getDefaultLocalizationFormat(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
+ return aPrefix.getDefaultLocalNameFormatForItem(aMaterial);
+ }
+
+ /**
+ * @param aPrefix always != null
+ * @param aMaterial always != null
+ * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well.
+ * @return if this Item should be visible in NEI or Creative
+ */
+ public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
+ return true;
+ }
+
+ /**
+ * @return the name of the Item to be registered at the OreDict.
+ */
+ public String getOreDictString(OrePrefixes aPrefix, Materials aMaterial) {
+ return aPrefix.get(aMaterial).toString();
+ }
+
+ public IIconContainer getIconContainer(int aMetaData, Materials aMaterial) {
+ return aMaterial.mIconSet.mTextures[mIconSetIndex];
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ String aName = super.getItemStackDisplayName(aStack);
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0)
+ return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
+ return aName;
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ int aMetaData = aStack.getItemDamage();
+ if (aMetaData < GregTech_API.sGeneratedMaterials.length && aMetaData >= 0) {
+ Materials aMaterial = GregTech_API.sGeneratedMaterials[aMetaData];
+ if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
+ return GT_Utility.copyAmount(1, mPrefix.mContainerItem);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public short[] getRGBa(ItemStack aStack) {
+ int aMetaData = getDamage(aStack);
+ return aMetaData < GregTech_API.sGeneratedMaterials.length && GregTech_API.sGeneratedMaterials[aMetaData] != null ? GregTech_API.sGeneratedMaterials[aMetaData].mRGBa : Materials._NULL.mRGBa;
+ }
+
+ @Override
+ public final IIconContainer getIconContainer(int aMetaData) {
+ return aMetaData < GregTech_API.sGeneratedMaterials.length && GregTech_API.sGeneratedMaterials[aMetaData] != null ? getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData]) : null;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++)
+ if (mPrefix.doGenerateItem(GregTech_API.sGeneratedMaterials[i]) && doesShowInCreative(mPrefix, GregTech_API.sGeneratedMaterials[i], GregTech_API.sDoShowAllItemsInCreative)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ super.getSubItems(var1, aCreativeTab, aList);
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ if (aMetaData < 0) return null;
+ if (aMetaData < GregTech_API.sGeneratedMaterials.length) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData];
+ if (tMaterial == null) return null;
+ IIconContainer tIcon = getIconContainer(aMetaData, tMaterial);
+ if (tIcon != null) return tIcon.getIcon();
+ return null;
+ }
+ return aMetaData >= mOffset && aMetaData - mOffset < mIconList.length ? mIconList[aMetaData - mOffset][0] : null;
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ return getDamage(aStack) < mOffset ? Math.min(super.getItemStackLimit(aStack), mPrefix.mDefaultStackSize) : super.getItemStackLimit(aStack);
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java
index 5d244e7ce0..b4ecdca49b 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Item_X32.java
@@ -1,198 +1,198 @@
-package gregtech.api.items;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.M;
-
-/**
- * @author Gregorius Techneticies
- * <p/>
- * One Item for everything!
- * <p/>
- * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar.
- * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material.
- * <p/>
- * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData.
- * <p/>
- * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item.
- */
-public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
-
- protected final OrePrefixes[] mGeneratedPrefixList;
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
- */
- public GT_MetaGenerated_Item_X32(String aUnlocalized, OrePrefixes... aGeneratedPrefixList) {
- super(aUnlocalized, (short) 32000, (short) 766);
- mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
-
- for (int i = 0; i < 32000; i++) {
- OrePrefixes tPrefix = mGeneratedPrefixList[i / 1000];
- if (tPrefix == null) continue;
- Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
- if (tMaterial == null) continue;
- if (doesMaterialAllowGeneration(tPrefix, tMaterial)) {
- ItemStack tStack = new ItemStack(this, 1, i);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) : getDefaultLocalization(tPrefix, tMaterial, i));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M));
- if (tPrefix.mIsUnificatable) {
- GT_OreDictUnificator.set(tPrefix, tMaterial, tStack);
- } else {
- GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack);
- }
- if ((tPrefix == OrePrefixes.stick || tPrefix == OrePrefixes.wireFine || tPrefix == OrePrefixes.ingot) && (tMaterial == Materials.Lead || tMaterial == Materials.Tin || tMaterial == Materials.SolderingAlloy)) {
- GregTech_API.sSolderingMetalList.add(tStack);
- }
- }
- }
- }
-
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
-
- /**
- * @return the Color Modulation the Material is going to be rendered with.
- */
- @Override
- public short[] getRGBa(ItemStack aStack) {
- Materials tMaterial = GregTech_API.sGeneratedMaterials[getDamage(aStack) % 1000];
- return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
- }
-
- /**
- * @param aPrefix this can be null, you have to return false in that case
- * @param aMaterial this can be null, you have to return false in that case
- * @return if this Item should be generated and visible.
- */
- public boolean doesMaterialAllowGeneration(OrePrefixes aPrefix, Materials aMaterial) {
- // You have to check for at least these Conditions in every Case! So add a super Call like the following for this before executing your Code:
- // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
- return aPrefix != null && aMaterial != null && aPrefix.doGenerateItem(aMaterial);
- }
-
- /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
-
- /**
- * @param aPrefix the OreDict Prefix
- * @param aMaterial the Material
- * @param aMetaData a Index from [0 - 31999]
- * @return the Localized Name when default LangFiles are used.
- */
- public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
- return aPrefix.getDefaultLocalNameForItem(aMaterial);
- }
-
- /**
- * @param aPrefix the OreDict Prefix
- * @param aMaterial the Material
- * @param aMetaData a Index from [0 - 31999]
- * @return the Localized Name Format when default LangFiles are used.
- */
- public String getDefaultLocalizationFormat(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
- return aPrefix.getDefaultLocalNameFormatForItem(aMaterial);
- }
-
- /**
- * @param aMetaData a Index from [0 - 31999]
- * @param aMaterial the Material
- * @return an Icon Container for the Item Display.
- */
- public final IIconContainer getIconContainer(int aMetaData, Materials aMaterial) {
- return mGeneratedPrefixList[aMetaData / 1000] != null && mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0 ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] : null;
- }
-
- /**
- * @param aPrefix always != null
- * @param aMaterial always != null
- * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well.
- * @return if this Item should be visible in NEI or Creative
- */
- public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
- return true;
- }
-
- /* ---------- INTERNAL OVERRIDES ---------- */
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- int aDamage = aStack.getItemDamage();
- if (aDamage < 32000 && aDamage >= 0)
- return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
- return aName;
- }
-
- @Override
- public ItemStack getContainerItem(ItemStack aStack) {
- int aDamage = aStack.getItemDamage();
- if (aDamage < 32000 && aDamage >= 0) {
- Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
- if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
- OrePrefixes aPrefix = mGeneratedPrefixList[aDamage / 1000];
- if (aPrefix != null) return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
- }
- }
- return null;
- }
-
- @Override
- public final IIconContainer getIconContainer(int aMetaData) {
- return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
- for (int i = 0; i < 32000; i++) {
- OrePrefixes aPrefix = mGeneratedPrefixList[i / 1000];
- Materials aMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
- if (aPrefix != null && aMaterial != null) {
- if (doesMaterialAllowGeneration(aPrefix, aMaterial) && doesShowInCreative(aPrefix, aMaterial, GregTech_API.sDoShowAllItemsInCreative)) {
- ItemStack tStack = new ItemStack(this, 1, i);
- isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- }
- super.getSubItems(var1, aCreativeTab, aList);
- }
-
- @Override
- public final IIcon getIconFromDamage(int aMetaData) {
- if (aMetaData < 0) return null;
- if (aMetaData < 32000) {
- Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
- if (tMaterial == null) return null;
- IIconContainer tIcon = getIconContainer(aMetaData, tMaterial);
- if (tIcon != null) return tIcon.getIcon();
- return null;
- }
- return aMetaData - 32000 < mIconList.length ? mIconList[aMetaData - 32000][0] : null;
- }
-
- @Override
- public int getItemStackLimit(ItemStack aStack) {
- int tDamage = getDamage(aStack);
- if (tDamage < 32000 && mGeneratedPrefixList[tDamage / 1000] != null)
- return Math.min(super.getItemStackLimit(aStack), mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
- return super.getItemStackLimit(aStack);
- }
+package gregtech.api.items;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static gregtech.api.enums.GT_Values.M;
+
+/**
+ * @author Gregorius Techneticies
+ * <p/>
+ * One Item for everything!
+ * <p/>
+ * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar.
+ * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material.
+ * <p/>
+ * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData.
+ * <p/>
+ * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item.
+ */
+public abstract class GT_MetaGenerated_Item_X32 extends GT_MetaGenerated_Item {
+
+ protected final OrePrefixes[] mGeneratedPrefixList;
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
+ */
+ public GT_MetaGenerated_Item_X32(String aUnlocalized, OrePrefixes... aGeneratedPrefixList) {
+ super(aUnlocalized, (short) 32000, (short) 766);
+ mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
+
+ for (int i = 0; i < 32000; i++) {
+ OrePrefixes tPrefix = mGeneratedPrefixList[i / 1000];
+ if (tPrefix == null) continue;
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
+ if (tMaterial == null) continue;
+ if (doesMaterialAllowGeneration(tPrefix, tMaterial)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", GT_LanguageManager.i18nPlaceholder ? getDefaultLocalizationFormat(tPrefix, tMaterial, i) : getDefaultLocalization(tPrefix, tMaterial, i));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / M));
+ if (tPrefix.mIsUnificatable) {
+ GT_OreDictUnificator.set(tPrefix, tMaterial, tStack);
+ } else {
+ GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack);
+ }
+ if ((tPrefix == OrePrefixes.stick || tPrefix == OrePrefixes.wireFine || tPrefix == OrePrefixes.ingot) && (tMaterial == Materials.Lead || tMaterial == Materials.Tin || tMaterial == Materials.SolderingAlloy)) {
+ GregTech_API.sSolderingMetalList.add(tStack);
+ }
+ }
+ }
+ }
+
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+
+ /**
+ * @return the Color Modulation the Material is going to be rendered with.
+ */
+ @Override
+ public short[] getRGBa(ItemStack aStack) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[getDamage(aStack) % 1000];
+ return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
+ }
+
+ /**
+ * @param aPrefix this can be null, you have to return false in that case
+ * @param aMaterial this can be null, you have to return false in that case
+ * @return if this Item should be generated and visible.
+ */
+ public boolean doesMaterialAllowGeneration(OrePrefixes aPrefix, Materials aMaterial) {
+ // You have to check for at least these Conditions in every Case! So add a super Call like the following for this before executing your Code:
+ // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
+ return aPrefix != null && aMaterial != null && aPrefix.doGenerateItem(aMaterial);
+ }
+
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+
+ /**
+ * @param aPrefix the OreDict Prefix
+ * @param aMaterial the Material
+ * @param aMetaData a Index from [0 - 31999]
+ * @return the Localized Name when default LangFiles are used.
+ */
+ public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
+ return aPrefix.getDefaultLocalNameForItem(aMaterial);
+ }
+
+ /**
+ * @param aPrefix the OreDict Prefix
+ * @param aMaterial the Material
+ * @param aMetaData a Index from [0 - 31999]
+ * @return the Localized Name Format when default LangFiles are used.
+ */
+ public String getDefaultLocalizationFormat(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
+ return aPrefix.getDefaultLocalNameFormatForItem(aMaterial);
+ }
+
+ /**
+ * @param aMetaData a Index from [0 - 31999]
+ * @param aMaterial the Material
+ * @return an Icon Container for the Item Display.
+ */
+ public final IIconContainer getIconContainer(int aMetaData, Materials aMaterial) {
+ return mGeneratedPrefixList[aMetaData / 1000] != null && mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0 ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] : null;
+ }
+
+ /**
+ * @param aPrefix always != null
+ * @param aMaterial always != null
+ * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well.
+ * @return if this Item should be visible in NEI or Creative
+ */
+ public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
+ return true;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public String getItemStackDisplayName(ItemStack aStack) {
+ String aName = super.getItemStackDisplayName(aStack);
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0)
+ return Materials.getLocalizedNameForItem(aName, aDamage % 1000);
+ return aName;
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0) {
+ Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
+ if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
+ OrePrefixes aPrefix = mGeneratedPrefixList[aDamage / 1000];
+ if (aPrefix != null) return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public final IIconContainer getIconContainer(int aMetaData) {
+ return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32000; i++) {
+ OrePrefixes aPrefix = mGeneratedPrefixList[i / 1000];
+ Materials aMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
+ if (aPrefix != null && aMaterial != null) {
+ if (doesMaterialAllowGeneration(aPrefix, aMaterial) && doesShowInCreative(aPrefix, aMaterial, GregTech_API.sDoShowAllItemsInCreative)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ }
+ super.getSubItems(var1, aCreativeTab, aList);
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ if (aMetaData < 0) return null;
+ if (aMetaData < 32000) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
+ if (tMaterial == null) return null;
+ IIconContainer tIcon = getIconContainer(aMetaData, tMaterial);
+ if (tIcon != null) return tIcon.getIcon();
+ return null;
+ }
+ return aMetaData - 32000 < mIconList.length ? mIconList[aMetaData - 32000][0] : null;
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ int tDamage = getDamage(aStack);
+ if (tDamage < 32000 && mGeneratedPrefixList[tDamage / 1000] != null)
+ return Math.min(super.getItemStackLimit(aStack), mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
+ return super.getItemStackLimit(aStack);
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
index db0db134ff..65e9dfcc39 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
@@ -1,724 +1,724 @@
-package gregtech.api.items;
-
-import buildcraft.api.tools.IToolWrench;
-import cpw.mods.fml.common.Mod;
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import crazypants.enderio.api.tool.ITool;
-import forestry.api.arboriculture.IToolGrafter;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enchants.Enchantment_Radioactivity;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.TC_Aspects.TC_AspectStack;
-import gregtech.api.interfaces.IDamagableItem;
-import gregtech.api.interfaces.IToolStats;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.tools.GT_Tool_Turbine;
-import mods.railcraft.api.core.items.IToolCrowbar;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.item.EntityMinecart;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumAction;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.potion.Potion;
-import net.minecraft.stats.AchievementList;
-import net.minecraft.stats.StatList;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.World;
-import net.minecraftforge.common.IShearable;
-import net.minecraftforge.event.entity.player.PlayerEvent;
-import net.minecraftforge.event.world.BlockEvent;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static gregtech.api.enums.GT_Values.MOD_ID_FR;
-import static gregtech.api.enums.GT_Values.MOD_ID_RC;
-
-/**
- * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench:
- * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, Materials.Bismuth, Materials.Bismuth, null);
- */
-@Optional.InterfaceList(value = {@Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = MOD_ID_FR), @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"), @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")})
-public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool {
- /**
- * All instances of this Item Class are listed here.
- * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true.
- * <p/>
- * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
- */
- public static final ConcurrentHashMap<String, GT_MetaGenerated_Tool> sInstances = new ConcurrentHashMap<String, GT_MetaGenerated_Tool>();
-
- /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
-
- public final ConcurrentHashMap<Short, IToolStats> mToolStats = new ConcurrentHashMap<Short, IToolStats>();
-
- /**
- * Creates the Item using these Parameters.
- *
- * @param aUnlocalized The Unlocalized Name of this Item.
- */
- public GT_MetaGenerated_Tool(String aUnlocalized) {
- super(aUnlocalized);
- GT_ModHandler.registerBoxableItemToToolBox(this);
- setCreativeTab(GregTech_API.TAB_GREGTECH);
- setMaxStackSize(1);
- sInstances.put(getUnlocalizedName(), this);
- }
-
- /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
-
- public static final Materials getPrimaryMaterial(ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial"));
- }
- return Materials._NULL;
- }
-
- public static final Materials getSecondaryMaterial(ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial"));
- }
- return Materials._NULL;
- }
-
- /* ---------- INTERNAL OVERRIDES ---------- */
-
- public static final long getToolMaxDamage(ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) return aNBT.getLong("MaxDamage");
- }
- return 0;
- }
-
- public static final long getToolDamage(ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) return aNBT.getLong("Damage");
- }
- return 0;
- }
-
- public static final boolean setToolDamage(ItemStack aStack, long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null) {
- aNBT.setLong("Damage", aDamage);
- return true;
- }
- }
- return false;
- }
-
- /**
- * This adds a Custom Item to the ending Range.
- *
- * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items)
- * @param aEnglish The Default Localized Name of the created Item
- * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
- * @param aToolStats The Food Value of this Item. Can be null as well.
- * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects.
- * @return An ItemStack containing the newly created Item, but without specific Stats.
- */
- public final ItemStack addTool(int aID, String aEnglish, String aToolTip, IToolStats aToolStats, Object... aOreDictNamesAndAspects) {
- if (aToolTip == null) aToolTip = "";
- if (aID >= 0 && aID < 32766 && aID % 2 == 0) {
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
- mToolStats.put((short) aID, aToolStats);
- mToolStats.put((short) (aID + 1), aToolStats);
- aToolStats.onStatsAddedToTool(this, aID);
- ItemStack rStack = new ItemStack(this, 1, aID);
- List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
- for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) {
- if (tOreDictNameOrAspect instanceof TC_AspectStack)
- ((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects);
- else
- GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
- }
- if (GregTech_API.sThaumcraftCompat != null)
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
- return rStack;
- }
- return null;
- }
-
- /**
- * This Function gets an ItemStack Version of this Tool
- *
- * @param aToolID the ID of the Tool Class
- * @param aAmount Amount of Items (well normally you only need 1)
- * @param aPrimaryMaterial Primary Material of this Tool
- * @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool
- * @param aElectricArray The Electric Stats of this Tool (or null if not electric)
- */
- public final ItemStack getToolWithStats(int aToolID, int aAmount, Materials aPrimaryMaterial, Materials aSecondaryMaterial, long[] aElectricArray) {
- ItemStack rStack = new ItemStack(this, aAmount, aToolID);
- IToolStats tToolStats = getToolStats(rStack);
- if (tToolStats != null) {
- NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound();
- if (aPrimaryMaterial != null) {
- tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.mName);
- tToolNBT.setLong("MaxDamage", 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
- }
- if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.mName);
-
- if (aElectricArray != null) {
- tToolNBT.setBoolean("Electric", true);
- tToolNBT.setLong("MaxCharge", aElectricArray[0]);
- tToolNBT.setLong("Voltage", aElectricArray[1]);
- tToolNBT.setLong("Tier", aElectricArray[2]);
- tToolNBT.setLong("SpecialData", aElectricArray[3]);
- }
-
- tMainNBT.setTag("GT.ToolStats", tToolNBT);
- rStack.setTagCompound(tMainNBT);
- }
- isItemStackUsable(rStack);
- return rStack;
- }
-
- /**
- * Called by the Block Harvesting Event within the GT_Proxy
- */
- @Mod.EventHandler
- public void onHarvestBlockEvent(ArrayList<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
- IToolStats tStats = getToolStats(aStack);
- if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)
- doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
- }
-
- @Mod.EventHandler
- public float onBlockBreakSpeedEvent(float aDefault, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, PlayerEvent.BreakSpeed aEvent)
- {
- IToolStats tStats = getToolStats(aStack);
- return tStats == null ? aDefault : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ);
- }
-
- @Override
- public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer)
- {
- if(aPlayer.worldObj.isRemote){
- return false;
- }
- IToolStats tStats = getToolStats(aStack);
- Block aBlock = aPlayer.worldObj.getBlock(aX, aY, aZ);
- if (tStats.isChainsaw()&&(aBlock instanceof IShearable))
- {
- IShearable target = (IShearable)aBlock;
- if ((target.isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)))
- {
- ArrayList<ItemStack> drops = target.onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, aStack));
- for (ItemStack stack : drops)
- {
- float f = 0.7F;
- double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
- double d1 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
- double d2 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
- EntityItem entityitem = new EntityItem(aPlayer.worldObj, aX + d, aY + d1, aZ + d2, stack);
- entityitem.delayBeforeCanPickup = 10;
- aPlayer.worldObj.spawnEntityInWorld(entityitem);
- }
- aPlayer.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(aBlock)], 1);
- onBlockDestroyed(aStack, aPlayer.worldObj, aBlock, aX, aY, aZ, aPlayer);
- }
- return false;
- }
- return super.onBlockStartBreak(aStack, aX, aY, aZ, aPlayer);
- }
-
- @Override
- public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats == null || !isItemStackUsable(aStack)) return true;
- GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F);
- if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) return true;
- if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) {
- float tMagicDamage = tStats.getMagicDamageAgainstEntity(aEntity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F, aEntity, aStack, aPlayer), tDamage = tStats.getNormalDamageAgainstEntity((float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + getToolCombatDamage(aStack), aEntity, aStack, aPlayer);
- if (tDamage + tMagicDamage > 0.0F) {
- boolean tCriticalHit = aPlayer.fallDistance > 0.0F && !aPlayer.onGround && !aPlayer.isOnLadder() && !aPlayer.isInWater() && !aPlayer.isPotionActive(Potion.blindness) && aPlayer.ridingEntity == null && aEntity instanceof EntityLivingBase;
- if (tCriticalHit && tDamage > 0.0F) tDamage *= 1.5F;
- tDamage += tMagicDamage;
- if (aEntity.attackEntityFrom(tStats.getDamageSource(aPlayer, aEntity), tDamage)) {
- if (aEntity instanceof EntityLivingBase)
- aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4);
- int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) : 0);
- if (tKnockcack > 0) {
- aEntity.addVelocity(-MathHelper.sin(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F, 0.1D, MathHelper.cos(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F);
- aPlayer.motionX *= 0.6D;
- aPlayer.motionZ *= 0.6D;
- aPlayer.setSprinting(false);
- }
- if (tCriticalHit) aPlayer.onCriticalHit(aEntity);
- if (tMagicDamage > 0.0F) aPlayer.onEnchantmentCritical(aEntity);
- if (tDamage >= 18.0F) aPlayer.triggerAchievement(AchievementList.overkill);
- aPlayer.setLastAttacker(aEntity);
- if (aEntity instanceof EntityLivingBase)
- EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
- EnchantmentHelper.func_151385_b(aPlayer, aEntity);
- if (aEntity instanceof EntityLivingBase)
- aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F));
- aEntity.hurtResistantTime = Math.max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity));
- aPlayer.addExhaustion(0.3F);
- doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
- }
- }
- if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
- return true;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000);
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
- @Override
- public final int getMaxItemUseDuration(ItemStack aStack) {
- return 72000;
- }
-
- @Override
- public final EnumAction getItemUseAction(ItemStack aStack) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats != null && tStats.canBlock()) return EnumAction.block;
- return EnumAction.none;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
- for (int i = 0; i < 32766; i += 2) {
- if (getToolStats(new ItemStack(this, 1, i)) != null) {
- ItemStack tStack = new ItemStack(this, 1, i);
- isItemStackUsable(tStack);
- aList.add(tStack);
- aList.add(getToolWithStats(i,1,Materials.Neutronium,Materials.Neutronium,null));
- }
-
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(IIconRegister aIconRegister) {
- //
- }
-
- @Override
- public final IIcon getIconFromDamage(int aMetaData) {
- return null;
- }
-
- @Override
- public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- long tMaxDamage = getToolMaxDamage(aStack);
- Materials tMaterial = getPrimaryMaterial(aStack);
- IToolStats tStats = getToolStats(aStack);
- int tOffset = getElectricStats(aStack) != null ? 2 : 1;
- if (tStats != null) {
- if (tStats instanceof GT_Tool_Turbine) {
- int aOptFlow=GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50));
- aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(trans("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 1, EnumChatFormatting.WHITE + String.format(trans("002", "%s lvl %s"), tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + String.format(trans("005", "Turbine Efficiency: %s"), "" + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack)))) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(trans("006", "Optimal Steam flow: %sL/sec"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY));
- {
- int aBaseEff=(int)(5+getToolCombatDamage(aStack))*1000;
- int aOptFlowLoose=aOptFlow*4;
- if(aBaseEff>10000){
- aOptFlowLoose*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
- aBaseEff=7500;
- }else if(aBaseEff>7500){
- aOptFlowLoose*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
- aBaseEff*=0.75f;
- }else{
- aBaseEff*=0.75f;
- }
- aList.add(tOffset + 4, EnumChatFormatting.GRAY + String.format(trans("500", "Turbine Efficiency (Loose): %s"), "" + EnumChatFormatting.BLUE + aBaseEff/100f) + EnumChatFormatting.DARK_GRAY);
- aList.add(tOffset + 5, EnumChatFormatting.GRAY + String.format(trans("501", "Optimal Steam flow (Loose): %s L/t"), "" + EnumChatFormatting.GOLD + aOptFlowLoose + EnumChatFormatting.DARK_GRAY));
- }
- aList.add(tOffset + 6, EnumChatFormatting.WHITE + String.format(trans("007", "Optimal Gas flow(EU burnvalue per tick): %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) + EnumChatFormatting.GRAY));
- aList.add(tOffset + 7, EnumChatFormatting.WHITE + String.format(trans("008", "Optimal Plasma flow(Plasma energyvalue per tick): %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 2000) + EnumChatFormatting.GRAY));
-
- } else {
- aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(trans("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 1, EnumChatFormatting.WHITE + String.format(trans("002", "%s lvl %s"), tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 2, EnumChatFormatting.WHITE + String.format(trans("003", "Attack Damage: %s"), "" + EnumChatFormatting.BLUE + getToolCombatDamage(aStack)) + EnumChatFormatting.GRAY);
- aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(trans("004", "Mining Speed: %s"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed)) + EnumChatFormatting.GRAY);
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null && aNBT.hasKey("Heat")){
- int tHeat = aNBT.getInteger("Heat");
- long tWorldTime = aPlayer.getEntityWorld().getWorldTime();
- if(aNBT.hasKey("HeatTime")){
- long tHeatTime = aNBT.getLong("HeatTime");
- if(tWorldTime>(tHeatTime+10)){
- tHeat = (int) (tHeat - ((tWorldTime-tHeatTime)/10));
- if(tHeat<300&&tHeat>-10000)tHeat=300;
- }
- aNBT.setLong("HeatTime", tWorldTime);
- if(tHeat>-10000)aNBT.setInteger("Heat", tHeat);
- }
-
- aList.add(tOffset + 3, EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat")+" K" + EnumChatFormatting.GRAY);
- }
- }
- }
- }
- }
-
- @Override
- public Long[] getFluidContainerStats(ItemStack aStack) {
- return null;
- }
-
- @Override
- public Long[] getElectricStats(ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GT.ToolStats");
- if (aNBT != null && aNBT.getBoolean("Electric"))
- return new Long[]{aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), aNBT.getLong("SpecialData")};
- }
- return null;
- }
-
- public float getToolCombatDamage(ItemStack aStack) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats == null) return 0;
- return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
- }
-
- @Override
- public final boolean doDamageToItem(ItemStack aStack, int aVanillaDamage) {
- return doDamage(aStack, aVanillaDamage * 100);
- }
-
- public final boolean doDamage(ItemStack aStack, long aAmount) {
- if (!isItemStackUsable(aStack)) return false;
- Long[] tElectric = getElectricStats(aStack);
- if (tElectric == null) {
- long tNewDamage = getToolDamage(aStack) + aAmount;
- setToolDamage(aStack, tNewDamage);
- if (tNewDamage >= getToolMaxDamage(aStack)) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
- if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);
- if (aStack.stackSize > 0) aStack.stackSize--;
-
- }
- }
- return true;
- }
- if (use(aStack, (int) aAmount, null)) {
- if (java.util.concurrent.ThreadLocalRandom.current().nextInt(0, 25) == 0) {
- long tNewDamage = getToolDamage(aStack) + aAmount;
- setToolDamage(aStack, tNewDamage);
- if (tNewDamage >= getToolMaxDamage(aStack)) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
- if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);
- if (aStack.stackSize > 0) aStack.stackSize--;
- }
- }
- }
- return true;
- }
- return false;
- }
-
- @Override
- public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) {
-
- if (!isItemStackUsable(aStack))
- return 0.0F;
-
- IToolStats tStats = getToolStats(aStack);
-
- if (tStats == null || Math.max(0, getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData))
- return 0.0F;
-
- if (aBlock.getHarvestLevel(aMetaData) == 0 && !tStats.isMinableBlock(aBlock, (byte) aMetaData))
- return Math.min(Math.max(Float.MIN_NORMAL, ((tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) /2)),1.0F);
-
- return tStats.isMinableBlock(aBlock, (byte) aMetaData) ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) : 0.0F;
- }
-
- @Override
- public final boolean canHarvestBlock(Block aBlock, ItemStack aStack) {
- return getDigSpeed(aStack, aBlock, (byte) 0) > 0.0F;
- }
-
- @Override
- public final int getHarvestLevel(ItemStack aStack, String aToolClass) {
- IToolStats tStats = getToolStats(aStack);
- return tStats == null ? -1 : tStats.getBaseQuality() + getPrimaryMaterial(aStack).mToolQuality;
- }
-
- @Override
- public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, EntityLivingBase aPlayer) {
- if (!isItemStackUsable(aStack)) return false;
- IToolStats tStats = getToolStats(aStack);
- if (tStats == null) return false;
- GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
- doDamage(aStack, (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
- return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
- }
-
- @Override
- public final ItemStack getContainerItem(ItemStack aStack) {
- return getContainerItem(aStack, true);
- }
-
- @Override
- public final boolean hasContainerItem(ItemStack aStack) {
- return getContainerItem(aStack, false) != null;
- }
-
- private ItemStack getContainerItem(ItemStack aStack, boolean playSound) {
- if (!isItemStackUsable(aStack)) return null;
- aStack = GT_Utility.copyAmount(1, aStack);
- IToolStats tStats = getToolStats(aStack);
- if (tStats == null) return null;
- doDamage(aStack, tStats.getToolDamagePerContainerCraft());
- aStack = aStack.stackSize > 0 ? aStack : null;
- if (playSound && GT_Mod.gregtechproxy.mTicksUntilNextCraftSound <= 0) {
- GT_Mod.gregtechproxy.mTicksUntilNextCraftSound = 10;
- String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
- GT_Utility.doSoundAtClient(sound, 1, 1.0F);
- }
- return aStack;
- }
-
- public IToolStats getToolStats(ItemStack aStack) {
- isItemStackUsable(aStack);
- return getToolStatsInternal(aStack);
- }
-
- private IToolStats getToolStatsInternal(ItemStack aStack) {
- return aStack == null ? null : mToolStats.get((short) aStack.getItemDamage());
- }
-
- @Override
- public float getSaplingModifier(ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) {
- IToolStats tStats = getToolStats(aStack);
- return tStats != null && tStats.isGrafter() ? Math.min(100.0F, (1 + getHarvestLevel(aStack, "")) * 20.0F) : 0.0F;
- }
-
- @Override
- public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
- if (!isItemStackUsable(aStack)) return false;
- IToolStats tStats = getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
- }
-
- @Override
- public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
-
- @Override
- public boolean canWrench(EntityPlayer player, int x, int y, int z) {
- if(player==null)return false;
- if(player.getCurrentEquippedItem()==null)return false;
- if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
- IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
- return tStats != null && tStats.isWrench();
- }
-
- @Override
- public void wrenchUsed(EntityPlayer player, int x, int y, int z) {
- if(player==null)return;
- if(player.getCurrentEquippedItem()==null)return;
- IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
- if (tStats != null) doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
- }
-
- @Override
- public boolean canUse(ItemStack stack, EntityPlayer player, int x, int y, int z){
- return canWrench(player, x, y, z);
- }
-
- @Override
- public void used(ItemStack stack, EntityPlayer player, int x, int y, int z){
- wrenchUsed(player, x, y, z);
- }
-
- @Override
- public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
- if(player==null)return false;
- if(player.getCurrentEquippedItem()==null)return false;
- if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
- IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
- return tStats.isWrench();
- }
-
-
- @Override
- public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
- if (!isItemStackUsable(aStack)) return false;
- IToolStats tStats = getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
- }
-
- @Override
- public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
-
- @Override
- public boolean canBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
- if (!isItemStackUsable(aStack)) return false;
- IToolStats tStats = getToolStats(aStack);
- return tStats != null && tStats.isCrowbar();
- }
-
- @Override
- public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- IToolStats tStats = getToolStats(aStack);
- if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer);
- super.onCreated(aStack, aWorld, aPlayer);
- }
-
- @Override
- public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack) {
- return false;
- }
-
- @Override
- public final int getItemStackLimit(ItemStack aStack) {
- return 1;
- }
-
- @Override
- public boolean isFull3D() {
- return true;
- }
-
- @Override
- public boolean isItemStackUsable(ItemStack aStack) {
- IToolStats tStats = getToolStatsInternal(aStack);
- if (aStack.getItemDamage() % 2 != 0 || tStats == null) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) aNBT.removeTag("ench");
- return false;
- }
- Materials aMaterial = getPrimaryMaterial(aStack);
- ConcurrentHashMap<Integer, Integer> tMap = new ConcurrentHashMap<Integer, Integer>(), tResult = new ConcurrentHashMap<Integer, Integer>();
- if (aMaterial.mEnchantmentTools != null) {
- tMap.put(aMaterial.mEnchantmentTools.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- if (aMaterial.mEnchantmentTools == Enchantment.fortune)
- tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- if (aMaterial.mEnchantmentTools == Enchantment.knockback)
- tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- if (aMaterial.mEnchantmentTools == Enchantment.fireAspect)
- tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel);
- }
- Enchantment[] tEnchants = tStats.getEnchantments(aStack);
- int[] tLevels = tStats.getEnchantmentLevels(aStack);
- for (int i = 0; i < tEnchants.length; i++)
- if (tLevels[i] > 0) {
- Integer tLevel = tMap.get(tEnchants[i].effectId);
- tMap.put(tEnchants[i].effectId, tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i]));
- }
- for (Entry<Integer, Integer> tEntry : tMap.entrySet()) {
- if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)
- tResult.put(tEntry.getKey(), tEntry.getValue());
- else
- switch (Enchantment.enchantmentsList[tEntry.getKey()].type) {
- case weapon:
- if (tStats.isWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
- break;
- case all:
- tResult.put(tEntry.getKey(), tEntry.getValue());
- break;
- case armor:
- case armor_feet:
- case armor_head:
- case armor_legs:
- case armor_torso:
- break;
- case bow:
- if (tStats.isRangedWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
- break;
- case breakable:
- break;
- case fishing_rod:
- break;
- case digger:
- if (tStats.isMiningTool()) tResult.put(tEntry.getKey(), tEntry.getValue());
- break;
- }
- }
- EnchantmentHelper.setEnchantments(tResult, aStack);
- return true;
- }
-
- @Override
- public short getChargedMetaData(ItemStack aStack) {
- return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
- }
-
- @Override
- public short getEmptyMetaData(ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) aNBT.removeTag("ench");
- return (short) (aStack.getItemDamage() + 1 - (aStack.getItemDamage() % 2));
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
- return false;
- }
-
- @Override
- public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
- return false;
- }
-}
+package gregtech.api.items;
+
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import crazypants.enderio.api.tool.ITool;
+import forestry.api.arboriculture.IToolGrafter;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enchants.Enchantment_Radioactivity;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.interfaces.IToolStats;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.tools.GT_Tool_Turbine;
+import mods.railcraft.api.core.items.IToolCrowbar;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.item.EntityMinecart;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.stats.AchievementList;
+import net.minecraft.stats.StatList;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraftforge.event.world.BlockEvent;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static gregtech.api.enums.GT_Values.MOD_ID_FR;
+import static gregtech.api.enums.GT_Values.MOD_ID_RC;
+
+/**
+ * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench:
+ * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, Materials.Bismuth, Materials.Bismuth, null);
+ */
+@Optional.InterfaceList(value = {@Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = MOD_ID_FR), @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"), @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")})
+public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements IDamagableItem, IToolGrafter, IToolCrowbar, IToolWrench, ITool {
+ /**
+ * All instances of this Item Class are listed here.
+ * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final ConcurrentHashMap<String, GT_MetaGenerated_Tool> sInstances = new ConcurrentHashMap<String, GT_MetaGenerated_Tool>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final ConcurrentHashMap<Short, IToolStats> mToolStats = new ConcurrentHashMap<Short, IToolStats>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public GT_MetaGenerated_Tool(String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ setCreativeTab(GregTech_API.TAB_GREGTECH);
+ setMaxStackSize(1);
+ sInstances.put(getUnlocalizedName(), this);
+ }
+
+ /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
+
+ public static final Materials getPrimaryMaterial(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial"));
+ }
+ return Materials._NULL;
+ }
+
+ public static final Materials getSecondaryMaterial(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial"));
+ }
+ return Materials._NULL;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ public static final long getToolMaxDamage(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return aNBT.getLong("MaxDamage");
+ }
+ return 0;
+ }
+
+ public static final long getToolDamage(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return aNBT.getLong("Damage");
+ }
+ return 0;
+ }
+
+ public static final boolean setToolDamage(ItemStack aStack, long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * This adds a Custom Item to the ending Range.
+ *
+ * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items)
+ * @param aEnglish The Default Localized Name of the created Item
+ * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
+ * @param aToolStats The Food Value of this Item. Can be null as well.
+ * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects.
+ * @return An ItemStack containing the newly created Item, but without specific Stats.
+ */
+ public final ItemStack addTool(int aID, String aEnglish, String aToolTip, IToolStats aToolStats, Object... aOreDictNamesAndAspects) {
+ if (aToolTip == null) aToolTip = "";
+ if (aID >= 0 && aID < 32766 && aID % 2 == 0) {
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
+ mToolStats.put((short) aID, aToolStats);
+ mToolStats.put((short) (aID + 1), aToolStats);
+ aToolStats.onStatsAddedToTool(this, aID);
+ ItemStack rStack = new ItemStack(this, 1, aID);
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) {
+ if (tOreDictNameOrAspect instanceof TC_AspectStack)
+ ((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects);
+ else
+ GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
+ }
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
+ return rStack;
+ }
+ return null;
+ }
+
+ /**
+ * This Function gets an ItemStack Version of this Tool
+ *
+ * @param aToolID the ID of the Tool Class
+ * @param aAmount Amount of Items (well normally you only need 1)
+ * @param aPrimaryMaterial Primary Material of this Tool
+ * @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool
+ * @param aElectricArray The Electric Stats of this Tool (or null if not electric)
+ */
+ public final ItemStack getToolWithStats(int aToolID, int aAmount, Materials aPrimaryMaterial, Materials aSecondaryMaterial, long[] aElectricArray) {
+ ItemStack rStack = new ItemStack(this, aAmount, aToolID);
+ IToolStats tToolStats = getToolStats(rStack);
+ if (tToolStats != null) {
+ NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound();
+ if (aPrimaryMaterial != null) {
+ tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.mName);
+ tToolNBT.setLong("MaxDamage", 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
+ }
+ if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.mName);
+
+ if (aElectricArray != null) {
+ tToolNBT.setBoolean("Electric", true);
+ tToolNBT.setLong("MaxCharge", aElectricArray[0]);
+ tToolNBT.setLong("Voltage", aElectricArray[1]);
+ tToolNBT.setLong("Tier", aElectricArray[2]);
+ tToolNBT.setLong("SpecialData", aElectricArray[3]);
+ }
+
+ tMainNBT.setTag("GT.ToolStats", tToolNBT);
+ rStack.setTagCompound(tMainNBT);
+ }
+ isItemStackUsable(rStack);
+ return rStack;
+ }
+
+ /**
+ * Called by the Block Harvesting Event within the GT_Proxy
+ */
+ @Mod.EventHandler
+ public void onHarvestBlockEvent(ArrayList<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
+ IToolStats tStats = getToolStats(aStack);
+ if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)
+ doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
+ }
+
+ @Mod.EventHandler
+ public float onBlockBreakSpeedEvent(float aDefault, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, PlayerEvent.BreakSpeed aEvent)
+ {
+ IToolStats tStats = getToolStats(aStack);
+ return tStats == null ? aDefault : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ);
+ }
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer)
+ {
+ if(aPlayer.worldObj.isRemote){
+ return false;
+ }
+ IToolStats tStats = getToolStats(aStack);
+ Block aBlock = aPlayer.worldObj.getBlock(aX, aY, aZ);
+ if (tStats.isChainsaw()&&(aBlock instanceof IShearable))
+ {
+ IShearable target = (IShearable)aBlock;
+ if ((target.isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)))
+ {
+ ArrayList<ItemStack> drops = target.onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, aStack));
+ for (ItemStack stack : drops)
+ {
+ float f = 0.7F;
+ double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d1 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d2 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ EntityItem entityitem = new EntityItem(aPlayer.worldObj, aX + d, aY + d1, aZ + d2, stack);
+ entityitem.delayBeforeCanPickup = 10;
+ aPlayer.worldObj.spawnEntityInWorld(entityitem);
+ }
+ aPlayer.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(aBlock)], 1);
+ onBlockDestroyed(aStack, aPlayer.worldObj, aBlock, aX, aY, aZ, aPlayer);
+ }
+ return false;
+ }
+ return super.onBlockStartBreak(aStack, aX, aY, aZ, aPlayer);
+ }
+
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null || !isItemStackUsable(aStack)) return true;
+ GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F);
+ if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) return true;
+ if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) {
+ float tMagicDamage = tStats.getMagicDamageAgainstEntity(aEntity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F, aEntity, aStack, aPlayer), tDamage = tStats.getNormalDamageAgainstEntity((float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + getToolCombatDamage(aStack), aEntity, aStack, aPlayer);
+ if (tDamage + tMagicDamage > 0.0F) {
+ boolean tCriticalHit = aPlayer.fallDistance > 0.0F && !aPlayer.onGround && !aPlayer.isOnLadder() && !aPlayer.isInWater() && !aPlayer.isPotionActive(Potion.blindness) && aPlayer.ridingEntity == null && aEntity instanceof EntityLivingBase;
+ if (tCriticalHit && tDamage > 0.0F) tDamage *= 1.5F;
+ tDamage += tMagicDamage;
+ if (aEntity.attackEntityFrom(tStats.getDamageSource(aPlayer, aEntity), tDamage)) {
+ if (aEntity instanceof EntityLivingBase)
+ aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4);
+ int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) : 0);
+ if (tKnockcack > 0) {
+ aEntity.addVelocity(-MathHelper.sin(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F, 0.1D, MathHelper.cos(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F);
+ aPlayer.motionX *= 0.6D;
+ aPlayer.motionZ *= 0.6D;
+ aPlayer.setSprinting(false);
+ }
+ if (tCriticalHit) aPlayer.onCriticalHit(aEntity);
+ if (tMagicDamage > 0.0F) aPlayer.onEnchantmentCritical(aEntity);
+ if (tDamage >= 18.0F) aPlayer.triggerAchievement(AchievementList.overkill);
+ aPlayer.setLastAttacker(aEntity);
+ if (aEntity instanceof EntityLivingBase)
+ EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
+ EnchantmentHelper.func_151385_b(aPlayer, aEntity);
+ if (aEntity instanceof EntityLivingBase)
+ aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F));
+ aEntity.hurtResistantTime = Math.max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity));
+ aPlayer.addExhaustion(0.3F);
+ doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+ }
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000);
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public final int getMaxItemUseDuration(ItemStack aStack) {
+ return 72000;
+ }
+
+ @Override
+ public final EnumAction getItemUseAction(ItemStack aStack) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) return EnumAction.block;
+ return EnumAction.none;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32766; i += 2) {
+ if (getToolStats(new ItemStack(this, 1, i)) != null) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ aList.add(getToolWithStats(i,1,Materials.Neutronium,Materials.Neutronium,null));
+ }
+
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(IIconRegister aIconRegister) {
+ //
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ return null;
+ }
+
+ @Override
+ public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ long tMaxDamage = getToolMaxDamage(aStack);
+ Materials tMaterial = getPrimaryMaterial(aStack);
+ IToolStats tStats = getToolStats(aStack);
+ int tOffset = getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ if (tStats instanceof GT_Tool_Turbine) {
+ int aOptFlow=GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed * 50));
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(trans("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + String.format(trans("002", "%s lvl %s"), tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + String.format(trans("005", "Turbine Efficiency: %s"), "" + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack)))) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(trans("006", "Optimal Steam flow: %sL/sec"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY));
+ {
+ int aBaseEff=(int)(5+getToolCombatDamage(aStack))*1000;
+ int aOptFlowLoose=aOptFlow*4;
+ if(aBaseEff>10000){
+ aOptFlowLoose*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
+ aBaseEff=7500;
+ }else if(aBaseEff>7500){
+ aOptFlowLoose*=Math.pow(1.1f,((aBaseEff-7500)/10000F)*20f);
+ aBaseEff*=0.75f;
+ }else{
+ aBaseEff*=0.75f;
+ }
+ aList.add(tOffset + 4, EnumChatFormatting.GRAY + String.format(trans("500", "Turbine Efficiency (Loose): %s"), "" + EnumChatFormatting.BLUE + aBaseEff/100f) + EnumChatFormatting.DARK_GRAY);
+ aList.add(tOffset + 5, EnumChatFormatting.GRAY + String.format(trans("501", "Optimal Steam flow (Loose): %s L/t"), "" + EnumChatFormatting.GOLD + aOptFlowLoose + EnumChatFormatting.DARK_GRAY));
+ }
+ aList.add(tOffset + 6, EnumChatFormatting.WHITE + String.format(trans("007", "Optimal Gas flow(EU burnvalue per tick): %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) + EnumChatFormatting.GRAY));
+ aList.add(tOffset + 7, EnumChatFormatting.WHITE + String.format(trans("008", "Optimal Plasma flow(Plasma energyvalue per tick): %sEU/t"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 2000) + EnumChatFormatting.GRAY));
+
+ } else {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + String.format(trans("001", "Durability: %s/%s"), "" + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " ", " " + tMaxDamage) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + String.format(trans("002", "%s lvl %s"), tMaterial.mLocalizedName + EnumChatFormatting.YELLOW, "" + getHarvestLevel(aStack, "")) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + String.format(trans("003", "Attack Damage: %s"), "" + EnumChatFormatting.BLUE + getToolCombatDamage(aStack)) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + String.format(trans("004", "Mining Speed: %s"), "" + EnumChatFormatting.GOLD + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed)) + EnumChatFormatting.GRAY);
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null && aNBT.hasKey("Heat")){
+ int tHeat = aNBT.getInteger("Heat");
+ long tWorldTime = aPlayer.getEntityWorld().getWorldTime();
+ if(aNBT.hasKey("HeatTime")){
+ long tHeatTime = aNBT.getLong("HeatTime");
+ if(tWorldTime>(tHeatTime+10)){
+ tHeat = (int) (tHeat - ((tWorldTime-tHeatTime)/10));
+ if(tHeat<300&&tHeat>-10000)tHeat=300;
+ }
+ aNBT.setLong("HeatTime", tWorldTime);
+ if(tHeat>-10000)aNBT.setInteger("Heat", tHeat);
+ }
+
+ aList.add(tOffset + 3, EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat")+" K" + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public Long[] getFluidContainerStats(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Long[] getElectricStats(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null && aNBT.getBoolean("Electric"))
+ return new Long[]{aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), aNBT.getLong("SpecialData")};
+ }
+ return null;
+ }
+
+ public float getToolCombatDamage(ItemStack aStack) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return 0;
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public final boolean doDamageToItem(ItemStack aStack, int aVanillaDamage) {
+ return doDamage(aStack, aVanillaDamage * 100);
+ }
+
+ public final boolean doDamage(ItemStack aStack, long aAmount) {
+ if (!isItemStackUsable(aStack)) return false;
+ Long[] tElectric = getElectricStats(aStack);
+ if (tElectric == null) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
+ if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);
+ if (aStack.stackSize > 0) aStack.stackSize--;
+
+ }
+ }
+ return true;
+ }
+ if (use(aStack, (int) aAmount, null)) {
+ if (java.util.concurrent.ThreadLocalRandom.current().nextInt(0, 25) == 0) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
+ if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);
+ if (aStack.stackSize > 0) aStack.stackSize--;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) {
+
+ if (!isItemStackUsable(aStack))
+ return 0.0F;
+
+ IToolStats tStats = getToolStats(aStack);
+
+ if (tStats == null || Math.max(0, getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData))
+ return 0.0F;
+
+ if (aBlock.getHarvestLevel(aMetaData) == 0 && !tStats.isMinableBlock(aBlock, (byte) aMetaData))
+ return Math.min(Math.max(Float.MIN_NORMAL, ((tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) /2)),1.0F);
+
+ return tStats.isMinableBlock(aBlock, (byte) aMetaData) ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) : 0.0F;
+ }
+
+ @Override
+ public final boolean canHarvestBlock(Block aBlock, ItemStack aStack) {
+ return getDigSpeed(aStack, aBlock, (byte) 0) > 0.0F;
+ }
+
+ @Override
+ public final int getHarvestLevel(ItemStack aStack, String aToolClass) {
+ IToolStats tStats = getToolStats(aStack);
+ return tStats == null ? -1 : tStats.getBaseQuality() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, EntityLivingBase aPlayer) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return false;
+ GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
+ doDamage(aStack, (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
+ return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
+ }
+
+ @Override
+ public final ItemStack getContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack, true);
+ }
+
+ @Override
+ public final boolean hasContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack, false) != null;
+ }
+
+ private ItemStack getContainerItem(ItemStack aStack, boolean playSound) {
+ if (!isItemStackUsable(aStack)) return null;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return null;
+ doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ aStack = aStack.stackSize > 0 ? aStack : null;
+ if (playSound && GT_Mod.gregtechproxy.mTicksUntilNextCraftSound <= 0) {
+ GT_Mod.gregtechproxy.mTicksUntilNextCraftSound = 10;
+ String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ }
+ return aStack;
+ }
+
+ public IToolStats getToolStats(ItemStack aStack) {
+ isItemStackUsable(aStack);
+ return getToolStatsInternal(aStack);
+ }
+
+ private IToolStats getToolStatsInternal(ItemStack aStack) {
+ return aStack == null ? null : mToolStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public float getSaplingModifier(ItemStack aStack, World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ) {
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isGrafter() ? Math.min(100.0F, (1 + getHarvestLevel(aStack, "")) * 20.0F) : 0.0F;
+ }
+
+ @Override
+ public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canWrench(EntityPlayer player, int x, int y, int z) {
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats != null && tStats.isWrench();
+ }
+
+ @Override
+ public void wrenchUsed(EntityPlayer player, int x, int y, int z) {
+ if(player==null)return;
+ if(player.getCurrentEquippedItem()==null)return;
+ IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ if (tStats != null) doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canUse(ItemStack stack, EntityPlayer player, int x, int y, int z){
+ return canWrench(player, x, y, z);
+ }
+
+ @Override
+ public void used(ItemStack stack, EntityPlayer player, int x, int y, int z){
+ wrenchUsed(player, x, y, z);
+ }
+
+ @Override
+ public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ IToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats.isWrench();
+ }
+
+
+ @Override
+ public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ IToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IToolStats tStats = getToolStats(aStack);
+ if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer);
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public final int getItemStackLimit(ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public boolean isFull3D() {
+ return true;
+ }
+
+ @Override
+ public boolean isItemStackUsable(ItemStack aStack) {
+ IToolStats tStats = getToolStatsInternal(aStack);
+ if (aStack.getItemDamage() % 2 != 0 || tStats == null) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return false;
+ }
+ Materials aMaterial = getPrimaryMaterial(aStack);
+ ConcurrentHashMap<Integer, Integer> tMap = new ConcurrentHashMap<Integer, Integer>(), tResult = new ConcurrentHashMap<Integer, Integer>();
+ if (aMaterial.mEnchantmentTools != null) {
+ tMap.put(aMaterial.mEnchantmentTools.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.fortune)
+ tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.knockback)
+ tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.fireAspect)
+ tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ }
+ Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++)
+ if (tLevels[i] > 0) {
+ Integer tLevel = tMap.get(tEnchants[i].effectId);
+ tMap.put(tEnchants[i].effectId, tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i]));
+ }
+ for (Entry<Integer, Integer> tEntry : tMap.entrySet()) {
+ if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)
+ tResult.put(tEntry.getKey(), tEntry.getValue());
+ else
+ switch (Enchantment.enchantmentsList[tEntry.getKey()].type) {
+ case weapon:
+ if (tStats.isWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case all:
+ tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case armor:
+ case armor_feet:
+ case armor_head:
+ case armor_legs:
+ case armor_torso:
+ break;
+ case bow:
+ if (tStats.isRangedWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case breakable:
+ break;
+ case fishing_rod:
+ break;
+ case digger:
+ if (tStats.isMiningTool()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ }
+ }
+ EnchantmentHelper.setEnchantments(tResult, aStack);
+ return true;
+ }
+
+ @Override
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ public short getEmptyMetaData(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return (short) (aStack.getItemDamage() + 1 - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+}
diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
index ec0ab2a925..78c0fb85a1 100644
--- a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
+++ b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
@@ -1,162 +1,162 @@
-package gregtech.api.items;
-
-import gregtech.common.items.GT_DepletetCell_Item;
-import ic2.api.item.IBoxable;
-import ic2.core.util.StackUtil;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-
-import java.util.List;
-
-public class GT_RadioactiveCell_Item
- extends GT_Generic_Item implements IBoxable{
- protected int cellCount;
- protected int maxDmg;
- protected int dura;
-
- public GT_RadioactiveCell_Item(String aUnlocalized, String aEnglish, int aCellcount) {
- super(aUnlocalized, aEnglish, null);
- this.setMaxStackSize(64);
- this.setMaxDamage(100);
- setNoRepair();
- this.cellCount = Math.max(1, aCellcount);
- }
-
- public static int getDurabilityOfStack(ItemStack aStack) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- aStack.setTagCompound(tNBT);
- }
- return tNBT.getInteger("advDmg");
- }
-
- protected static int sumUp(int a) {
- int b = 0;
- for (int c = 1; c <= a; c++) {
- b += c;
- }
- return b;
- }
-
- protected static int triangularNumber(int x)
- {
- return (x * x + x) / 2;
- }
-
- protected boolean outputPulseForStack(ItemStack aStack) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- aStack.setTagCompound(tNBT);
- }
- tNBT.setInteger("output", tNBT.getInteger("output") + 1);
- return false;//(this.pulserate > 0) || (tNBT.getInteger("output") % -this.pulserate == 0);
- }
-
- protected boolean incrementPulseForStack(ItemStack aStack) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- aStack.setTagCompound(tNBT);
- }
- tNBT.setInteger("pulse", tNBT.getInteger("pulse") + 1);
- return false;//(this.pulserate > 0) || (tNBT.getInteger("pulse") % -this.pulserate == 0);
- }
-
- protected void setDurabilityForStack(ItemStack aStack, int aDurability) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- aStack.setTagCompound(tNBT);
- }
- tNBT.setInteger("durability", aDurability);
-// if (this.maxDelay > 0)
-// {
-// double var4 = (this.maxDelay - aDurability) / this.maxDelay;
-// int var6 = (int)(aStack.getMaxDamage() * var4);
-// if (var6 >= aStack.getMaxDamage()) {
-// var6 = aStack.getMaxDamage() - 1;
-// }
-// aStack.setItemDamage(aStack.getMaxDamage() - var6);
-// }
- }
-
- public int getMaxNuclearDurability() {
- return 0;//return this.maxDelay;
- }
-
- public int func_77619_b() {
- return 0;
- }
-
- public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
- return false;
- }
-
- public boolean func_82789_a(ItemStack par1ItemStack, ItemStack par2ItemStack) {
- return false;
- }
-
- public void setDamageForStack(ItemStack stack, int advDmg) {
- NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
- nbtData.setInteger("advDmg", advDmg);
- if (this.maxDmg > 0) {
- double p = (double) advDmg / (double) this.maxDmg;
- int newDmg = (int) (stack.getMaxDamage() * p);
- if (newDmg >= stack.getMaxDamage()) {
- newDmg = stack.getMaxDamage() - 1;
- }
- stack.setItemDamage(newDmg);
- this.dura = newDmg;
- }
- }
-
- public int getDamageOfStack(ItemStack stack) {
- NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
- this.dura = nbtData.getInteger("advDmg");
- return this.dura;
- }
-
- public int getControlTagOfStack(ItemStack stack) {
- NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
- return nbtData.getInteger("tag");
- }
-
- public void setControlTagOfStack(ItemStack stack, int tag) {
- NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
- nbtData.setInteger("tag", tag);
- }
-
- public int getMaxDamageEx() {
- return this.maxDmg;
- }
-
- public void damageItemStack(ItemStack stack, int Dmg) {
- setDamageForStack(stack, getDamageOfStack(stack) + Dmg);
- }
-
- public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- super.addAdditionalToolTips(aList, aStack, aPlayer);
- //aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs");
- int rDmg = getDurabilityOfStack(aStack) * 6 / this.maxDmg;
- EnumChatFormatting color2;
- switch (rDmg) {
- case 0:
- case 1: color2 = EnumChatFormatting.WHITE; break;
- case 2:
- case 3:
- case 4: color2 = EnumChatFormatting.GRAY; break;
- default: color2 = EnumChatFormatting.DARK_GRAY; break;
- }
- EnumChatFormatting color1 = this instanceof GT_DepletetCell_Item ? color2 = EnumChatFormatting.DARK_GRAY : EnumChatFormatting.WHITE;
- aList.add(color1 + String.format(trans("001", "Durability: %s/%s"), "" + color2 + (this.maxDmg - getDurabilityOfStack(aStack)) + color1, "" + this.maxDmg));
- }
-
- @Override
- public boolean canBeStoredInToolbox(ItemStack itemstack) {
- return true;
- }
-}
+package gregtech.api.items;
+
+import gregtech.common.items.GT_DepletetCell_Item;
+import ic2.api.item.IBoxable;
+import ic2.core.util.StackUtil;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.util.List;
+
+public class GT_RadioactiveCell_Item
+ extends GT_Generic_Item implements IBoxable{
+ protected int cellCount;
+ protected int maxDmg;
+ protected int dura;
+
+ public GT_RadioactiveCell_Item(String aUnlocalized, String aEnglish, int aCellcount) {
+ super(aUnlocalized, aEnglish, null);
+ this.setMaxStackSize(64);
+ this.setMaxDamage(100);
+ setNoRepair();
+ this.cellCount = Math.max(1, aCellcount);
+ }
+
+ public static int getDurabilityOfStack(ItemStack aStack) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
+ }
+ return tNBT.getInteger("advDmg");
+ }
+
+ protected static int sumUp(int a) {
+ int b = 0;
+ for (int c = 1; c <= a; c++) {
+ b += c;
+ }
+ return b;
+ }
+
+ protected static int triangularNumber(int x)
+ {
+ return (x * x + x) / 2;
+ }
+
+ protected boolean outputPulseForStack(ItemStack aStack) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
+ }
+ tNBT.setInteger("output", tNBT.getInteger("output") + 1);
+ return false;//(this.pulserate > 0) || (tNBT.getInteger("output") % -this.pulserate == 0);
+ }
+
+ protected boolean incrementPulseForStack(ItemStack aStack) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
+ }
+ tNBT.setInteger("pulse", tNBT.getInteger("pulse") + 1);
+ return false;//(this.pulserate > 0) || (tNBT.getInteger("pulse") % -this.pulserate == 0);
+ }
+
+ protected void setDurabilityForStack(ItemStack aStack, int aDurability) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
+ }
+ tNBT.setInteger("durability", aDurability);
+// if (this.maxDelay > 0)
+// {
+// double var4 = (this.maxDelay - aDurability) / this.maxDelay;
+// int var6 = (int)(aStack.getMaxDamage() * var4);
+// if (var6 >= aStack.getMaxDamage()) {
+// var6 = aStack.getMaxDamage() - 1;
+// }
+// aStack.setItemDamage(aStack.getMaxDamage() - var6);
+// }
+ }
+
+ public int getMaxNuclearDurability() {
+ return 0;//return this.maxDelay;
+ }
+
+ public int func_77619_b() {
+ return 0;
+ }
+
+ public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
+ return false;
+ }
+
+ public boolean func_82789_a(ItemStack par1ItemStack, ItemStack par2ItemStack) {
+ return false;
+ }
+
+ public void setDamageForStack(ItemStack stack, int advDmg) {
+ NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
+ nbtData.setInteger("advDmg", advDmg);
+ if (this.maxDmg > 0) {
+ double p = (double) advDmg / (double) this.maxDmg;
+ int newDmg = (int) (stack.getMaxDamage() * p);
+ if (newDmg >= stack.getMaxDamage()) {
+ newDmg = stack.getMaxDamage() - 1;
+ }
+ stack.setItemDamage(newDmg);
+ this.dura = newDmg;
+ }
+ }
+
+ public int getDamageOfStack(ItemStack stack) {
+ NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
+ this.dura = nbtData.getInteger("advDmg");
+ return this.dura;
+ }
+
+ public int getControlTagOfStack(ItemStack stack) {
+ NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
+ return nbtData.getInteger("tag");
+ }
+
+ public void setControlTagOfStack(ItemStack stack, int tag) {
+ NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
+ nbtData.setInteger("tag", tag);
+ }
+
+ public int getMaxDamageEx() {
+ return this.maxDmg;
+ }
+
+ public void damageItemStack(ItemStack stack, int Dmg) {
+ setDamageForStack(stack, getDamageOfStack(stack) + Dmg);
+ }
+
+ public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ super.addAdditionalToolTips(aList, aStack, aPlayer);
+ //aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs");
+ int rDmg = getDurabilityOfStack(aStack) * 6 / this.maxDmg;
+ EnumChatFormatting color2;
+ switch (rDmg) {
+ case 0:
+ case 1: color2 = EnumChatFormatting.WHITE; break;
+ case 2:
+ case 3:
+ case 4: color2 = EnumChatFormatting.GRAY; break;
+ default: color2 = EnumChatFormatting.DARK_GRAY; break;
+ }
+ EnumChatFormatting color1 = this instanceof GT_DepletetCell_Item ? color2 = EnumChatFormatting.DARK_GRAY : EnumChatFormatting.WHITE;
+ aList.add(color1 + String.format(trans("001", "Durability: %s/%s"), "" + color2 + (this.maxDmg - getDurabilityOfStack(aStack)) + color1, "" + this.maxDmg));
+ }
+
+ @Override
+ public boolean canBeStoredInToolbox(ItemStack itemstack) {
+ return true;
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
index 257cc79adb..881d4a814e 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -1,1432 +1,1432 @@
-package gregtech.api.metatileentity;
-
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-import static gregtech.api.enums.GT_Values.NW;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.UUID;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
-import gregtech.api.net.GT_Packet_TileEntity;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.covers.GT_Cover_Fluidfilter;
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.network.Packet;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidHandler;
-
-/**
- * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
- * <p/>
- * This is the main TileEntity for EVERYTHING.
- */
-public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileEntity, IPipeRenderedTileEntity {
- private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[]{GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior};
- public byte mConnections = 0;
- protected MetaPipeEntity mMetaTileEntity;
- private byte[] mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
- private int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0}, mCoverData = new int[]{0, 0, 0, 0, 0, 0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING];
- private boolean mInventoryChanged = false, mWorkUpdate = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false;
- private boolean mCheckConnections = false;
- private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, mLagWarningCount = 0;
- private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0;
- private short mID = 0;
- private long mTickTimer = 0;
-
- public BaseMetaPipeEntity() {
- }
-
- @Override
- public void writeToNBT(NBTTagCompound aNBT) {
- try {
- super.writeToNBT(aNBT);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- try {
- aNBT.setInteger("mID", mID);
- aNBT.setIntArray("mCoverData", mCoverData);
- aNBT.setIntArray("mCoverSides", mCoverSides);
- aNBT.setByteArray("mRedstoneSided", mSidedRedstone);
- aNBT.setByte("mConnections", mConnections);
- aNBT.setByte("mColor", mColor);
- aNBT.setByte("mStrongRedstone", mStrongRedstone);
- aNBT.setBoolean("mWorks", !mWorks);
-
- for(int i=0;i < mCoverData.length; i++) {
- if (GregTech_API.getCoverBehavior(mCoverSides[i]) instanceof GT_Cover_Fluidfilter) {
- final int fluidId = mCoverData[i] >>> 3;
- final Fluid fluid = FluidRegistry.getFluid(fluidId);
- if(fluid != null) {
- final String fluidName = FluidRegistry.getFluidName(fluid);
- aNBT.setString(String.format("fluidFilter%d", i), fluidName);
- }
- }
- }
-
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- try {
- if (hasValidMetaTileEntity()) {
- NBTTagList tItemList = new NBTTagList();
- for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) {
- ItemStack tStack = mMetaTileEntity.getRealInventory()[i];
- if (tStack != null) {
- NBTTagCompound tTag = new NBTTagCompound();
- tTag.setInteger("IntSlot", i);
- tStack.writeToNBT(tTag);
- tItemList.appendTag(tTag);
- }
- }
- aNBT.setTag("Inventory", tItemList);
-
- try {
- mMetaTileEntity.saveNBTData(aNBT);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
- } catch (Throwable e) {
- GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- @Override
- public void readFromNBT(NBTTagCompound aNBT) {
- super.readFromNBT(aNBT);
- setInitialValuesAsNBT(aNBT, (short) 0);
- }
-
- @Override
- public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) {
- if (aNBT == null) {
- if (aID > 0) mID = aID;
- else mID = mID > 0 ? mID : 0;
- if (mID != 0) createNewMetatileEntity(mID);
- } else {
- if (aID <= 0) mID = (short) aNBT.getInteger("mID");
- else mID = aID;
- mCoverSides = aNBT.getIntArray("mCoverSides");
- mCoverData = aNBT.getIntArray("mCoverData");
- mSidedRedstone = aNBT.getByteArray("mRedstoneSided");
- mConnections = aNBT.getByte("mConnections");
- mColor = aNBT.getByte("mColor");
- mStrongRedstone = aNBT.getByte("mStrongRedstone");
- mWorks = !aNBT.getBoolean("mWorks");
-
- if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
- if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
- if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
-
- for (byte i = 0; i < 6; i++) {
- mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
- if(mCoverBehaviors[i] instanceof GT_Cover_Fluidfilter) {
- final String filterKey = String.format("fluidFilter%d", i);
- if (aNBT.hasKey(filterKey)) {
- mCoverData[i] = (mCoverData[i] & 7) | (FluidRegistry.getFluidID(aNBT.getString(filterKey)) << 3);
- }
- }
- }
-
-
- if (mID != 0 && createNewMetatileEntity(mID)) {
- NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
- for (int i = 0; i < tItemList.tagCount(); i++) {
- NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
- int tSlot = tTag.getInteger("IntSlot");
- if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) {
- mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
- }
- }
-
- try {
- mMetaTileEntity.loadNBTData(aNBT);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
- }
-
- if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
- if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
- if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
-
- for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
- }
-
- private boolean createNewMetatileEntity(short aID) {
- if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
- GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
- } else {
- if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
- GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
- mTickTimer = 0;
- mID = aID;
- return true;
- }
- return false;
- }
-
- @Override
- public void updateEntity() {
- super.updateEntity();
-
- if (!hasValidMetaTileEntity()) {
- if (mMetaTileEntity == null) return;
- mMetaTileEntity.setBaseMetaTileEntity(this);
- }
-
- long tTime = System.nanoTime();
- int tCode = 0;
-
- try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
- switch (tCode) {
- case 0:
- tCode++;
- if (mTickTimer++ == 0) {
- oX = xCoord;
- oY = yCoord;
- oZ = zCoord;
- if (isServerSide()) for (byte i = 0; i < 6; i++)
- if (getCoverIDAtSide(i) != 0)
- if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
- dropCover(i, i, true);
- worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
- mMetaTileEntity.onFirstTick(this);
- if (!hasValidMetaTileEntity()) return;
- }
- case 1:
- tCode++;
- if (isClientSide()) {
- if (mColor != oColor) {
- mMetaTileEntity.onColorChangeClient(oColor = mColor);
- issueTextureUpdate();
- }
-
- if (mNeedsUpdate) {
- worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
- //worldObj.func_147479_m(xCoord, yCoord, zCoord);
- mNeedsUpdate = false;
- }
- }
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- if (isServerSide() && mTickTimer > 10) {
- for (byte i = (byte) (tCode - 2); i < 6; i++)
- if (getCoverIDAtSide(i) != 0) {
- tCode++;
- GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
- int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
- if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
- mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- }
- }
- mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63));
- if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) {
- mConnections = (byte) ((mConnections & ~64) | -128);
- }
- }
- case 8:
- tCode = 9;
- mMetaTileEntity.onPreTick(this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- case 9:
- tCode++;
- if (isServerSide()) {
- if (mTickTimer == 10) {
- for (byte i = 0; i < 6; i++)
- mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
- issueBlockUpdate();
- joinEnet();
- }
-
- if (xCoord != oX || yCoord != oY || zCoord != oZ) {
- oX = xCoord;
- oY = yCoord;
- oZ = zCoord;
- issueClientUpdate();
- clearTileEntityBuffer();
- }
- }
- case 10:
- tCode++;
- mMetaTileEntity.onPostTick(this, mTickTimer);
- if (!hasValidMetaTileEntity()) return;
- case 11:
- tCode++;
- if (isServerSide()) {
- if (mTickTimer % 10 == 0) {
- if (mSendClientData) {
- NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
- mSendClientData = false;
- }
- }
-
- if (mTickTimer > 10) {
- if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections);
- byte tData = mMetaTileEntity.getUpdateData();
- if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData);
- if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor);
- tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0));
- if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
- }
-
- if (mNeedsBlockUpdate) {
- worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0));
- mNeedsBlockUpdate = false;
- }
- }
- default:
- tCode = -1;
- break;
- }
- }
- } catch (Throwable e) {
- //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
-
- if (isServerSide() && hasValidMetaTileEntity()) {
- tTime = System.nanoTime() - tTime;
- if (mTimeStatistics.length > 0)
- mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
- if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING*1000000) && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10)
- GT_FML_LOGGER.warn("WARNING: Possible Lag Source at ["+xCoord+","+yCoord+","+zCoord+"] in Dimension "+worldObj.provider.dimensionId+" with "+tTime+" ns caused by an instance of "+getMetaTileEntity().getClass());
- }
-
- mWorkUpdate = mInventoryChanged = false;
- }
-
- @Override
- public Packet getDescriptionPacket() {
- issueClientUpdate();
- return null;
- }
-
- public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) {
- issueTextureUpdate();
- if (aID > 0 && mID != aID) {
- mID = aID;
- createNewMetatileEntity(mID);
- }
-
- mCoverSides[0] = aCover0;
- mCoverSides[1] = aCover1;
- mCoverSides[2] = aCover2;
- mCoverSides[3] = aCover3;
- mCoverSides[4] = aCover4;
- mCoverSides[5] = aCover5;
-
- for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
-
- receiveClientEvent(0, aTextureData);
- receiveClientEvent(1, aUpdateData);
- receiveClientEvent(2, aColorData);
- receiveClientEvent(3, aRedstoneData);
- }
-
- @Override
- public boolean receiveClientEvent(int aEventID, int aValue) {
- super.receiveClientEvent(aEventID, aValue);
-
- if (hasValidMetaTileEntity()) {
- try {
- mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- if (isClientSide()) {
- issueTextureUpdate();
- switch (aEventID) {
- case 0:
- mConnections = (byte) aValue;
- break;
- case 1:
- if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue);
- break;
- case 2:
- if (aValue > 16 || aValue < 0) aValue = 0;
- mColor = (byte) aValue;
- break;
- case 3:
- mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0);
- mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0);
- mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0);
- mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0);
- mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0);
- mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0);
- break;
- case 4:
- if (hasValidMetaTileEntity() && mTickTimer > 20)
- mMetaTileEntity.doSound((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
- break;
- case 5:
- if (hasValidMetaTileEntity() && mTickTimer > 20)
- mMetaTileEntity.startSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
- break;
- case 6:
- if (hasValidMetaTileEntity() && mTickTimer > 20)
- mMetaTileEntity.stopSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
- break;
- }
- }
- return true;
- }
-
- public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
- ArrayList<String> tList = new ArrayList<String>();
- if (aLogLevel > 2) {
- tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
- }
- if (aLogLevel > 1) {
- if (mTimeStatistics.length > 0) {
- double tAverageTime = 0;
- double tWorstTime = 0;
- for (int tTime : mTimeStatistics) {
- tAverageTime += tTime;
- if (tTime > tWorstTime) {
- tWorstTime = tTime;
- }
- }
- tList.add("Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + "ns since " + mTimeStatistics.length + " ticks with worst time of " + tWorstTime + "ns.");
- }
- if (mLagWarningCount > 0) {
- tList.add("Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server.");
- }
- tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED+" not "+EnumChatFormatting.RESET) + "accessible for you");
- }
- if(joinedIc2Enet)
- tList.add("Joined IC2 ENet");
-
- return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
- }
-
- @Override
- public void issueTextureUpdate() {
- mNeedsUpdate = true;
- }
-
- @Override
- public void issueBlockUpdate() {
- mNeedsBlockUpdate = true;
- }
-
- @Override
- public void issueClientUpdate() {
- mSendClientData = true;
- }
-
- @Override
- public void issueCoverUpdate(byte aSide) {
- issueClientUpdate();
- }
-
- @Override
- public byte getStrongestRedstone() {
- return (byte) Math.max(getInternalInputRedstoneSignal((byte) 0), Math.max(getInternalInputRedstoneSignal((byte) 1), Math.max(getInternalInputRedstoneSignal((byte) 2), Math.max(getInternalInputRedstoneSignal((byte) 3), Math.max(getInternalInputRedstoneSignal((byte) 4), getInternalInputRedstoneSignal((byte) 5))))));
- }
-
- @Override
- public boolean getRedstone() {
- return getRedstone((byte) 0) || getRedstone((byte) 1) || getRedstone((byte) 2) || getRedstone((byte) 3) || getRedstone((byte) 4) || getRedstone((byte) 5);
- }
-
- @Override
- public boolean getRedstone(byte aSide) {
- return getInternalInputRedstoneSignal(aSide) > 0;
- }
-
- public ITexture getCoverTexture(byte aSide) {
- return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
- }
-
- @Override
- public boolean isGivingInformation() {
- if (canAccessData()) return mMetaTileEntity.isGivingInformation();
- return false;
- }
-
- @Override
- public boolean isValidFacing(byte aSide) {
- if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide);
- return false;
- }
-
- @Override
- public byte getBackFacing() {
- return GT_Utility.getOppositeSide(getFrontFacing());
- }
-
- @Override
- public byte getFrontFacing() {
- return 6;
- }
-
- @Override
- public void setFrontFacing(byte aFacing) {
- doEnetUpdate();
- }
-
- @Override
- public int getSizeInventory() {
- if (canAccessData()) return mMetaTileEntity.getSizeInventory();
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(int aIndex) {
- if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex);
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int aIndex, ItemStack aStack) {
- mInventoryChanged = true;
- if (canAccessData())
- mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
- }
-
- @Override
- public String getInventoryName() {
- if (canAccessData()) return mMetaTileEntity.getInventoryName();
- if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName();
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit();
- return 64;
- }
-
- @Override
- public void openInventory() {/*Do nothing*/}
-
- @Override
- public void closeInventory() {/*Do nothing*/}
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer aPlayer) {
- return hasValidMetaTileEntity() && mTickTimer > 40 && getTileEntityOffset(0, 0, 0) == this && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 && mMetaTileEntity.isAccessAllowed(aPlayer);
- }
-
- @Override
- public void validate() {
- super.validate();
- mTickTimer = 0;
- }
-
- @Override
- public void invalidate() {
- tileEntityInvalid = false;
- if (hasValidMetaTileEntity()) {
- mMetaTileEntity.onRemoval();
- mMetaTileEntity.setBaseMetaTileEntity(null);
- }
- leaveEnet();
- super.invalidate();
- }
-
- @Override
- public void onChunkUnload() {
- super.onChunkUnload();
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot) {
- ItemStack stack = getStackInSlot(slot);
- if (stack != null) setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();
- }
-
- @Override
- public int getProgress() {
- return canAccessData() ? mMetaTileEntity.getProgresstime() : 0;
- }
-
- @Override
- public int getMaxProgress() {
- return canAccessData() ? mMetaTileEntity.maxProgresstime() : 0;
- }
-
- @Override
- public boolean increaseProgress(int aProgressAmountInTicks) {
- return canAccessData() ? mMetaTileEntity.increaseProgress(aProgressAmountInTicks) != aProgressAmountInTicks : false;
- }
-
- @Override
- public boolean hasThingsToDo() {
- return getMaxProgress() > 0;
- }
-
- @Override
- public void enableWorking() {
- if (!mWorks) mWorkUpdate = true;
- mWorks = true;
- }
-
- @Override
- public void disableWorking() {
- mWorks = false;
- }
-
- @Override
- public boolean isAllowedToWork() {
- return mWorks;
- }
-
- @Override
- public boolean hasWorkJustBeenEnabled() {
- return mWorkUpdate;
- }
-
- @Override
- public byte getWorkDataValue() {
- return 0;
- }
-
- @Override
- public void setWorkDataValue(byte aValue) {/*Do nothing*/}
-
- @Override
- public int getMetaTileID() {
- return mID;
- }
-
- @Override
- public int setMetaTileID(short aID) {
- return mID = aID;
- }
-
- @Override
- public boolean isActive() {
- return false;
- }
-
- @Override
- public void setActive(boolean aActive) {/*Do nothing*/}
-
- @Override
- public long getTimer() {
- return mTickTimer;
- }
-
- @Override
- public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
- return false;
- }
-
- @Override
- public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- return false;
- }
-
- @Override
- public boolean inputEnergyFrom(byte aSide) {
- return false;
- }
-
- @Override
- public boolean inputEnergyFrom(byte aSide, boolean waitForActive) {
- return false;
- }
-
- @Override
- public boolean outputsEnergyTo(byte aSide) {
- return false;
- }
-
- @Override
- public boolean outputsEnergyTo(byte aSide, boolean waitForActive) {
- return false;
- }
-
- @Override
- public long getOutputAmperage() {
- return 0;
- }
-
- @Override
- public long getOutputVoltage() {
- return 0;
- }
-
- @Override
- public long getInputAmperage() {
- return 0;
- }
-
- @Override
- public long getInputVoltage() {
- return 0;
- }
-
- @Override
- public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- return false;
- }
-
- @Override
- public String[] getDescription() {
- if (canAccessData()) return mMetaTileEntity.getDescription();
- return new String[0];
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex);
- return false;
- }
-
- @Override
- public long getUniversalEnergyStored() {
- return Math.max(getStoredEU(), getStoredSteam());
- }
-
- @Override
- public long getUniversalEnergyCapacity() {
- return Math.max(getEUCapacity(), getSteamCapacity());
- }
-
- @Override
- public long getStoredEU() {
- return 0;
- }
-
- @Override
- public long getEUCapacity() {
- return 0;
- }
-
- @Override
- public long getStoredSteam() {
- return 0;
- }
-
- @Override
- public long getSteamCapacity() {
- return 0;
- }
-
- @Override
- public ITexture[] getTexture(Block aBlock, byte aSide) {
- ITexture rIcon = getCoverTexture(aSide);
- if (rIcon != null) return new ITexture[]{rIcon};
- return getTextureUncovered(aSide);
- }
-
- @Override
- public ITexture[] getTextureUncovered(byte aSide) {
- if ((mConnections & 64) != 0) return Textures.BlockIcons.FRESHFOAM;
- if ((mConnections & -128) != 0) return Textures.BlockIcons.HARDENEDFOAMS[mColor];
- if ((mConnections & -64) != 0) return Textures.BlockIcons.ERROR_RENDERING;
- byte tConnections = mConnections;
- if (tConnections == 1 || tConnections == 2) tConnections = 3;
- else if (tConnections == 4 || tConnections == 8) tConnections = 12;
- else if (tConnections == 16 || tConnections == 32) tConnections = 48;
- if (hasValidMetaTileEntity())
- return mMetaTileEntity.getTexture(this, aSide, tConnections, (byte) (mColor - 1), tConnections == 0 || (tConnections & (1 << aSide)) != 0, getOutputRedstoneSignal(aSide) > 0);
- return Textures.BlockIcons.ERROR_RENDERING;
- }
-
- protected boolean hasValidMetaTileEntity() {
- return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;
- }
-
- protected boolean canAccessData() {
- return hasValidMetaTileEntity() && !isDead;
- }
-
- @Override
- public void doExplosion(long aAmount) {
- if (canAccessData()) {
- mMetaTileEntity.onExplosion();
- mMetaTileEntity.doExplosion(aAmount);
- }
- }
-
- @Override
- public ArrayList<ItemStack> getDrops() {
- ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID);
- NBTTagCompound tNBT = new NBTTagCompound();
- if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone);
- for (byte i = 0; i < mCoverSides.length; i++) {
- if (mCoverSides[i] != 0) {
- tNBT.setIntArray("mCoverData", mCoverData);
- tNBT.setIntArray("mCoverSides", mCoverSides);
- break;
- }
- }
- if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT);
- if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT);
- return new ArrayList<ItemStack>(Arrays.asList(rStack));
- }
-
- @Override
- public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- if (isClientSide()) {
- if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true;
- }
- if (isServerSide()) {
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if (tCurrentItem != null) {
- if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
- tCurrentItem.func_150996_a(Items.bucket);
- setColorization((byte) -1);
- return true;
- }
- byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
- if (mMetaTileEntity.onWrenchRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
- GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
- if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
- setCoverDataAtSide(tSide, getCoverBehaviorAtSide(tSide).onCoverScrewdriverclick(tSide, getCoverIDAtSide(tSide), getCoverDataAtSide(tSide), this, aPlayer, 0.5F, 0.5F, 0.5F));
- mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- } else {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
- mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
- //if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord);
- //}
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- if (mWorks) disableWorking();
- else enableWorking();
- GT_Utility.sendChatToPlayer(aPlayer, trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled")));
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) {
- if (mMetaTileEntity.onWireCutterRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
- //logic handled internally
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- doEnetUpdate();
- return true;
- }
-
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
- if (mMetaTileEntity.onSolderingToolRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
- //logic handled internally
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 1.0F, -1, xCoord, yCoord, zCoord);
- } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) {
- mStrongRedstone ^= (1 << tSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak")));
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord);
- }
- doEnetUpdate();
- return true;
- }
-
- byte cSide = tSide;
- if (getCoverIDAtSide(aSide) != 0) cSide = aSide;
-
- if (getCoverIDAtSide(cSide) == 0) {
- if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
- if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(cSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(cSide, new GT_ItemStack(tCurrentItem))) {
- setCoverItemAtSide(cSide, tCurrentItem);
- if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--;
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
- }
- return true;
- }
- } else {
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) {
- if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
- GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord);
- dropCover(cSide, aSide, false);
- }
- return true;
- }
- }
- }
-
- if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ))
- return true;
- }
-
- if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
- return false;
-
- try {
- if (hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
-
- return false;
- }
-
- @Override
- public void onLeftclick(EntityPlayer aPlayer) {
- try {
- if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer);
- } catch (Throwable e) {
- GT_Log.err.println("Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
- e.printStackTrace(GT_Log.err);
- }
- }
-
- @Override
- public boolean isDigitalChest() {
- return false;
- }
-
- @Override
- public ItemStack[] getStoredItemData() {
- return null;
- }
-
- @Override
- public void setItemCount(int aCount) {
- //
- }
-
- @Override
- public int getMaxItemCount() {
- return 0;
- }
-
- /**
- * Can put aStack into Slot
- */
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack);
- }
-
- /**
- * returns all valid Inventory Slots, no matter which Side (Unless it's covered).
- * The Side Stuff is done in the following two Functions.
- */
- @Override
- public int[] getAccessibleSlotsFromSide(int aSide) {
- if (canAccessData() && (getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this)))
- return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
- return new int[0];
- }
-
- /**
- * Can put aStack into Slot at Side
- */
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
- }
-
- /**
- * Can pull aStack out of Slot from Side
- */
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
- }
-
- @Override
- public boolean isUpgradable() {
- return false;
- }
-
- @Override
- public byte getInternalInputRedstoneSignal(byte aSide) {
- return (byte) (getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) & 15);
- }
-
- @Override
- public byte getInputRedstoneSignal(byte aSide) {
- return (byte) (worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide) & 15);
- }
-
- @Override
- public byte getOutputRedstoneSignal(byte aSide) {
- return (byte) (getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) ? mSidedRedstone[aSide] & 15 : 0);
- }
-
- @Override
- public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) {
- if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
- setOutputRedstoneSignal(aSide, aStrength);
- }
-
- @Override
- public void setOutputRedstoneSignal(byte aSide, byte aStrength) {
- aStrength = (byte) Math.min(Math.max(0, aStrength), 15);
- if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) {
- mSidedRedstone[aSide] = aStrength;
- issueBlockUpdate();
- }
- }
-
- @Override
- public boolean isSteamEngineUpgradable() {
- return isUpgradable() && !hasSteamEngineUpgrade() && getSteamCapacity() > 0;
- }
-
- @Override
- public boolean addSteamEngineUpgrade() {
- if (isSteamEngineUpgradable()) {
- issueBlockUpdate();
- return true;
- }
- return false;
- }
-
- @Override
- public boolean hasSteamEngineUpgrade() {
- return false;
- }
-
- @Override
- public boolean hasInventoryBeenModified() {
- return mInventoryChanged;
- }
-
- @Override
- public void setGenericRedstoneOutput(boolean aOnOff) {
- //
- }
-
- @Override
- public int getErrorDisplayID() {
- return 0;
- }
-
- @Override
- public void setErrorDisplayID(int aErrorID) {
- //
- }
-
- @Override
- public IMetaTileEntity getMetaTileEntity() {
- return hasValidMetaTileEntity() ? mMetaTileEntity : null;
- }
-
- @Override
- public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) {
- mMetaTileEntity = (MetaPipeEntity) aMetaTileEntity;
- }
-
- @Override
- public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) {
- return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior;
- }
-
- @Override
- public void setCoverIDAtSide(byte aSide, int aID) {
- if (aSide >= 0 && aSide < 6) {
- mCoverSides[aSide] = aID;
- mCoverData[aSide] = 0;
- mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
- issueCoverUpdate(aSide);
- issueBlockUpdate();
- }
- }
-
- @Override
- public void setCoverItemAtSide(byte aSide, ItemStack aCover) {
- GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
- }
-
- @Override
- public int getCoverIDAtSide(byte aSide) {
- if (aSide >= 0 && aSide < 6) return mCoverSides[aSide];
- return 0;
- }
-
- @Override
- public ItemStack getCoverItemAtSide(byte aSide) {
- return GT_Utility.intToStack(getCoverIDAtSide(aSide));
- }
-
- @Override
- public boolean canPlaceCoverIDAtSide(byte aSide, int aID) {
- return getCoverIDAtSide(aSide) == 0;
- }
-
- @Override
- public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) {
- return getCoverIDAtSide(aSide) == 0;
- }
-
- @Override
- public void setCoverDataAtSide(byte aSide, int aData) {
- if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData;
- }
-
- @Override
- public int getCoverDataAtSide(byte aSide) {
- if (aSide >= 0 && aSide < 6) return mCoverData[aSide];
- return 0;
- }
-
- @Override
- public void setLightValue(byte aLightValue) {
- //
- }
-
- @Override
- public long getAverageElectricInput() {
- return 0;
- }
-
- @Override
- public long getAverageElectricOutput() {
- return 0;
- }
-
- @Override
- public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) {
- if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) {
- ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this);
- if (tStack != null) {
- tStack.setTagCompound(null);
- EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack);
- tEntity.motionX = 0;
- tEntity.motionY = 0;
- tEntity.motionZ = 0;
- worldObj.spawnEntityInWorld(tEntity);
- }
-
- setCoverIDAtSide(aSide, 0);
- setOutputRedstoneSignal(aSide, (byte) 0);
- return true;
- }
- return false;
- }
-
- @Override
- public String getOwnerName() {
- return "Player";
- }
-
- @Override
- public String setOwnerName(String aName) {
- return "Player";
- }
-
- @Override
- public UUID getOwnerUuid() {
- return GT_Utility.defaultUuid;
- }
-
- @Override
- public void setOwnerUuid(UUID uuid) {
-
- }
-
- @Override
- public byte getComparatorValue(byte aSide) {
- return canAccessData() ? mMetaTileEntity.getComparatorValue(aSide) : 0;
- }
-
- @Override
- public byte getStrongOutputRedstoneSignal(byte aSide) {
- return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) : 0;
- }
-
- @Override
- public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) {
- mStrongRedstone |= (1 << aSide);
- setOutputRedstoneSignal(aSide, aStrength);
- }
-
- @Override
- public ItemStack decrStackSize(int aIndex, int aAmount) {
- if (canAccessData()) {
- mInventoryChanged = true;
- return mMetaTileEntity.decrStackSize(aIndex, aAmount);
- }
- return null;
- }
-
- @Override
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (canAccessData()) return mMetaTileEntity.injectEnergyUnits(aSide, aVoltage, aAmperage);
- return 0;
- }
-
- @Override
- public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- return false;
- }
-
- @Override
- public boolean acceptsRotationalEnergy(byte aSide) {
- if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
- return mMetaTileEntity.acceptsRotationalEnergy(aSide);
- }
-
- @Override
- public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
- if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
- return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy);
- }
-
- private boolean canMoveFluidOnSide(ForgeDirection aSide, Fluid aFluid, boolean isFill) {
- if (aSide == ForgeDirection.UNKNOWN)
- return true;
-
- IFluidHandler tTileEntity = getITankContainerAtSide((byte) aSide.ordinal());
- // Only require a connection if there's something to connect to - Allows fluid cells & buckets to interact with the pipe
- if (tTileEntity != null && !mMetaTileEntity.isConnectedAtSide((byte) aSide.ordinal()))
- return false;
-
- if(isFill && mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))
- return true;
-
- if (!isFill && mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
- && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()),aFluid, this))
- return true;
-
- return false;
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluidStack, boolean doFill) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true))
- return mMetaTileEntity.fill(aSide, aFluidStack, doFill);
- return 0;
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, mMetaTileEntity.getFluid() == null ? null : mMetaTileEntity.getFluid().getFluid(), false))
- return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
- return null;
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluidStack, boolean doDrain) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false))
- return mMetaTileEntity.drain(aSide, aFluidStack, doDrain);
- return null;
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluid, true))
- return mMetaTileEntity.canFill(aSide, aFluid);
- return false;
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluid, false))
- return mMetaTileEntity.canDrain(aSide, aFluid);
- return false;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (canAccessData()
- && (aSide == ForgeDirection.UNKNOWN
- || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
- && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))
- || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))
- // Doesn't need to be connected to get Tank Info -- otherwise things can't connect
- )
- )
- return mMetaTileEntity.getTankInfo(aSide);
- return new FluidTankInfo[]{};
- }
-
- @Override
- public boolean isInvalidTileEntity() {
- return isInvalid();
- }
-
- @Override
- public boolean addStackToSlot(int aIndex, ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) return true;
- if (aIndex < 0 || aIndex >= getSizeInventory()) return false;
- ItemStack tStack = getStackInSlot(aIndex);
- if (GT_Utility.isStackInvalid(tStack)) {
- setInventorySlotContents(aIndex, aStack);
- return true;
- }
- aStack = GT_OreDictUnificator.get(aStack);
- if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
- tStack.stackSize += aStack.stackSize;
- return true;
- }
- return false;
- }
-
- @Override
- public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) {
- return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack));
- }
-
- @Override
- public byte getColorization() {
- return (byte) (mColor - 1);
- }
-
- @Override
- public byte setColorization(byte aColor) {
- if (aColor > 15 || aColor < -1) aColor = -1;
- mColor = (byte) (aColor + 1);
- if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor);
- return mColor;
- }
-
- @Override
- public float getThickNess() {
- if (canAccessData()) return mMetaTileEntity.getThickNess();
- return 1.0F;
- }
-
- public boolean renderInside(byte aSide) {
- if (canAccessData()) return mMetaTileEntity.renderInside(aSide);
- return false;
- }
-
- @Override
- public float getBlastResistance(byte aSide) {
- return (mConnections & 192) != 0 ? 50.0F : 5.0F;
- }
-
- @Override
- public boolean isMufflerUpgradable() {
- return false;
- }
-
- @Override
- public boolean addMufflerUpgrade() {
- return false;
- }
-
- @Override
- public boolean hasMufflerUpgrade() {
- return false;
- }
-
- @Override
- public boolean isUniversalEnergyStored(long aEnergyAmount) {
- return getUniversalEnergyStored() >= aEnergyAmount;
- }
-
- @Override
- public String[] getInfoData() {
- {
- if (canAccessData()) return getMetaTileEntity().getInfoData();
- return new String[]{};
- }
- }
-
- @Override
- public byte getConnections() {
- return mConnections;
- }
-
- @Override
- public void markDirty() {
- super.markDirty();
- mInventoryChanged = true;
- }
-
- public void onNeighborBlockChange(int aX, int aY, int aZ) {
- if (canAccessData()) {
- final IMetaTileEntity meta = getMetaTileEntity();
- if (meta instanceof MetaPipeEntity) {
- // Trigger a checking of connections in case someone placed down a block that the pipe/wire shouldn't be connected to.
- // However; don't do it immediately in case the world isn't finished loading
- // (This caused issues with AE2 GTEU p2p connections.
- ((MetaPipeEntity) meta).setCheckConnections();
- }
- }
- }
-
- @Override
- public int getLightOpacity() {
- return mMetaTileEntity == null ? 0 : mMetaTileEntity.getLightOpacity();
- }
-
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
- mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- }
-}
+package gregtech.api.metatileentity;
+
+import static gregtech.GT_Mod.GT_FML_LOGGER;
+import static gregtech.api.enums.GT_Values.NW;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
+import gregtech.api.net.GT_Packet_TileEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.covers.GT_Cover_Fluidfilter;
+import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.Packet;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the main TileEntity for EVERYTHING.
+ */
+public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileEntity, IPipeRenderedTileEntity {
+ private final GT_CoverBehavior[] mCoverBehaviors = new GT_CoverBehavior[]{GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior, GregTech_API.sNoBehavior};
+ public byte mConnections = 0;
+ protected MetaPipeEntity mMetaTileEntity;
+ private byte[] mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+ private int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0}, mCoverData = new int[]{0, 0, 0, 0, 0, 0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING];
+ private boolean mInventoryChanged = false, mWorkUpdate = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false;
+ private boolean mCheckConnections = false;
+ private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, mLagWarningCount = 0;
+ private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0;
+ private short mID = 0;
+ private long mTickTimer = 0;
+
+ public BaseMetaPipeEntity() {
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ try {
+ super.writeToNBT(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ try {
+ aNBT.setInteger("mID", mID);
+ aNBT.setIntArray("mCoverData", mCoverData);
+ aNBT.setIntArray("mCoverSides", mCoverSides);
+ aNBT.setByteArray("mRedstoneSided", mSidedRedstone);
+ aNBT.setByte("mConnections", mConnections);
+ aNBT.setByte("mColor", mColor);
+ aNBT.setByte("mStrongRedstone", mStrongRedstone);
+ aNBT.setBoolean("mWorks", !mWorks);
+
+ for(int i=0;i < mCoverData.length; i++) {
+ if (GregTech_API.getCoverBehavior(mCoverSides[i]) instanceof GT_Cover_Fluidfilter) {
+ final int fluidId = mCoverData[i] >>> 3;
+ final Fluid fluid = FluidRegistry.getFluid(fluidId);
+ if(fluid != null) {
+ final String fluidName = FluidRegistry.getFluidName(fluid);
+ aNBT.setString(String.format("fluidFilter%d", i), fluidName);
+ }
+ }
+ }
+
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ try {
+ if (hasValidMetaTileEntity()) {
+ NBTTagList tItemList = new NBTTagList();
+ for (int i = 0; i < mMetaTileEntity.getRealInventory().length; i++) {
+ ItemStack tStack = mMetaTileEntity.getRealInventory()[i];
+ if (tStack != null) {
+ NBTTagCompound tTag = new NBTTagCompound();
+ tTag.setInteger("IntSlot", i);
+ tStack.writeToNBT(tTag);
+ tItemList.appendTag(tTag);
+ }
+ }
+ aNBT.setTag("Inventory", tItemList);
+
+ try {
+ mMetaTileEntity.saveNBTData(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered CRITICAL ERROR while saving MetaTileEntity, the Chunk whould've been corrupted by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+ setInitialValuesAsNBT(aNBT, (short) 0);
+ }
+
+ @Override
+ public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID) {
+ if (aNBT == null) {
+ if (aID > 0) mID = aID;
+ else mID = mID > 0 ? mID : 0;
+ if (mID != 0) createNewMetatileEntity(mID);
+ } else {
+ if (aID <= 0) mID = (short) aNBT.getInteger("mID");
+ else mID = aID;
+ mCoverSides = aNBT.getIntArray("mCoverSides");
+ mCoverData = aNBT.getIntArray("mCoverData");
+ mSidedRedstone = aNBT.getByteArray("mRedstoneSided");
+ mConnections = aNBT.getByte("mConnections");
+ mColor = aNBT.getByte("mColor");
+ mStrongRedstone = aNBT.getByte("mStrongRedstone");
+ mWorks = !aNBT.getBoolean("mWorks");
+
+ if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
+ if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
+ if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+
+ for (byte i = 0; i < 6; i++) {
+ mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ if(mCoverBehaviors[i] instanceof GT_Cover_Fluidfilter) {
+ final String filterKey = String.format("fluidFilter%d", i);
+ if (aNBT.hasKey(filterKey)) {
+ mCoverData[i] = (mCoverData[i] & 7) | (FluidRegistry.getFluidID(aNBT.getString(filterKey)) << 3);
+ }
+ }
+ }
+
+
+ if (mID != 0 && createNewMetatileEntity(mID)) {
+ NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
+ for (int i = 0; i < tItemList.tagCount(); i++) {
+ NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
+ int tSlot = tTag.getInteger("IntSlot");
+ if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) {
+ mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
+ }
+ }
+
+ try {
+ mMetaTileEntity.loadNBTData(aNBT);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while loading MetaTileEntity, the Server should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+
+ if (mCoverData.length != 6) mCoverData = new int[]{0, 0, 0, 0, 0, 0};
+ if (mCoverSides.length != 6) mCoverSides = new int[]{0, 0, 0, 0, 0, 0};
+ if (mSidedRedstone.length != 6) mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ }
+
+ private boolean createNewMetatileEntity(short aID) {
+ if (aID <= 0 || aID >= GregTech_API.METATILEENTITIES.length || GregTech_API.METATILEENTITIES[aID] == null) {
+ GT_Log.err.println("MetaID " + aID + " not loadable => locking TileEntity!");
+ } else {
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setBaseMetaTileEntity(null);
+ GregTech_API.METATILEENTITIES[aID].newMetaEntity(this).setBaseMetaTileEntity(this);
+ mTickTimer = 0;
+ mID = aID;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void updateEntity() {
+ super.updateEntity();
+
+ if (!hasValidMetaTileEntity()) {
+ if (mMetaTileEntity == null) return;
+ mMetaTileEntity.setBaseMetaTileEntity(this);
+ }
+
+ long tTime = System.nanoTime();
+ int tCode = 0;
+
+ try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
+ switch (tCode) {
+ case 0:
+ tCode++;
+ if (mTickTimer++ == 0) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ if (isServerSide()) for (byte i = 0; i < 6; i++)
+ if (getCoverIDAtSide(i) != 0)
+ if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
+ dropCover(i, i, true);
+ worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
+ mMetaTileEntity.onFirstTick(this);
+ if (!hasValidMetaTileEntity()) return;
+ }
+ case 1:
+ tCode++;
+ if (isClientSide()) {
+ if (mColor != oColor) {
+ mMetaTileEntity.onColorChangeClient(oColor = mColor);
+ issueTextureUpdate();
+ }
+
+ if (mNeedsUpdate) {
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ //worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ mNeedsUpdate = false;
+ }
+ }
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (isServerSide() && mTickTimer > 10) {
+ for (byte i = (byte) (tCode - 2); i < 6; i++)
+ if (getCoverIDAtSide(i) != 0) {
+ tCode++;
+ GT_CoverBehavior tCover = getCoverBehaviorAtSide(i);
+ int tCoverTickRate = tCover.getTickRate(i, getCoverIDAtSide(i), mCoverData[i], this);
+ if (tCoverTickRate > 0 && mTickTimer % tCoverTickRate == 0) {
+ mCoverData[i] = tCover.doCoverThings(i, getInputRedstoneSignal(i), getCoverIDAtSide(i), mCoverData[i], this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ }
+ }
+ mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~63));
+ if ((mConnections & -64) == 64 && getRandomNumber(1000) == 0) {
+ mConnections = (byte) ((mConnections & ~64) | -128);
+ }
+ }
+ case 8:
+ tCode = 9;
+ mMetaTileEntity.onPreTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ case 9:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer == 10) {
+ for (byte i = 0; i < 6; i++)
+ mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+ issueBlockUpdate();
+ joinEnet();
+ }
+
+ if (xCoord != oX || yCoord != oY || zCoord != oZ) {
+ oX = xCoord;
+ oY = yCoord;
+ oZ = zCoord;
+ issueClientUpdate();
+ clearTileEntityBuffer();
+ }
+ }
+ case 10:
+ tCode++;
+ mMetaTileEntity.onPostTick(this, mTickTimer);
+ if (!hasValidMetaTileEntity()) return;
+ case 11:
+ tCode++;
+ if (isServerSide()) {
+ if (mTickTimer % 10 == 0) {
+ if (mSendClientData) {
+ NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = mConnections, oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
+ mSendClientData = false;
+ }
+ }
+
+ if (mTickTimer > 10) {
+ if (mConnections != oTextureData) sendBlockEvent((byte) 0, oTextureData = mConnections);
+ byte tData = mMetaTileEntity.getUpdateData();
+ if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData);
+ if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor);
+ tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0));
+ if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData);
+ }
+
+ if (mNeedsBlockUpdate) {
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockOffset(0, 0, 0));
+ mNeedsBlockUpdate = false;
+ }
+ }
+ default:
+ tCode = -1;
+ break;
+ }
+ }
+ } catch (Throwable e) {
+ //GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+
+ if (isServerSide() && hasValidMetaTileEntity()) {
+ tTime = System.nanoTime() - tTime;
+ if (mTimeStatistics.length > 0)
+ mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
+ if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING*1000000) && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10)
+ GT_FML_LOGGER.warn("WARNING: Possible Lag Source at ["+xCoord+","+yCoord+","+zCoord+"] in Dimension "+worldObj.provider.dimensionId+" with "+tTime+" ns caused by an instance of "+getMetaTileEntity().getClass());
+ }
+
+ mWorkUpdate = mInventoryChanged = false;
+ }
+
+ @Override
+ public Packet getDescriptionPacket() {
+ issueClientUpdate();
+ return null;
+ }
+
+ public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) {
+ issueTextureUpdate();
+ if (aID > 0 && mID != aID) {
+ mID = aID;
+ createNewMetatileEntity(mID);
+ }
+
+ mCoverSides[0] = aCover0;
+ mCoverSides[1] = aCover1;
+ mCoverSides[2] = aCover2;
+ mCoverSides[3] = aCover3;
+ mCoverSides[4] = aCover4;
+ mCoverSides[5] = aCover5;
+
+ for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
+
+ receiveClientEvent(0, aTextureData);
+ receiveClientEvent(1, aUpdateData);
+ receiveClientEvent(2, aColorData);
+ receiveClientEvent(3, aRedstoneData);
+ }
+
+ @Override
+ public boolean receiveClientEvent(int aEventID, int aValue) {
+ super.receiveClientEvent(aEventID, aValue);
+
+ if (hasValidMetaTileEntity()) {
+ try {
+ mMetaTileEntity.receiveClientEvent((byte) aEventID, (byte) aValue);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while receiving Data from the Server, the Client should've been crashed by now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ if (isClientSide()) {
+ issueTextureUpdate();
+ switch (aEventID) {
+ case 0:
+ mConnections = (byte) aValue;
+ break;
+ case 1:
+ if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue);
+ break;
+ case 2:
+ if (aValue > 16 || aValue < 0) aValue = 0;
+ mColor = (byte) aValue;
+ break;
+ case 3:
+ mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0);
+ mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0);
+ mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0);
+ mSidedRedstone[3] = (byte) ((aValue & 8) == 8 ? 15 : 0);
+ mSidedRedstone[4] = (byte) ((aValue & 16) == 16 ? 15 : 0);
+ mSidedRedstone[5] = (byte) ((aValue & 32) == 32 ? 15 : 0);
+ break;
+ case 4:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.doSound((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 5:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.startSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ case 6:
+ if (hasValidMetaTileEntity() && mTickTimer > 20)
+ mMetaTileEntity.stopSoundLoop((byte) aValue, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
+ break;
+ }
+ }
+ return true;
+ }
+
+ public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aLogLevel) {
+ ArrayList<String> tList = new ArrayList<String>();
+ if (aLogLevel > 2) {
+ tList.add("Meta-ID: " + EnumChatFormatting.BLUE+ mID +EnumChatFormatting.RESET + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN+" valid"+EnumChatFormatting.RESET : EnumChatFormatting.RED+" invalid"+EnumChatFormatting.RESET) + (mMetaTileEntity == null ? EnumChatFormatting.RED+" MetaTileEntity == null!"+EnumChatFormatting.RESET : " "));
+ }
+ if (aLogLevel > 1) {
+ if (mTimeStatistics.length > 0) {
+ double tAverageTime = 0;
+ double tWorstTime = 0;
+ for (int tTime : mTimeStatistics) {
+ tAverageTime += tTime;
+ if (tTime > tWorstTime) {
+ tWorstTime = tTime;
+ }
+ }
+ tList.add("Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + "ns since " + mTimeStatistics.length + " ticks with worst time of " + tWorstTime + "ns.");
+ }
+ if (mLagWarningCount > 0) {
+ tList.add("Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + " Lag Spike Warnings (anything taking longer than " + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + "ms) on the Server.");
+ }
+ tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED+" not "+EnumChatFormatting.RESET) + "accessible for you");
+ }
+ if(joinedIc2Enet)
+ tList.add("Joined IC2 ENet");
+
+ return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList);
+ }
+
+ @Override
+ public void issueTextureUpdate() {
+ mNeedsUpdate = true;
+ }
+
+ @Override
+ public void issueBlockUpdate() {
+ mNeedsBlockUpdate = true;
+ }
+
+ @Override
+ public void issueClientUpdate() {
+ mSendClientData = true;
+ }
+
+ @Override
+ public void issueCoverUpdate(byte aSide) {
+ issueClientUpdate();
+ }
+
+ @Override
+ public byte getStrongestRedstone() {
+ return (byte) Math.max(getInternalInputRedstoneSignal((byte) 0), Math.max(getInternalInputRedstoneSignal((byte) 1), Math.max(getInternalInputRedstoneSignal((byte) 2), Math.max(getInternalInputRedstoneSignal((byte) 3), Math.max(getInternalInputRedstoneSignal((byte) 4), getInternalInputRedstoneSignal((byte) 5))))));
+ }
+
+ @Override
+ public boolean getRedstone() {
+ return getRedstone((byte) 0) || getRedstone((byte) 1) || getRedstone((byte) 2) || getRedstone((byte) 3) || getRedstone((byte) 4) || getRedstone((byte) 5);
+ }
+
+ @Override
+ public boolean getRedstone(byte aSide) {
+ return getInternalInputRedstoneSignal(aSide) > 0;
+ }
+
+ public ITexture getCoverTexture(byte aSide) {
+ return GregTech_API.sCovers.get(new GT_ItemStack(getCoverIDAtSide(aSide)));
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ if (canAccessData()) return mMetaTileEntity.isGivingInformation();
+ return false;
+ }
+
+ @Override
+ public boolean isValidFacing(byte aSide) {
+ if (canAccessData()) return mMetaTileEntity.isFacingValid(aSide);
+ return false;
+ }
+
+ @Override
+ public byte getBackFacing() {
+ return GT_Utility.getOppositeSide(getFrontFacing());
+ }
+
+ @Override
+ public byte getFrontFacing() {
+ return 6;
+ }
+
+ @Override
+ public void setFrontFacing(byte aFacing) {
+ doEnetUpdate();
+ }
+
+ @Override
+ public int getSizeInventory() {
+ if (canAccessData()) return mMetaTileEntity.getSizeInventory();
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (canAccessData()) return mMetaTileEntity.getStackInSlot(aIndex);
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ mInventoryChanged = true;
+ if (canAccessData())
+ mMetaTileEntity.setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack));
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (canAccessData()) return mMetaTileEntity.getInventoryName();
+ if (GregTech_API.METATILEENTITIES[mID] != null) return GregTech_API.METATILEENTITIES[mID].getInventoryName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ if (canAccessData()) return mMetaTileEntity.getInventoryStackLimit();
+ return 64;
+ }
+
+ @Override
+ public void openInventory() {/*Do nothing*/}
+
+ @Override
+ public void closeInventory() {/*Do nothing*/}
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer aPlayer) {
+ return hasValidMetaTileEntity() && mTickTimer > 40 && getTileEntityOffset(0, 0, 0) == this && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 && mMetaTileEntity.isAccessAllowed(aPlayer);
+ }
+
+ @Override
+ public void validate() {
+ super.validate();
+ mTickTimer = 0;
+ }
+
+ @Override
+ public void invalidate() {
+ tileEntityInvalid = false;
+ if (hasValidMetaTileEntity()) {
+ mMetaTileEntity.onRemoval();
+ mMetaTileEntity.setBaseMetaTileEntity(null);
+ }
+ leaveEnet();
+ super.invalidate();
+ }
+
+ @Override
+ public void onChunkUnload() {
+ super.onChunkUnload();
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot) {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null) setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate();
+ }
+
+ @Override
+ public int getProgress() {
+ return canAccessData() ? mMetaTileEntity.getProgresstime() : 0;
+ }
+
+ @Override
+ public int getMaxProgress() {
+ return canAccessData() ? mMetaTileEntity.maxProgresstime() : 0;
+ }
+
+ @Override
+ public boolean increaseProgress(int aProgressAmountInTicks) {
+ return canAccessData() ? mMetaTileEntity.increaseProgress(aProgressAmountInTicks) != aProgressAmountInTicks : false;
+ }
+
+ @Override
+ public boolean hasThingsToDo() {
+ return getMaxProgress() > 0;
+ }
+
+ @Override
+ public void enableWorking() {
+ if (!mWorks) mWorkUpdate = true;
+ mWorks = true;
+ }
+
+ @Override
+ public void disableWorking() {
+ mWorks = false;
+ }
+
+ @Override
+ public boolean isAllowedToWork() {
+ return mWorks;
+ }
+
+ @Override
+ public boolean hasWorkJustBeenEnabled() {
+ return mWorkUpdate;
+ }
+
+ @Override
+ public byte getWorkDataValue() {
+ return 0;
+ }
+
+ @Override
+ public void setWorkDataValue(byte aValue) {/*Do nothing*/}
+
+ @Override
+ public int getMetaTileID() {
+ return mID;
+ }
+
+ @Override
+ public int setMetaTileID(short aID) {
+ return mID = aID;
+ }
+
+ @Override
+ public boolean isActive() {
+ return false;
+ }
+
+ @Override
+ public void setActive(boolean aActive) {/*Do nothing*/}
+
+ @Override
+ public long getTimer() {
+ return mTickTimer;
+ }
+
+ @Override
+ public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ return false;
+ }
+
+ @Override
+ public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ return false;
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide, boolean waitForActive) {
+ return false;
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide, boolean waitForActive) {
+ return false;
+ }
+
+ @Override
+ public long getOutputAmperage() {
+ return 0;
+ }
+
+ @Override
+ public long getOutputVoltage() {
+ return 0;
+ }
+
+ @Override
+ public long getInputAmperage() {
+ return 0;
+ }
+
+ @Override
+ public long getInputVoltage() {
+ return 0;
+ }
+
+ @Override
+ public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (canAccessData()) return mMetaTileEntity.getDescription();
+ return new String[0];
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ if (canAccessData()) return mMetaTileEntity.isValidSlot(aIndex);
+ return false;
+ }
+
+ @Override
+ public long getUniversalEnergyStored() {
+ return Math.max(getStoredEU(), getStoredSteam());
+ }
+
+ @Override
+ public long getUniversalEnergyCapacity() {
+ return Math.max(getEUCapacity(), getSteamCapacity());
+ }
+
+ @Override
+ public long getStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long getEUCapacity() {
+ return 0;
+ }
+
+ @Override
+ public long getStoredSteam() {
+ return 0;
+ }
+
+ @Override
+ public long getSteamCapacity() {
+ return 0;
+ }
+
+ @Override
+ public ITexture[] getTexture(Block aBlock, byte aSide) {
+ ITexture rIcon = getCoverTexture(aSide);
+ if (rIcon != null) return new ITexture[]{rIcon};
+ return getTextureUncovered(aSide);
+ }
+
+ @Override
+ public ITexture[] getTextureUncovered(byte aSide) {
+ if ((mConnections & 64) != 0) return Textures.BlockIcons.FRESHFOAM;
+ if ((mConnections & -128) != 0) return Textures.BlockIcons.HARDENEDFOAMS[mColor];
+ if ((mConnections & -64) != 0) return Textures.BlockIcons.ERROR_RENDERING;
+ byte tConnections = mConnections;
+ if (tConnections == 1 || tConnections == 2) tConnections = 3;
+ else if (tConnections == 4 || tConnections == 8) tConnections = 12;
+ else if (tConnections == 16 || tConnections == 32) tConnections = 48;
+ if (hasValidMetaTileEntity())
+ return mMetaTileEntity.getTexture(this, aSide, tConnections, (byte) (mColor - 1), tConnections == 0 || (tConnections & (1 << aSide)) != 0, getOutputRedstoneSignal(aSide) > 0);
+ return Textures.BlockIcons.ERROR_RENDERING;
+ }
+
+ protected boolean hasValidMetaTileEntity() {
+ return mMetaTileEntity != null && mMetaTileEntity.getBaseMetaTileEntity() == this;
+ }
+
+ protected boolean canAccessData() {
+ return hasValidMetaTileEntity() && !isDead;
+ }
+
+ @Override
+ public void doExplosion(long aAmount) {
+ if (canAccessData()) {
+ mMetaTileEntity.onExplosion();
+ mMetaTileEntity.doExplosion(aAmount);
+ }
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops() {
+ ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID);
+ NBTTagCompound tNBT = new NBTTagCompound();
+ if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone);
+ for (byte i = 0; i < mCoverSides.length; i++) {
+ if (mCoverSides[i] != 0) {
+ tNBT.setIntArray("mCoverData", mCoverData);
+ tNBT.setIntArray("mCoverSides", mCoverSides);
+ break;
+ }
+ }
+ if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT);
+ if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT);
+ return new ArrayList<ItemStack>(Arrays.asList(rStack));
+ }
+
+ @Override
+ public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ if (isClientSide()) {
+ if (getCoverBehaviorAtSide(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) return true;
+ }
+ if (isServerSide()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null) {
+ if (getColorization() >= 0 && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) {
+ tCurrentItem.func_150996_a(Items.bucket);
+ setColorization((byte) -1);
+ return true;
+ }
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) {
+ if (mMetaTileEntity.onWrenchRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)) {
+ if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) {
+ setCoverDataAtSide(tSide, getCoverBehaviorAtSide(tSide).onCoverScrewdriverclick(tSide, getCoverIDAtSide(tSide), getCoverDataAtSide(tSide), this, aPlayer, 0.5F, 0.5F, 0.5F));
+ mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ } else {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ setCoverDataAtSide(aSide, getCoverBehaviorAtSide(aSide).onCoverScrewdriverclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ));
+ mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)) {
+ //if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ // GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(1), 1.0F, -1, xCoord, yCoord, zCoord);
+ //}
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ if (mWorks) disableWorking();
+ else enableWorking();
+ GT_Utility.sendChatToPlayer(aPlayer, trans("090","Machine Processing: ") + (isAllowedToWork() ? trans("088","Enabled") : trans("087","Disabled")));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(101), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)) {
+ if (mMetaTileEntity.onWireCutterRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ //logic handled internally
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ doEnetUpdate();
+ return true;
+ }
+
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) {
+ if (mMetaTileEntity.onSolderingToolRightClick(aSide, tSide, aPlayer, aX, aY, aZ)) {
+ //logic handled internally
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 1.0F, -1, xCoord, yCoord, zCoord);
+ } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) {
+ mStrongRedstone ^= (1 << tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak")));
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord);
+ }
+ doEnetUpdate();
+ return true;
+ }
+
+ byte cSide = tSide;
+ if (getCoverIDAtSide(aSide) != 0) cSide = aSide;
+
+ if (getCoverIDAtSide(cSide) == 0) {
+ if (GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
+ if (GregTech_API.getCoverBehavior(tCurrentItem).isCoverPlaceable(cSide, new GT_ItemStack(tCurrentItem), this) && mMetaTileEntity.allowCoverOnSide(cSide, new GT_ItemStack(tCurrentItem))) {
+ setCoverItemAtSide(cSide, tCurrentItem);
+ if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--;
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord);
+ }
+ return true;
+ }
+ } else {
+ if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) {
+ if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
+ GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(0), 1.0F, -1, xCoord, yCoord, zCoord);
+ dropCover(cSide, aSide, false);
+ }
+ return true;
+ }
+ }
+ }
+
+ if (getCoverBehaviorAtSide(aSide).onCoverRightclick(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this, aPlayer, aX, aY, aZ))
+ return true;
+ }
+
+ if (!getCoverBehaviorAtSide(aSide).isGUIClickable(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ return false;
+
+ try {
+ if (hasValidMetaTileEntity()) return mMetaTileEntity.onRightclick(this, aPlayer, aSide, aX, aY, aZ);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+
+ return false;
+ }
+
+ @Override
+ public void onLeftclick(EntityPlayer aPlayer) {
+ try {
+ if (aPlayer != null && hasValidMetaTileEntity()) mMetaTileEntity.onLeftclick(this, aPlayer);
+ } catch (Throwable e) {
+ GT_Log.err.println("Encountered Exception while leftclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!");
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ @Override
+ public boolean isDigitalChest() {
+ return false;
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData() {
+ return null;
+ }
+
+ @Override
+ public void setItemCount(int aCount) {
+ //
+ }
+
+ @Override
+ public int getMaxItemCount() {
+ return 0;
+ }
+
+ /**
+ * Can put aStack into Slot
+ */
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return canAccessData() && mMetaTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ /**
+ * returns all valid Inventory Slots, no matter which Side (Unless it's covered).
+ * The Side Stuff is done in the following two Functions.
+ */
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ if (canAccessData() && (getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this) || getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), -1, this)))
+ return mMetaTileEntity.getAccessibleSlotsFromSide(aSide);
+ return new int[0];
+ }
+
+ /**
+ * Can put aStack into Slot at Side
+ */
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide);
+ }
+
+ /**
+ * Can pull aStack out of Slot from Side
+ */
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return canAccessData() && getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, getCoverIDAtSide((byte) aSide), getCoverDataAtSide((byte) aSide), aIndex, this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean isUpgradable() {
+ return false;
+ }
+
+ @Override
+ public byte getInternalInputRedstoneSignal(byte aSide) {
+ return (byte) (getCoverBehaviorAtSide(aSide).getRedstoneInput(aSide, getInputRedstoneSignal(aSide), getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) & 15);
+ }
+
+ @Override
+ public byte getInputRedstoneSignal(byte aSide) {
+ return (byte) (worldObj.getIndirectPowerLevelTo(getOffsetX(aSide, 1), getOffsetY(aSide, 1), getOffsetZ(aSide, 1), aSide) & 15);
+ }
+
+ @Override
+ public byte getOutputRedstoneSignal(byte aSide) {
+ return (byte) (getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) || (getCoverBehaviorAtSide(aSide).letsRedstoneGoOut(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this)) ? mSidedRedstone[aSide] & 15 : 0);
+ }
+
+ @Override
+ public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength) {
+ if (!getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this))
+ setOutputRedstoneSignal(aSide, aStrength);
+ }
+
+ @Override
+ public void setOutputRedstoneSignal(byte aSide, byte aStrength) {
+ aStrength = (byte) Math.min(Math.max(0, aStrength), 15);
+ if (aSide >= 0 && aSide < 6 && mSidedRedstone[aSide] != aStrength) {
+ mSidedRedstone[aSide] = aStrength;
+ issueBlockUpdate();
+ }
+ }
+
+ @Override
+ public boolean isSteamEngineUpgradable() {
+ return isUpgradable() && !hasSteamEngineUpgrade() && getSteamCapacity() > 0;
+ }
+
+ @Override
+ public boolean addSteamEngineUpgrade() {
+ if (isSteamEngineUpgradable()) {
+ issueBlockUpdate();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean hasSteamEngineUpgrade() {
+ return false;
+ }
+
+ @Override
+ public boolean hasInventoryBeenModified() {
+ return mInventoryChanged;
+ }
+
+ @Override
+ public void setGenericRedstoneOutput(boolean aOnOff) {
+ //
+ }
+
+ @Override
+ public int getErrorDisplayID() {
+ return 0;
+ }
+
+ @Override
+ public void setErrorDisplayID(int aErrorID) {
+ //
+ }
+
+ @Override
+ public IMetaTileEntity getMetaTileEntity() {
+ return hasValidMetaTileEntity() ? mMetaTileEntity : null;
+ }
+
+ @Override
+ public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity) {
+ mMetaTileEntity = (MetaPipeEntity) aMetaTileEntity;
+ }
+
+ @Override
+ public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide) {
+ return aSide >= 0 && aSide < mCoverBehaviors.length ? mCoverBehaviors[aSide] : GregTech_API.sNoBehavior;
+ }
+
+ @Override
+ public void setCoverIDAtSide(byte aSide, int aID) {
+ if (aSide >= 0 && aSide < 6) {
+ mCoverSides[aSide] = aID;
+ mCoverData[aSide] = 0;
+ mCoverBehaviors[aSide] = GregTech_API.getCoverBehavior(aID);
+ issueCoverUpdate(aSide);
+ issueBlockUpdate();
+ }
+ }
+
+ @Override
+ public void setCoverItemAtSide(byte aSide, ItemStack aCover) {
+ GregTech_API.getCoverBehavior(aCover).placeCover(aSide, aCover, this);
+ }
+
+ @Override
+ public int getCoverIDAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) return mCoverSides[aSide];
+ return 0;
+ }
+
+ @Override
+ public ItemStack getCoverItemAtSide(byte aSide) {
+ return GT_Utility.intToStack(getCoverIDAtSide(aSide));
+ }
+
+ @Override
+ public boolean canPlaceCoverIDAtSide(byte aSide, int aID) {
+ return getCoverIDAtSide(aSide) == 0;
+ }
+
+ @Override
+ public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover) {
+ return getCoverIDAtSide(aSide) == 0;
+ }
+
+ @Override
+ public void setCoverDataAtSide(byte aSide, int aData) {
+ if (aSide >= 0 && aSide < 6) mCoverData[aSide] = aData;
+ }
+
+ @Override
+ public int getCoverDataAtSide(byte aSide) {
+ if (aSide >= 0 && aSide < 6) return mCoverData[aSide];
+ return 0;
+ }
+
+ @Override
+ public void setLightValue(byte aLightValue) {
+ //
+ }
+
+ @Override
+ public long getAverageElectricInput() {
+ return 0;
+ }
+
+ @Override
+ public long getAverageElectricOutput() {
+ return 0;
+ }
+
+ @Override
+ public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced) {
+ if (getCoverBehaviorAtSide(aSide).onCoverRemoval(aSide, getCoverIDAtSide(aSide), mCoverData[aSide], this, aForced) || aForced) {
+ ItemStack tStack = getCoverBehaviorAtSide(aSide).getDrop(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this);
+ if (tStack != null) {
+ tStack.setTagCompound(null);
+ EntityItem tEntity = new EntityItem(worldObj, getOffsetX(aDroppedSide, 1) + 0.5, getOffsetY(aDroppedSide, 1) + 0.5, getOffsetZ(aDroppedSide, 1) + 0.5, tStack);
+ tEntity.motionX = 0;
+ tEntity.motionY = 0;
+ tEntity.motionZ = 0;
+ worldObj.spawnEntityInWorld(tEntity);
+ }
+
+ setCoverIDAtSide(aSide, 0);
+ setOutputRedstoneSignal(aSide, (byte) 0);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getOwnerName() {
+ return "Player";
+ }
+
+ @Override
+ public String setOwnerName(String aName) {
+ return "Player";
+ }
+
+ @Override
+ public UUID getOwnerUuid() {
+ return GT_Utility.defaultUuid;
+ }
+
+ @Override
+ public void setOwnerUuid(UUID uuid) {
+
+ }
+
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return canAccessData() ? mMetaTileEntity.getComparatorValue(aSide) : 0;
+ }
+
+ @Override
+ public byte getStrongOutputRedstoneSignal(byte aSide) {
+ return aSide >= 0 && aSide < 6 && (mStrongRedstone & (1 << aSide)) != 0 ? (byte) (mSidedRedstone[aSide] & 15) : 0;
+ }
+
+ @Override
+ public void setStrongOutputRedstoneSignal(byte aSide, byte aStrength) {
+ mStrongRedstone |= (1 << aSide);
+ setOutputRedstoneSignal(aSide, aStrength);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ if (canAccessData()) {
+ mInventoryChanged = true;
+ return mMetaTileEntity.decrStackSize(aIndex, aAmount);
+ }
+ return null;
+ }
+
+ @Override
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (canAccessData()) return mMetaTileEntity.injectEnergyUnits(aSide, aVoltage, aAmperage);
+ return 0;
+ }
+
+ @Override
+ public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ return false;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
+ return mMetaTileEntity.acceptsRotationalEnergy(aSide);
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ if (!canAccessData() || getCoverIDAtSide(aSide) != 0) return false;
+ return mMetaTileEntity.injectRotationalEnergy(aSide, aSpeed, aEnergy);
+ }
+
+ private boolean canMoveFluidOnSide(ForgeDirection aSide, Fluid aFluid, boolean isFill) {
+ if (aSide == ForgeDirection.UNKNOWN)
+ return true;
+
+ IFluidHandler tTileEntity = getITankContainerAtSide((byte) aSide.ordinal());
+ // Only require a connection if there's something to connect to - Allows fluid cells & buckets to interact with the pipe
+ if (tTileEntity != null && !mMetaTileEntity.isConnectedAtSide((byte) aSide.ordinal()))
+ return false;
+
+ if(isFill && mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), aFluid, this))
+ return true;
+
+ if (!isFill && mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()),aFluid, this))
+ return true;
+
+ return false;
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluidStack, boolean doFill) {
+ if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true))
+ return mMetaTileEntity.fill(aSide, aFluidStack, doFill);
+ return 0;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, mMetaTileEntity.getFluid() == null ? null : mMetaTileEntity.getFluid().getFluid(), false))
+ return mMetaTileEntity.drain(aSide, maxDrain, doDrain);
+ return null;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluidStack, boolean doDrain) {
+ if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false))
+ return mMetaTileEntity.drain(aSide, aFluidStack, doDrain);
+ return null;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluid, true))
+ return mMetaTileEntity.canFill(aSide, aFluid);
+ return false;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ if (mTickTimer > 5 && canAccessData() && canMoveFluidOnSide(aSide, aFluid, false))
+ return mMetaTileEntity.canDrain(aSide, aFluid);
+ return false;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (canAccessData()
+ && (aSide == ForgeDirection.UNKNOWN
+ || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal())
+ && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidIn((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))
+ || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && getCoverBehaviorAtSide((byte) aSide.ordinal()).letsFluidOut((byte) aSide.ordinal(), getCoverIDAtSide((byte) aSide.ordinal()), getCoverDataAtSide((byte) aSide.ordinal()), null, this))
+ // Doesn't need to be connected to get Tank Info -- otherwise things can't connect
+ )
+ )
+ return mMetaTileEntity.getTankInfo(aSide);
+ return new FluidTankInfo[]{};
+ }
+
+ @Override
+ public boolean isInvalidTileEntity() {
+ return isInvalid();
+ }
+
+ @Override
+ public boolean addStackToSlot(int aIndex, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return true;
+ if (aIndex < 0 || aIndex >= getSizeInventory()) return false;
+ ItemStack tStack = getStackInSlot(aIndex);
+ if (GT_Utility.isStackInvalid(tStack)) {
+ setInventorySlotContents(aIndex, aStack);
+ return true;
+ }
+ aStack = GT_OreDictUnificator.get(aStack);
+ if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) {
+ tStack.stackSize += aStack.stackSize;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount) {
+ return addStackToSlot(aIndex, GT_Utility.copyAmount(aAmount, aStack));
+ }
+
+ @Override
+ public byte getColorization() {
+ return (byte) (mColor - 1);
+ }
+
+ @Override
+ public byte setColorization(byte aColor) {
+ if (aColor > 15 || aColor < -1) aColor = -1;
+ mColor = (byte) (aColor + 1);
+ if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor);
+ return mColor;
+ }
+
+ @Override
+ public float getThickNess() {
+ if (canAccessData()) return mMetaTileEntity.getThickNess();
+ return 1.0F;
+ }
+
+ public boolean renderInside(byte aSide) {
+ if (canAccessData()) return mMetaTileEntity.renderInside(aSide);
+ return false;
+ }
+
+ @Override
+ public float getBlastResistance(byte aSide) {
+ return (mConnections & 192) != 0 ? 50.0F : 5.0F;
+ }
+
+ @Override
+ public boolean isMufflerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean addMufflerUpgrade() {
+ return false;
+ }
+
+ @Override
+ public boolean hasMufflerUpgrade() {
+ return false;
+ }
+
+ @Override
+ public boolean isUniversalEnergyStored(long aEnergyAmount) {
+ return getUniversalEnergyStored() >= aEnergyAmount;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ {
+ if (canAccessData()) return getMetaTileEntity().getInfoData();
+ return new String[]{};
+ }
+ }
+
+ @Override
+ public byte getConnections() {
+ return mConnections;
+ }
+
+ @Override
+ public void markDirty() {
+ super.markDirty();
+ mInventoryChanged = true;
+ }
+
+ public void onNeighborBlockChange(int aX, int aY, int aZ) {
+ if (canAccessData()) {
+ final IMetaTileEntity meta = getMetaTileEntity();
+ if (meta instanceof MetaPipeEntity) {
+ // Trigger a checking of connections in case someone placed down a block that the pipe/wire shouldn't be connected to.
+ // However; don't do it immediately in case the world isn't finished loading
+ // (This caused issues with AE2 GTEU p2p connections.
+ ((MetaPipeEntity) meta).setCheckConnections();
+ }
+ }
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return mMetaTileEntity == null ? 0 : mMetaTileEntity.getLightOpacity();
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return mMetaTileEntity.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
index 6b66b64fa0..6614cca210 100644
--- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java
@@ -1,843 +1,843 @@
-package gregtech.api.metatileentity;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IConnectable;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IColoredTileEntity;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-import static gregtech.api.enums.GT_Values.GT;
-import static gregtech.api.enums.GT_Values.V;
-
-/**
- * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
- * <p/>
- * Extend this Class to add a new MetaPipe
- * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!)
- * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity
- * <p/>
- * Call the Constructor like the following example inside the Load Phase, to register it.
- * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");"
- */
-public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
- /**
- * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
- */
- public final ItemStack[] mInventory;
- /**
- * This variable tells, which directions the Block is connected to. It is a Bitmask.
- */
- public byte mConnections = 0;
- protected boolean mCheckConnections = false;
- /**
- * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName.
- */
- public String mName;
- public boolean doTickProfilingInThisTick = true;
- /**
- * accessibility to this Field is no longer given, see below
- */
- private IGregTechTileEntity mBaseMetaTileEntity;
-
- /**
- * This registers your Machine at the List.
- * Use only ID's larger than 2048, because i reserved these ones.
- * See also the List in the API, as it has a Description containing all the reservations.
- *
- * @param aID the ID
- * @example for Constructor overload.
- * <p/>
- * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) {
- * super(aID, mName, mNameRegional);
- * }
- */
- public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- this(aID, aBasicName, aRegionalName, aInvSlotCount, true);
- }
-
- public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount, boolean aAddInfo) {
- if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted)
- throw new IllegalAccessError("This Constructor has to be called in the load Phase");
- if (GregTech_API.METATILEENTITIES[aID] == null) {
- GregTech_API.METATILEENTITIES[aID] = this;
- } else {
- throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
- }
- mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH);
- setBaseMetaTileEntity(new BaseMetaPipeEntity());
- getBaseMetaTileEntity().setMetaTileID((short) aID);
- GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
- mInventory = new ItemStack[aInvSlotCount];
-
- if (aAddInfo && GT.isClientSide()) {
- addInfo(aID);
- }
- }
-
- protected final void addInfo(int aID) {
- if(!GT.isClientSide()) return;
-
- ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
- tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
- }
-
- /**
- * This is the normal Constructor.
- */
- public MetaPipeEntity(String aName, int aInvSlotCount) {
- mInventory = new ItemStack[aInvSlotCount];
- mName = aName;
- }
-
- /**
- * For Pipe Rendering
- */
- public abstract float getThickNess();
-
- /**
- * For Pipe Rendering
- */
- public abstract boolean renderInside(byte aSide);
-
- @Override
- public IGregTechTileEntity getBaseMetaTileEntity() {
- return mBaseMetaTileEntity;
- }
-
- @Override
- public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
- if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
- mBaseMetaTileEntity.getMetaTileEntity().inValidate();
- mBaseMetaTileEntity.setMetaTileEntity(null);
- }
- mBaseMetaTileEntity = aBaseMetaTileEntity;
- if (mBaseMetaTileEntity != null) {
- mBaseMetaTileEntity.setMetaTileEntity(this);
- }
- }
-
- @Override
- public ItemStack getStackForm(long aAmount) {
- return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
- }
-
- public boolean isCoverOnSide(BaseMetaPipeEntity aPipe, EntityLivingBase aEntity) {
- byte aSide = 6;
- double difference = aEntity.posY - (double) aPipe.yCoord;
- if (difference > 0.6 && difference < 0.99) {
- aSide = 1;
- }
- if (difference < -1.5 && difference > -1.99) {
- aSide = 0;
- }
- difference = aEntity.posZ - (double) aPipe.zCoord;
- if (difference < -0.05 && difference > -0.4) {
- aSide = 2;
- }
- if (difference > 1.05 && difference < 1.4) {
- aSide = 3;
- }
- difference = aEntity.posX - (double) aPipe.xCoord;
- if (difference < -0.05 && difference > -0.4) {
- aSide = 4;
- }
- if (difference > 1.05 && difference < 1.4) {
- aSide = 5;
- }
- boolean tCovered = false;
- if (aSide < 6 && mBaseMetaTileEntity.getCoverIDAtSide(aSide) > 0) {
- tCovered = true;
- }
- if(isConnectedAtSide(aSide)){
- tCovered = true;
- }
- //GT_FML_LOGGER.info("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide));
- //toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos)
- return tCovered;
- }
-
- @Override
- public void onServerStart() {/*Do nothing*/}
-
- @Override
- public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
-
- @Override
- public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
-
- @Override
- public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
-
- @Override
- public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
-
- @Override
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
- return true;
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/}
-
- @Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return false;
- }
-
- @Override
- public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return false;
- }
-
- @Override
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- return false;
- }
-
- @Override
- public void onExplosion() {/*Do nothing*/}
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
-
- @Override
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
-
- @Override
- public void inValidate() {/*Do nothing*/}
-
- @Override
- public void onRemoval() {/*Do nothing*/}
-
- @Override
- public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
-
- /**
- * When a GUI is opened
- */
- public void onOpenGUI() {/*Do nothing*/}
-
- /**
- * When a GUI is closed
- */
- public void onCloseGUI() {/*Do nothing*/}
-
- /**
- * a Player rightclicks the Machine
- * Sneaky rightclicks are not getting passed to this!
- */
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
- return false;
- }
-
- @Override
- public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
-
- @Override
- public void onValueUpdate(byte aValue) {/*Do nothing*/}
-
- @Override
- public byte getUpdateData() {
- return 0;
- }
-
- @Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
-
- @Override
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
-
- @Override
- public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
-
- @Override
- public final void sendSound(byte aIndex) {
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
- }
-
- @Override
- public final void sendLoopStart(byte aIndex) {
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
- }
-
- @Override
- public final void sendLoopEnd(byte aIndex) {
- if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public boolean setStackToZeroInsteadOfNull(int aIndex) {
- return false;
- }
-
- @Override
- public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
- return aList;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return false;
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- return false;
- }
-
- /**
- * gets the contained Liquid
- */
- @Override
- public FluidStack getFluid() {
- return null;
- }
-
- /**
- * tries to fill this Tank
- */
- @Override
- public int fill(FluidStack resource, boolean doFill) {
- return 0;
- }
-
- /**
- * tries to empty this Tank
- */
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- return null;
- }
-
- /**
- * Tank pressure
- */
- public int getTankPressure() {
- return 0;
- }
-
- /**
- * Liquid Capacity
- */
- @Override
- public int getCapacity() {
- return 0;
- }
-
- /**
- * Progress this machine has already made
- */
- public int getProgresstime() {
- return 0;
- }
-
- /**
- * Progress this Machine has to do to produce something
- */
- public int maxProgresstime() {
- return 0;
- }
-
- /**
- * Increases the Progress, returns the overflown Progress.
- */
- public int increaseProgress(int aProgress) {
- return 0;
- }
-
- @Override
- public void onMachineBlockUpdate() {/*Do nothing*/}
-
- @Override
- public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public byte getComparatorValue(byte aSide) {
- return 0;
- }
-
- @Override
- public boolean acceptsRotationalEnergy(byte aSide) {
- return false;
- }
-
- @Override
- public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
- return false;
- }
-
- @Override
- public String getSpecialVoltageToolTip() {
- return null;
- }
-
- @Override
- public boolean isGivingInformation() {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{};
- }
-
- public boolean isDigitalChest() {
- return false;
- }
-
- public ItemStack[] getStoredItemData() {
- return null;
- }
-
- public void setItemCount(int aCount) {/*Do nothing*/}
-
- public int getMaxItemCount() {
- return 0;
- }
-
- @Override
- public int getSizeInventory() {
- return mInventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(int aIndex) {
- if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex];
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int aIndex, ItemStack aStack) {
- if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
- }
-
- @Override
- public String getInventoryName() {
- if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null)
- return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName();
- return "";
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
- return getBaseMetaTileEntity().isValidSlot(aIndex);
- }
-
- @Override
- public ItemStack decrStackSize(int aIndex, int aAmount) {
- ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack);
- if (tStack != null) {
- if (tStack.stackSize <= aAmount) {
- if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0;
- else setInventorySlotContents(aIndex, null);
- } else {
- rStack = tStack.splitStack(aAmount);
- if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex))
- setInventorySlotContents(aIndex, null);
- }
- }
- return rStack;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int aSide) {
- ArrayList<Integer> tList = new ArrayList<Integer>();
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
- boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity);
- for (int i = 0; i < getSizeInventory(); i++)
- if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity)))
- tList.add(i);
- int[] rArray = new int[tList.size()];
- for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i);
- return rArray;
- }
-
- @Override
- public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
- return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
- return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
- }
-
- @Override
- public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
- return fill(aSide, new FluidStack(aFluid, 1), false) == 1;
- }
-
- @Override
- public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
- return drain(aSide, new FluidStack(aFluid, 1), false) != null;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
- return new FluidTankInfo[]{getInfo()};
- }
-
- public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return fill(aFluid, doFill);
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- return fill_default(aSide, aFluid, doFill);
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
- if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid))
- return drain(aFluid.amount, doDrain);
- return null;
- }
-
- @Override
- public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
- return drain(maxDrain, doDrain);
- }
-
- @Override
- public int getFluidAmount() {
- return 0;
- }
-
- @Override
- public FluidTankInfo getInfo() {
- return new FluidTankInfo(this);
- }
-
- @Override
- public String getMetaName() {
- return mName;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int i) {
- return null;
- }
-
- @Override
- public boolean doTickProfilingMessageDuringThisTick() {
- return doTickProfilingInThisTick;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer entityplayer) {
- return false;
- }
-
- @Override
- public boolean connectsToItemPipe(byte aSide) {
- return false;
- }
-
- @Override
- public void openInventory() {
- //
- }
-
- @Override
- public void closeInventory() {
- //
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return null;
- }
-
- @Override
- public float getExplosionResistance(byte aSide) {
- return 10.0F;
- }
-
- @Override
- public ItemStack[] getRealInventory() {
- return mInventory;
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return false;
- }
-
- @Override
- public void markDirty() {
- //
- }
-
- @Override
- public void onColorChangeServer(byte aColor) {
- setCheckConnections();
- }
-
- @Override
- public void onColorChangeClient(byte aColor) {
- // Do nothing apparently
- }
-
- public void setCheckConnections() {
- mCheckConnections = true;
- }
-
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- return 0;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
- return false;
- }
-
- @Override
- public void doExplosion(long aExplosionPower) {
- float tStrength =
- aExplosionPower < V[0] ? 1.0F :
- aExplosionPower < V[1] ? 2.0F :
- aExplosionPower < V[2] ? 3.0F :
- aExplosionPower < V[3] ? 4.0F :
- aExplosionPower < V[4] ? 5.0F :
- aExplosionPower < V[4] * 2 ? 6.0F :
- aExplosionPower < V[5] ? 7.0F :
- aExplosionPower < V[6] ? 8.0F :
- aExplosionPower < V[7] ? 9.0F :
- aExplosionPower < V[8] ? 10.0F :
- aExplosionPower < V[8] * 2 ? 11.0F :
- aExplosionPower < V[9] ? 12.0F :
- aExplosionPower < V[10] ? 13.0F :
- aExplosionPower < V[11] ? 14.0F :
- aExplosionPower < V[12] ? 15.0F :
- aExplosionPower < V[12] * 2 ? 16.0F :
- aExplosionPower < V[13] ? 17.0F :
- aExplosionPower < V[14] ? 18.0F :
- aExplosionPower < V[15] ? 19.0F : 20.0F;
- int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
- World tWorld = getBaseMetaTileEntity().getWorld();
- tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions)
- tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
- }
-
- @Override
- public int getLightOpacity() {
- return 0;
- }
-
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
- //
- }
-
- @Override
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- //
- }
-
- @Override
- public boolean allowGeneralRedstoneOutput(){
- return false;
- }
-
- @Override
- public boolean hasAlternativeModeText() {
- return false;
- }
-
- @Override
- public String getAlternativeModeText() {
- return "";
- }
-
- public String trans(String aKey, String aEnglish){
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
- }
-
- private boolean connectableColor(TileEntity tTileEntity) {
- // Determine if two entities are connectable based on their colorization:
- // Uncolored can connect to anything
- // If both are colored they must be the same color to connect.
- if (tTileEntity instanceof IColoredTileEntity) {
- if (getBaseMetaTileEntity().getColorization() >= 0) {
- byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
- if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) return false;
- }
- }
-
- return true;
- }
-
- @Override
- public int connect(byte aSide) {
- if (aSide >= 6) return 0;
-
- final byte tSide = GT_Utility.getOppositeSide(aSide);
- final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- if (baseMetaTile == null || !baseMetaTile.isServerSide()) return 0;
-
- final GT_CoverBehavior coverBehavior = baseMetaTile.getCoverBehaviorAtSide(aSide);
- final int coverId = baseMetaTile.getCoverIDAtSide(aSide),
- coverData = baseMetaTile.getCoverDataAtSide(aSide);
-
- boolean alwaysLookConnected = coverBehavior.alwaysLookConnected(aSide, coverId, coverData, baseMetaTile);
- boolean letsIn = letsIn(coverBehavior, aSide, coverId, coverData, baseMetaTile);
- boolean letsOut = letsOut(coverBehavior, aSide, coverId, coverData, baseMetaTile);
-
- // Careful - tTileEntity might be null, and that's ok -- so handle it
- TileEntity tTileEntity = baseMetaTile.getTileEntityAtSide(aSide);
- if (!connectableColor(tTileEntity)) return 0;
-
- if ((alwaysLookConnected || letsIn || letsOut)) {
- // Are we trying to connect to a pipe? let's do it!
- IMetaTileEntity tPipe = tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() : null;
- if (getClass().isInstance(tPipe) || (tPipe != null && tPipe.getClass().isInstance(this))) {
- connectAtSide(aSide);
- if (!((MetaPipeEntity) tPipe).isConnectedAtSide(tSide)) {
- // Make sure pipes all get together -- connect back to us if we're connecting to a pipe
- ((MetaPipeEntity) tPipe).connect(tSide);
- }
- return 1;
- }
- else if((getGT6StyleConnection() && baseMetaTile.getAirAtSide(aSide)) || canConnect(aSide, tTileEntity)) {
- // Allow open connections to Air, if the GT6 style pipe/cables are enabled, so that it'll connect to the next block placed down next to it
- connectAtSide(aSide);
- return 1;
- }
- if (!baseMetaTile.getWorld().getChunkProvider().chunkExists(baseMetaTile.getOffsetX(aSide, 1) >> 4, baseMetaTile.getOffsetZ(aSide, 1) >> 4)) {
- // Target chunk unloaded
- return -1;
- }
-
- }
- return 0;
- }
-
- protected void checkConnections() {
- // Verify connections around us. If GT6 style cables are not enabled then revert to old behavior and try
- // connecting to everything around us
- for (byte aSide = 0; aSide < 6; aSide++) {
- if ((!getGT6StyleConnection() || isConnectedAtSide(aSide)) && connect(aSide) == 0) {
- disconnect(aSide);
- }
- }
- mCheckConnections = false;
- }
-
- private void connectAtSide(byte aSide) {
- mConnections |= (1 << aSide);
- }
-
- @Override
- public void disconnect(byte aSide) {
- if (aSide >= 6) return;
- mConnections &= ~(1 << aSide);
- byte tSide = GT_Utility.getOppositeSide(aSide);
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide);
- IMetaTileEntity tPipe = tTileEntity == null ? null : tTileEntity.getMetaTileEntity();
- if ((this.getClass().isInstance(tPipe) || (tPipe != null && tPipe.getClass().isInstance(this))) && ((MetaPipeEntity) tPipe).isConnectedAtSide(tSide))
- ((MetaPipeEntity) tPipe).disconnect(tSide);
- }
-
- public boolean isConnectedAtSide(int aSide) {
- return (mConnections & (1 << aSide)) != 0;
- }
-
-
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; }
- public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; }
-
- public boolean canConnect(byte aSide, TileEntity tTileEntity) { return false; }
- public boolean getGT6StyleConnection() { return false; }
-
- public boolean shouldJoinIc2Enet() { return false; }
-
-}
+package gregtech.api.metatileentity;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IConnectable;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IColoredTileEntity;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * Extend this Class to add a new MetaPipe
+ * Call the Constructor with the desired ID at the load-phase (not preload and also not postload!)
+ * Implement the newMetaEntity-Method to return a new ready instance of your MetaTileEntity
+ * <p/>
+ * Call the Constructor like the following example inside the Load Phase, to register it.
+ * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");"
+ */
+public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable {
+ /**
+ * The Inventory of the MetaTileEntity. Amount of Slots can be larger than 256. HAYO!
+ */
+ public final ItemStack[] mInventory;
+ /**
+ * This variable tells, which directions the Block is connected to. It is a Bitmask.
+ */
+ public byte mConnections = 0;
+ protected boolean mCheckConnections = false;
+ /**
+ * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName.
+ */
+ public String mName;
+ public boolean doTickProfilingInThisTick = true;
+ /**
+ * accessibility to this Field is no longer given, see below
+ */
+ private IGregTechTileEntity mBaseMetaTileEntity;
+
+ /**
+ * This registers your Machine at the List.
+ * Use only ID's larger than 2048, because i reserved these ones.
+ * See also the List in the API, as it has a Description containing all the reservations.
+ *
+ * @param aID the ID
+ * @example for Constructor overload.
+ * <p/>
+ * public GT_MetaTileEntity_EBench(int aID, String mName, String mNameRegional) {
+ * super(aID, mName, mNameRegional);
+ * }
+ */
+ public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ this(aID, aBasicName, aRegionalName, aInvSlotCount, true);
+ }
+
+ public MetaPipeEntity(int aID, String aBasicName, String aRegionalName, int aInvSlotCount, boolean aAddInfo) {
+ if (GregTech_API.sPostloadStarted || !GregTech_API.sPreloadStarted)
+ throw new IllegalAccessError("This Constructor has to be called in the load Phase");
+ if (GregTech_API.METATILEENTITIES[aID] == null) {
+ GregTech_API.METATILEENTITIES[aID] = this;
+ } else {
+ throw new IllegalArgumentException("MetaMachine-Slot Nr. " + aID + " is already occupied!");
+ }
+ mName = aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH);
+ setBaseMetaTileEntity(new BaseMetaPipeEntity());
+ getBaseMetaTileEntity().setMetaTileID((short) aID);
+ GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName);
+ mInventory = new ItemStack[aInvSlotCount];
+
+ if (aAddInfo && GT.isClientSide()) {
+ addInfo(aID);
+ }
+ }
+
+ protected final void addInfo(int aID) {
+ if(!GT.isClientSide()) return;
+
+ ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID);
+ tStack.getItem().addInformation(tStack, null, new ArrayList<String>(), true);
+ }
+
+ /**
+ * This is the normal Constructor.
+ */
+ public MetaPipeEntity(String aName, int aInvSlotCount) {
+ mInventory = new ItemStack[aInvSlotCount];
+ mName = aName;
+ }
+
+ /**
+ * For Pipe Rendering
+ */
+ public abstract float getThickNess();
+
+ /**
+ * For Pipe Rendering
+ */
+ public abstract boolean renderInside(byte aSide);
+
+ @Override
+ public IGregTechTileEntity getBaseMetaTileEntity() {
+ return mBaseMetaTileEntity;
+ }
+
+ @Override
+ public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) {
+ if (mBaseMetaTileEntity != null && aBaseMetaTileEntity == null) {
+ mBaseMetaTileEntity.getMetaTileEntity().inValidate();
+ mBaseMetaTileEntity.setMetaTileEntity(null);
+ }
+ mBaseMetaTileEntity = aBaseMetaTileEntity;
+ if (mBaseMetaTileEntity != null) {
+ mBaseMetaTileEntity.setMetaTileEntity(this);
+ }
+ }
+
+ @Override
+ public ItemStack getStackForm(long aAmount) {
+ return new ItemStack(GregTech_API.sBlockMachines, (int) aAmount, getBaseMetaTileEntity().getMetaTileID());
+ }
+
+ public boolean isCoverOnSide(BaseMetaPipeEntity aPipe, EntityLivingBase aEntity) {
+ byte aSide = 6;
+ double difference = aEntity.posY - (double) aPipe.yCoord;
+ if (difference > 0.6 && difference < 0.99) {
+ aSide = 1;
+ }
+ if (difference < -1.5 && difference > -1.99) {
+ aSide = 0;
+ }
+ difference = aEntity.posZ - (double) aPipe.zCoord;
+ if (difference < -0.05 && difference > -0.4) {
+ aSide = 2;
+ }
+ if (difference > 1.05 && difference < 1.4) {
+ aSide = 3;
+ }
+ difference = aEntity.posX - (double) aPipe.xCoord;
+ if (difference < -0.05 && difference > -0.4) {
+ aSide = 4;
+ }
+ if (difference > 1.05 && difference < 1.4) {
+ aSide = 5;
+ }
+ boolean tCovered = false;
+ if (aSide < 6 && mBaseMetaTileEntity.getCoverIDAtSide(aSide) > 0) {
+ tCovered = true;
+ }
+ if(isConnectedAtSide(aSide)){
+ tCovered = true;
+ }
+ //GT_FML_LOGGER.info("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide));
+ //toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos)
+ return tCovered;
+ }
+
+ @Override
+ public void onServerStart() {/*Do nothing*/}
+
+ @Override
+ public void onWorldSave(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onWorldLoad(File aSaveDirectory) {/*Do nothing*/}
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {/*Do nothing*/}
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aBlockIconRegister) {/*Do nothing*/}
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {/*Do nothing*/}
+
+ @Override
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ @Override
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ @Override
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ @Override
+ public void onExplosion() {/*Do nothing*/}
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {/*Do nothing*/}
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {/*Do nothing*/}
+
+ @Override
+ public void inValidate() {/*Do nothing*/}
+
+ @Override
+ public void onRemoval() {/*Do nothing*/}
+
+ @Override
+ public void initDefaultModes(NBTTagCompound aNBT) {/*Do nothing*/}
+
+ /**
+ * When a GUI is opened
+ */
+ public void onOpenGUI() {/*Do nothing*/}
+
+ /**
+ * When a GUI is closed
+ */
+ public void onCloseGUI() {/*Do nothing*/}
+
+ /**
+ * a Player rightclicks the Machine
+ * Sneaky rightclicks are not getting passed to this!
+ */
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ return false;
+ }
+
+ @Override
+ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {/*Do nothing*/}
+
+ @Override
+ public void onValueUpdate(byte aValue) {/*Do nothing*/}
+
+ @Override
+ public byte getUpdateData() {
+ return 0;
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public void stopSoundLoop(byte aValue, double aX, double aY, double aZ) {/*Do nothing*/}
+
+ @Override
+ public final void sendSound(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 4, aIndex);
+ }
+
+ @Override
+ public final void sendLoopStart(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 5, aIndex);
+ }
+
+ @Override
+ public final void sendLoopEnd(byte aIndex) {
+ if (!getBaseMetaTileEntity().hasMufflerUpgrade()) getBaseMetaTileEntity().sendBlockEvent((byte) 6, aIndex);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public boolean setStackToZeroInsteadOfNull(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
+ return aList;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return false;
+ }
+
+ /**
+ * gets the contained Liquid
+ */
+ @Override
+ public FluidStack getFluid() {
+ return null;
+ }
+
+ /**
+ * tries to fill this Tank
+ */
+ @Override
+ public int fill(FluidStack resource, boolean doFill) {
+ return 0;
+ }
+
+ /**
+ * tries to empty this Tank
+ */
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return null;
+ }
+
+ /**
+ * Tank pressure
+ */
+ public int getTankPressure() {
+ return 0;
+ }
+
+ /**
+ * Liquid Capacity
+ */
+ @Override
+ public int getCapacity() {
+ return 0;
+ }
+
+ /**
+ * Progress this machine has already made
+ */
+ public int getProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Progress this Machine has to do to produce something
+ */
+ public int maxProgresstime() {
+ return 0;
+ }
+
+ /**
+ * Increases the Progress, returns the overflown Progress.
+ */
+ public int increaseProgress(int aProgress) {
+ return 0;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {/*Do nothing*/}
+
+ @Override
+ public void receiveClientEvent(byte aEventID, byte aValue) {/*Do nothing*/}
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public byte getComparatorValue(byte aSide) {
+ return 0;
+ }
+
+ @Override
+ public boolean acceptsRotationalEnergy(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy) {
+ return false;
+ }
+
+ @Override
+ public String getSpecialVoltageToolTip() {
+ return null;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{};
+ }
+
+ public boolean isDigitalChest() {
+ return false;
+ }
+
+ public ItemStack[] getStoredItemData() {
+ return null;
+ }
+
+ public void setItemCount(int aCount) {/*Do nothing*/}
+
+ public int getMaxItemCount() {
+ return 0;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return mInventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex) {
+ if (aIndex >= 0 && aIndex < mInventory.length) return mInventory[aIndex];
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack) {
+ if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack;
+ }
+
+ @Override
+ public String getInventoryName() {
+ if (GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()] != null)
+ return GregTech_API.METATILEENTITIES[getBaseMetaTileEntity().getMetaTileID()].getMetaName();
+ return "";
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 64;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ return getBaseMetaTileEntity().isValidSlot(aIndex);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount) {
+ ItemStack tStack = getStackInSlot(aIndex), rStack = GT_Utility.copy(tStack);
+ if (tStack != null) {
+ if (tStack.stackSize <= aAmount) {
+ if (setStackToZeroInsteadOfNull(aIndex)) tStack.stackSize = 0;
+ else setInventorySlotContents(aIndex, null);
+ } else {
+ rStack = tStack.splitStack(aAmount);
+ if (tStack.stackSize == 0 && !setStackToZeroInsteadOfNull(aIndex))
+ setInventorySlotContents(aIndex, null);
+ }
+ }
+ return rStack;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ ArrayList<Integer> tList = new ArrayList<Integer>();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity();
+ boolean tSkip = tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), -2, tTileEntity);
+ for (int i = 0; i < getSizeInventory(); i++)
+ if (isValidSlot(i) && (tSkip || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsOut((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity) || tTileEntity.getCoverBehaviorAtSide((byte) aSide).letsItemsIn((byte) aSide, tTileEntity.getCoverIDAtSide((byte) aSide), tTileEntity.getCoverDataAtSide((byte) aSide), i, tTileEntity)))
+ tList.add(i);
+ int[] rArray = new int[tList.size()];
+ for (int i = 0; i < rArray.length; i++) rArray[i] = tList.get(i);
+ return rArray;
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && (mInventory[aIndex] == null || GT_Utility.areStacksEqual(aStack, mInventory[aIndex])) && allowPutStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ return isValidSlot(aIndex) && aStack != null && aIndex < mInventory.length && allowPullStack(getBaseMetaTileEntity(), aIndex, (byte) aSide, aStack);
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ return fill(aSide, new FluidStack(aFluid, 1), false) == 1;
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ return drain(aSide, new FluidStack(aFluid, 1), false) != null;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ return new FluidTankInfo[]{getInfo()};
+ }
+
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill(aFluid, doFill);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ return fill_default(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) {
+ if (getFluid() != null && aFluid != null && getFluid().isFluidEqual(aFluid))
+ return drain(aFluid.amount, doDrain);
+ return null;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) {
+ return drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return 0;
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ return new FluidTankInfo(this);
+ }
+
+ @Override
+ public String getMetaName() {
+ return mName;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int i) {
+ return null;
+ }
+
+ @Override
+ public boolean doTickProfilingMessageDuringThisTick() {
+ return doTickProfilingInThisTick;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ return false;
+ }
+
+ @Override
+ public boolean connectsToItemPipe(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {
+ //
+ }
+
+ @Override
+ public void closeInventory() {
+ //
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public float getExplosionResistance(byte aSide) {
+ return 10.0F;
+ }
+
+ @Override
+ public ItemStack[] getRealInventory() {
+ return mInventory;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public void markDirty() {
+ //
+ }
+
+ @Override
+ public void onColorChangeServer(byte aColor) {
+ setCheckConnections();
+ }
+
+ @Override
+ public void onColorChangeClient(byte aColor) {
+ // Do nothing apparently
+ }
+
+ public void setCheckConnections() {
+ mCheckConnections = true;
+ }
+
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ return 0;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInInventory(Block aBlock, int aMeta, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ return false;
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ float tStrength =
+ aExplosionPower < V[0] ? 1.0F :
+ aExplosionPower < V[1] ? 2.0F :
+ aExplosionPower < V[2] ? 3.0F :
+ aExplosionPower < V[3] ? 4.0F :
+ aExplosionPower < V[4] ? 5.0F :
+ aExplosionPower < V[4] * 2 ? 6.0F :
+ aExplosionPower < V[5] ? 7.0F :
+ aExplosionPower < V[6] ? 8.0F :
+ aExplosionPower < V[7] ? 9.0F :
+ aExplosionPower < V[8] ? 10.0F :
+ aExplosionPower < V[8] * 2 ? 11.0F :
+ aExplosionPower < V[9] ? 12.0F :
+ aExplosionPower < V[10] ? 13.0F :
+ aExplosionPower < V[11] ? 14.0F :
+ aExplosionPower < V[12] ? 15.0F :
+ aExplosionPower < V[12] * 2 ? 16.0F :
+ aExplosionPower < V[13] ? 17.0F :
+ aExplosionPower < V[14] ? 18.0F :
+ aExplosionPower < V[15] ? 19.0F : 20.0F;
+ int tX = getBaseMetaTileEntity().getXCoord(), tY = getBaseMetaTileEntity().getYCoord(), tZ = getBaseMetaTileEntity().getZCoord();
+ World tWorld = getBaseMetaTileEntity().getWorld();
+ tWorld.setBlock(tX, tY, tZ, Blocks.air);
+ if (GregTech_API.sMachineExplosions)
+ tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
+ }
+
+ @Override
+ public int getLightOpacity() {
+ return 0;
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ AxisAlignedBB axisalignedbb1 = getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (axisalignedbb1 != null && inputAABB.intersectsWith(axisalignedbb1)) outputAABB.add(axisalignedbb1);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ //
+ }
+
+ @Override
+ public boolean allowGeneralRedstoneOutput(){
+ return false;
+ }
+
+ @Override
+ public boolean hasAlternativeModeText() {
+ return false;
+ }
+
+ @Override
+ public String getAlternativeModeText() {
+ return "";
+ }
+
+ public String trans(String aKey, String aEnglish){
+ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false);
+ }
+
+ private boolean connectableColor(TileEntity tTileEntity) {
+ // Determine if two entities are connectable based on their colorization:
+ // Uncolored can connect to anything
+ // If both are colored they must be the same color to connect.
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) return false;
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public int connect(byte aSide) {
+ if (aSide >= 6) return 0;
+
+ final byte tSide = GT_Utility.getOppositeSide(aSide);
+ final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
+ if (baseMetaTile == null || !baseMetaTile.isServerSide()) return 0;
+
+ final GT_CoverBehavior coverBehavior = baseMetaTile.getCoverBehaviorAtSide(aSide);
+ final int coverId = baseMetaTile.getCoverIDAtSide(aSide),
+ coverData = baseMetaTile.getCoverDataAtSide(aSide);
+
+ boolean alwaysLookConnected = coverBehavior.alwaysLookConnected(aSide, coverId, coverData, baseMetaTile);
+ boolean letsIn = letsIn(coverBehavior, aSide, coverId, coverData, baseMetaTile);
+ boolean letsOut = letsOut(coverBehavior, aSide, coverId, coverData, baseMetaTile);
+
+ // Careful - tTileEntity might be null, and that's ok -- so handle it
+ TileEntity tTileEntity = baseMetaTile.getTileEntityAtSide(aSide);
+ if (!connectableColor(tTileEntity)) return 0;
+
+ if ((alwaysLookConnected || letsIn || letsOut)) {
+ // Are we trying to connect to a pipe? let's do it!
+ IMetaTileEntity tPipe = tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() : null;
+ if (getClass().isInstance(tPipe) || (tPipe != null && tPipe.getClass().isInstance(this))) {
+ connectAtSide(aSide);
+ if (!((MetaPipeEntity) tPipe).isConnectedAtSide(tSide)) {
+ // Make sure pipes all get together -- connect back to us if we're connecting to a pipe
+ ((MetaPipeEntity) tPipe).connect(tSide);
+ }
+ return 1;
+ }
+ else if((getGT6StyleConnection() && baseMetaTile.getAirAtSide(aSide)) || canConnect(aSide, tTileEntity)) {
+ // Allow open connections to Air, if the GT6 style pipe/cables are enabled, so that it'll connect to the next block placed down next to it
+ connectAtSide(aSide);
+ return 1;
+ }
+ if (!baseMetaTile.getWorld().getChunkProvider().chunkExists(baseMetaTile.getOffsetX(aSide, 1) >> 4, baseMetaTile.getOffsetZ(aSide, 1) >> 4)) {
+ // Target chunk unloaded
+ return -1;
+ }
+
+ }
+ return 0;
+ }
+
+ protected void checkConnections() {
+ // Verify connections around us. If GT6 style cables are not enabled then revert to old behavior and try
+ // connecting to everything around us
+ for (byte aSide = 0; aSide < 6; aSide++) {
+ if ((!getGT6StyleConnection() || isConnectedAtSide(aSide)) && connect(aSide) == 0) {
+ disconnect(aSide);
+ }
+ }
+ mCheckConnections = false;
+ }
+
+ private void connectAtSide(byte aSide) {
+ mConnections |= (1 << aSide);
+ }
+
+ @Override
+ public void disconnect(byte aSide) {
+ if (aSide >= 6) return;
+ mConnections &= ~(1 << aSide);
+ byte tSide = GT_Utility.getOppositeSide(aSide);
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide);
+ IMetaTileEntity tPipe = tTileEntity == null ? null : tTileEntity.getMetaTileEntity();
+ if ((this.getClass().isInstance(tPipe) || (tPipe != null && tPipe.getClass().isInstance(this))) && ((MetaPipeEntity) tPipe).isConnectedAtSide(tSide))
+ ((MetaPipeEntity) tPipe).disconnect(tSide);
+ }
+
+ public boolean isConnectedAtSide(int aSide) {
+ return (mConnections & (1 << aSide)) != 0;
+ }
+
+
+ public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; }
+ public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return false; }
+
+ public boolean canConnect(byte aSide, TileEntity tTileEntity) { return false; }
+ public boolean getGT6StyleConnection() { return false; }
+
+ public boolean shouldJoinIc2Enet() { return false; }
+
+}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
index c55e346546..3373b142c4 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
@@ -1,596 +1,596 @@
-package gregtech.api.metatileentity.implementations;
-
-import cofh.api.energy.IEnergyReceiver;
-import com.google.common.collect.Sets;
-import cpw.mods.fml.common.Loader;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.TextureSet;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IEnergyConnected;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_GC_Compat;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_Client;
-import gregtech.common.covers.GT_Cover_SolarPanel;
-import gregtech.loaders.postload.PartP2PGTPower;
-import ic2.api.energy.EnergyNet;
-import ic2.api.energy.tile.IEnergyEmitter;
-import ic2.api.energy.tile.IEnergySink;
-import ic2.api.energy.tile.IEnergySource;
-import ic2.api.energy.tile.IEnergyTile;
-import ic2.api.reactor.IReactorChamber;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import appeng.api.parts.IPartHost;
-
-import static gregtech.api.enums.GT_Values.VN;
-
-public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
- public final float mThickNess;
- public final Materials mMaterial;
- public final long mCableLossPerMeter, mAmperage, mVoltage;
- public final boolean mInsulated, mCanShock;
- public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,mTransferredAmperageLast20OK=0,mTransferredAmperageOK=0;
- public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0,mTransferredVoltageLast20OK=0,mTransferredVoltageOK=0;
- public long mRestRF;
- public int mOverheat;
- public static short mMaxOverheat=(short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
-
- private int[] lastAmperage;
- private long lastWorldTick;
-
- public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
- super(aID, aName, aNameRegional, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mAmperage = aAmperage;
- mVoltage = aVoltage;
- mInsulated = aInsulated;
- mCanShock = aCanShock;
- mCableLossPerMeter = aCableLossPerMeter;
- }
-
- public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
- super(aName, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mAmperage = aAmperage;
- mVoltage = aVoltage;
- mInsulated = aInsulated;
- mCanShock = aCanShock;
- mCableLossPerMeter = aCableLossPerMeter;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return (byte) (mInsulated ? 9 : 8);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- if (!mInsulated)
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
- if (aConnected) {
- float tThickNess = getThickNess();
- if (tThickNess < 0.124F)
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.374F)//0.375 x1
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.499F)//0.500 x2
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.624F)//0.625 x4
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.749F)//0.750 x8
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- if (tThickNess < 0.874F)//0.825 x12
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- }
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return true;
- }
-
- @Override
- public final boolean renderInside(byte aSide) {
- return false;
- }
-
- @Override
- public int getProgresstime() {
- return (int) mTransferredAmperage * 64;
- }
-
- @Override
- public int maxProgresstime() {
- return (int) mAmperage * 64;
- }
-
- @Override
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (!isConnectedAtSide(aSide) && aSide != 6)
- return 0;
- if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()))
- return 0;
- return transferElectricity(aSide, aVoltage, aAmperage, Sets.newHashSet((TileEntity) getBaseMetaTileEntity()));
- }
-
- @Override
- @Deprecated
- public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
- return transferElectricity(aSide, aVoltage, aAmperage, new HashSet<>(aAlreadyPassedTileEntityList));
- }
-
- @Override
- public long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet<TileEntity> aAlreadyPassedSet) {
- if (!isConnectedAtSide(aSide) && aSide != 6) return 0;
-
- long rUsedAmperes = 0;
- final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- byte i = (byte)((((aSide/2)*2)+2)%6); //this bit of trickery makes sure a direction goes to the next cardinal pair. IE, NS goes to E, EW goes to U, UD goes to N. It's a lame way to make sure locally connected machines on a wire get EU first.
- aVoltage -= mCableLossPerMeter;
-
- if (aVoltage > 0) for (byte j = 0; j < 6 && aAmperage > rUsedAmperes; j++, i=(byte)((i+1)%6) )
- if (i != aSide && isConnectedAtSide(i) && baseMetaTile.getCoverBehaviorAtSide(i).letsEnergyOut(i, baseMetaTile.getCoverIDAtSide(i), baseMetaTile.getCoverDataAtSide(i), baseMetaTile)) {
- final TileEntity tTileEntity = baseMetaTile.getTileEntityAtSide(i);
-
- if (tTileEntity != null && aAlreadyPassedSet.add(tTileEntity)) {
- final byte tSide = GT_Utility.getOppositeSide(i);
- final IGregTechTileEntity tBaseMetaTile = tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity) : null;
- final IMetaTileEntity tMeta = tBaseMetaTile != null ? tBaseMetaTile.getMetaTileEntity() : null;
-
- if (tMeta instanceof IMetaTileEntityCable) {
- if (tBaseMetaTile.getCoverBehaviorAtSide(tSide).letsEnergyIn(tSide, tBaseMetaTile.getCoverIDAtSide(tSide), tBaseMetaTile.getCoverDataAtSide(tSide), tBaseMetaTile) && ((IGregTechTileEntity) tTileEntity).getTimer() > 50) {
- rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).transferElectricity(tSide, aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedSet);
- }
- } else {
- rUsedAmperes += insertEnergyInto(tTileEntity, tSide, aVoltage, aAmperage - rUsedAmperes);
- }
-
- }
- }
- mTransferredVoltage = Math.max(mTransferredVoltage, aVoltage);
- mTransferredAmperage += rUsedAmperes;
- mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
- mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
- if (aVoltage > mVoltage) {
- mOverheat += Math.max(100, 100 * GT_Utility.getTier(aVoltage) - GT_Utility.getTier(mVoltage));
- }
- if (mTransferredAmperage > mAmperage) return aAmperage;
-
- // Always return amount of used amperes, used on overheat
- return rUsedAmperes;
- }
-
-
-
- private long insertEnergyInto(TileEntity tTileEntity, byte tSide, long aVoltage, long aAmperage) {
- if (aAmperage == 0 || tTileEntity == null) return 0;
-
- final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- final ForgeDirection tDirection = ForgeDirection.getOrientation(tSide);
-
- if (tTileEntity instanceof IEnergyConnected) {
- return ((IEnergyConnected) tTileEntity).injectEnergyUnits(tSide, aVoltage, aAmperage);
- }
-
- // AE2 Compat
- if (GT_Mod.gregtechproxy.mAE2Integration && tTileEntity instanceof appeng.tile.powersink.IC2) {
- if (((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDirection)) {
- long rUsedAmperes = 0;
- while (aAmperage > rUsedAmperes && ((appeng.tile.powersink.IC2)tTileEntity).getDemandedEnergy() > 0 && ((appeng.tile.powersink.IC2)tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) <= aVoltage)
- rUsedAmperes++;
-
- return rUsedAmperes;
- }
- return 0;
- }
-
- if (Loader.isModLoaded("GalacticraftCore")) {
- long gc = GT_GC_Compat.insertEnergyInto(tTileEntity, aVoltage, tDirection);
- if (gc != 2)
- return gc;
- }
-
- // IC2 Compat
- {
- final TileEntity tIc2Acceptor = (tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
- EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
-
- if (tIc2Acceptor instanceof IEnergySink && ((IEnergySink) tIc2Acceptor).acceptsEnergyFrom((TileEntity) baseMetaTile, tDirection)) {
- long rUsedAmperes = 0;
- while (aAmperage > rUsedAmperes && ((IEnergySink) tIc2Acceptor).getDemandedEnergy() > 0 && ((IEnergySink) tIc2Acceptor).injectEnergy(tDirection, aVoltage, aVoltage) <= aVoltage)
- rUsedAmperes++;
- return rUsedAmperes;
- }
- }
-
- // RF Compat
- if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
- final IEnergyReceiver rfReceiver = (IEnergyReceiver) tTileEntity;
- long rfOUT = aVoltage * GregTech_API.mEUtoRF / 100, rUsedAmperes = 0;
- int rfOut = rfOUT > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) rfOUT;
-
- if (rfReceiver.receiveEnergy(tDirection, rfOut, true) == rfOut) {
- rfReceiver.receiveEnergy(tDirection, rfOut, false);
- rUsedAmperes++;
- }
- else if (rfReceiver.receiveEnergy(tDirection, rfOut, true) > 0) {
- if (mRestRF == 0) {
- int RFtrans = rfReceiver.receiveEnergy(tDirection, (int) rfOut, false);
- rUsedAmperes++;
- mRestRF = rfOut - RFtrans;
- } else {
- int RFtrans = rfReceiver.receiveEnergy(tDirection, (int) mRestRF, false);
- mRestRF = mRestRF - RFtrans;
- }
- }
- if (GregTech_API.mRFExplosions && rfReceiver.getMaxEnergyStored(tDirection) < rfOut * 600) {
- if (rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
- }
- return rUsedAmperes;
- }
-
- return 0;
- }
-
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- if(aBaseMetaTileEntity.isServerSide()) {
- lastAmperage = new int[16];
- lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime() - 1;//sets initial value -1 since it is in the same tick as first on post tick
- }
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
-
- { //amp handler
- long worldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime();
- int tickDiff = (int) (worldTick - lastWorldTick);
- lastWorldTick = worldTick;
-
- if (tickDiff >= 16) for (int i = 0; i <= 14; i++) lastAmperage[i] = 0;
- else {
- System.arraycopy(lastAmperage, tickDiff, lastAmperage, 0, 16 - tickDiff);
- for (int i = 14; i >= 0; i--) {
- if (--tickDiff > 0) lastAmperage[i] = 0;
- else break;
- }
- }
-
- lastAmperage[15] = mTransferredAmperage;
-
- if (lastAmperage[15] > mAmperage) {
- int i = 0;
- for (; i <= 14; i++) {
- if (lastAmperage[i] < mAmperage) {
- lastAmperage[15] -= (int) mAmperage - lastAmperage[i];
- lastAmperage[i] = (int)mAmperage;
- if (lastAmperage[15] <= mAmperage) break;
- }
- }
- if (lastAmperage[15] > mAmperage) {
- mOverheat += 100 * (lastAmperage[15] - mAmperage);
- lastAmperage[15] = (int) mAmperage;
- } else if (lastAmperage[15] < mAmperage) {
- lastAmperage[i] = lastAmperage[15];
- lastAmperage[15] = (int) mAmperage;
- }
- }
- }
-
- if(mOverheat>=mMaxOverheat) {
- //TODO someday
- //int newMeta=aBaseMetaTileEntity.getMetaTileID()-6;
- //if(mInsulated &&
- // GregTech_API.METATILEENTITIES[newMeta] instanceof GT_MetaPipeEntity_Cable &&
- // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mMaterial==mMaterial &&
- // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mAmperage<=mAmperage){
- // aBaseMetaTileEntity.setOnFire();
- // aBaseMetaTileEntity.setMetaTileEntity(GregTech_API.METATILEENTITIES[newMeta]);
- // return;
- //}else{
- aBaseMetaTileEntity.setToFire();
- //}
- }else if (mOverheat>0) mOverheat--;
-
- mTransferredVoltageOK=mTransferredVoltage;
- mTransferredVoltage=0;
- mTransferredAmperageOK=mTransferredAmperage;
- mTransferredAmperage = 0;
-
- if (aTick % 20 == 0) {
- mTransferredVoltageLast20OK=mTransferredVoltageLast20;
- mTransferredVoltageLast20 = 0;
- mTransferredAmperageLast20OK=mTransferredAmperageLast20;
- mTransferredAmperageLast20 = 0;
- if (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections) checkConnections();
- }
- } else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
- }
-
- @Override
- public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Mod.gregtechproxy.gt6Cable && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
- if(isConnectedAtSide(aWrenchingSide)) {
- disconnect(aWrenchingSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
- }else if(!GT_Mod.gregtechproxy.costlyCableConnection){
- if (connect(aWrenchingSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
- }
- return true;
- }
- return false;
- }
-
- public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Mod.gregtechproxy.gt6Cable && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
- if (isConnectedAtSide(aWrenchingSide)) {
- disconnect(aWrenchingSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
- } else if (!GT_Mod.gregtechproxy.costlyCableConnection || GT_ModHandler.consumeSolderingMaterial(aPlayer)) {
- if (connect(aWrenchingSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
- }
- return true;
- }
- return false;
- }
-
- @Override
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity);
- }
-
- @Override
- public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
- }
-
-
- @Override
- public boolean canConnect(byte aSide, TileEntity tTileEntity) {
- final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- final GT_CoverBehavior coverBehavior = baseMetaTile.getCoverBehaviorAtSide(aSide);
- final byte tSide = GT_Utility.getOppositeSide(aSide);
- final ForgeDirection tDir = ForgeDirection.getOrientation(tSide);
-
- // GT Machine handling
- if ((tTileEntity instanceof IEnergyConnected) &&
- (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false) || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false)))
- return true;
-
- // Solar Panel Compat
- if (coverBehavior instanceof GT_Cover_SolarPanel) return true;
-
- // ((tIsGregTechTileEntity && tIsTileEntityCable) && (tAlwaysLookConnected || tLetEnergyIn || tLetEnergyOut) ) --> Not needed
- if (Loader.isModLoaded("GalacticraftCore") && GT_GC_Compat.canConnect(tTileEntity,tDir))
- return true;
-
- // AE2-p2p Compat
- if (GT_Mod.gregtechproxy.mAE2Integration) {
- if (tTileEntity instanceof IEnergySource && tTileEntity instanceof IPartHost && ((IPartHost)tTileEntity).getPart(tDir) instanceof PartP2PGTPower && ((IEnergySource) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir))
- return true;
- if (tTileEntity instanceof appeng.tile.powersink.IC2 && ((appeng.tile.powersink.IC2)tTileEntity).acceptsEnergyFrom((TileEntity)baseMetaTile, tDir))
- return true;
- }
-
- // IC2 Compat
- {
- final TileEntity ic2Energy;
-
- if (tTileEntity instanceof IReactorChamber)
- ic2Energy = (TileEntity) ((IReactorChamber) tTileEntity).getReactor();
- else
- ic2Energy = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
- EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
-
- // IC2 Sink Compat
- if ((ic2Energy instanceof IEnergySink) && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir))
- return true;
-
- // IC2 Source Compat
- if (GT_Mod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) {
- if (((IEnergySource) ic2Energy).emitsEnergyTo((TileEntity) baseMetaTile, tDir)) {
- return true;
- }
- }
- }
- // RF Output Compat
- if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir))
- return true;
-
- // RF Input Compat
- if (GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity)baseMetaTile, tDir)))
- return true;
-
-
- return false;
- }
-
- @Override
- public boolean getGT6StyleConnection() {
- // Yes if GT6 Cables are enabled
- return GT_Mod.gregtechproxy.gt6Cable;
- }
-
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public String[] getDescription() {
- return new String[]{
- "Max Voltage: %%%" + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
- "Max Amperage: %%%" + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
- "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + "%%% EU-Volt"
- };
- }
-
- @Override
- public float getThickNess() {
- if(GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
- return mThickNess;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- if (GT_Mod.gregtechproxy.gt6Cable)
- aNBT.setByte("mConnections", mConnections);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if (GT_Mod.gregtechproxy.gt6Cable) {
- mConnections = aNBT.getByte("mConnections");
- }
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[]{
- //EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET,
- "Heat: "+
- EnumChatFormatting.RED+ mOverheat +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW+ mMaxOverheat + EnumChatFormatting.RESET,
- "Max Load (1t):",
- EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageOK) + EnumChatFormatting.RESET +" A / "+
- EnumChatFormatting.YELLOW + Long.toString(mAmperage) + EnumChatFormatting.RESET +" A",
- "Max EU/p (1t):",
- EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageOK) + EnumChatFormatting.RESET +" EU / "+
- EnumChatFormatting.YELLOW + Long.toString(mVoltage) + EnumChatFormatting.RESET +" EU",
- "Max Load (20t): "+
- EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageLast20OK) + EnumChatFormatting.RESET +" A",
- "Max EU/p (20t): "+
- EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageLast20OK) + EnumChatFormatting.RESET +" EU"
- };
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
- }
-
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
- AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
- }
- }
-
- @Override
- public boolean shouldJoinIc2Enet() {
- if (!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return false;
-
- if (mConnections != 0) {
- final IGregTechTileEntity baseMeta = getBaseMetaTileEntity();
- for( byte aSide = 0 ; aSide < 6 ; aSide++) if(isConnectedAtSide(aSide)) {
- final TileEntity tTileEntity = baseMeta.getTileEntityAtSide(aSide);
- final TileEntity tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
- EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
-
- if (tEmitter instanceof IEnergyEmitter)
- return true;
-
- }
- }
- return false;
- }
-}
+package gregtech.api.metatileentity.implementations;
+
+import cofh.api.energy.IEnergyReceiver;
+import com.google.common.collect.Sets;
+import cpw.mods.fml.common.Loader;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_GC_Compat;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Client;
+import gregtech.common.covers.GT_Cover_SolarPanel;
+import gregtech.loaders.postload.PartP2PGTPower;
+import ic2.api.energy.EnergyNet;
+import ic2.api.energy.tile.IEnergyEmitter;
+import ic2.api.energy.tile.IEnergySink;
+import ic2.api.energy.tile.IEnergySource;
+import ic2.api.energy.tile.IEnergyTile;
+import ic2.api.reactor.IReactorChamber;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import appeng.api.parts.IPartHost;
+
+import static gregtech.api.enums.GT_Values.VN;
+
+public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTileEntityCable {
+ public final float mThickNess;
+ public final Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public int mTransferredAmperage = 0, mTransferredAmperageLast20 = 0,mTransferredAmperageLast20OK=0,mTransferredAmperageOK=0;
+ public long mTransferredVoltageLast20 = 0, mTransferredVoltage = 0,mTransferredVoltageLast20OK=0,mTransferredVoltageOK=0;
+ public long mRestRF;
+ public int mOverheat;
+ public static short mMaxOverheat=(short) (GT_Mod.gregtechproxy.mWireHeatingTicks * 100);
+
+ private int[] lastAmperage;
+ private long lastWorldTick;
+
+ public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aID, aName, aNameRegional, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ public GT_MetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aName, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (mInsulated ? 9 : 8);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ if (!mInsulated)
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )};
+ if (aConnected) {
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.124F)
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.374F)//0.375 x1
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.499F)//0.500 x2
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.624F)//0.625 x4
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.749F)//0.750 x8
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.874F)//0.825 x12
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ }
+ return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mCanShock && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity))
+ GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public final boolean renderInside(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return (int) mTransferredAmperage * 64;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return (int) mAmperage * 64;
+ }
+
+ @Override
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!isConnectedAtSide(aSide) && aSide != 6)
+ return 0;
+ if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity()))
+ return 0;
+ return transferElectricity(aSide, aVoltage, aAmperage, Sets.newHashSet((TileEntity) getBaseMetaTileEntity()));
+ }
+
+ @Override
+ @Deprecated
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ return transferElectricity(aSide, aVoltage, aAmperage, new HashSet<>(aAlreadyPassedTileEntityList));
+ }
+
+ @Override
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet<TileEntity> aAlreadyPassedSet) {
+ if (!isConnectedAtSide(aSide) && aSide != 6) return 0;
+
+ long rUsedAmperes = 0;
+ final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
+ byte i = (byte)((((aSide/2)*2)+2)%6); //this bit of trickery makes sure a direction goes to the next cardinal pair. IE, NS goes to E, EW goes to U, UD goes to N. It's a lame way to make sure locally connected machines on a wire get EU first.
+ aVoltage -= mCableLossPerMeter;
+
+ if (aVoltage > 0) for (byte j = 0; j < 6 && aAmperage > rUsedAmperes; j++, i=(byte)((i+1)%6) )
+ if (i != aSide && isConnectedAtSide(i) && baseMetaTile.getCoverBehaviorAtSide(i).letsEnergyOut(i, baseMetaTile.getCoverIDAtSide(i), baseMetaTile.getCoverDataAtSide(i), baseMetaTile)) {
+ final TileEntity tTileEntity = baseMetaTile.getTileEntityAtSide(i);
+
+ if (tTileEntity != null && aAlreadyPassedSet.add(tTileEntity)) {
+ final byte tSide = GT_Utility.getOppositeSide(i);
+ final IGregTechTileEntity tBaseMetaTile = tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity) : null;
+ final IMetaTileEntity tMeta = tBaseMetaTile != null ? tBaseMetaTile.getMetaTileEntity() : null;
+
+ if (tMeta instanceof IMetaTileEntityCable) {
+ if (tBaseMetaTile.getCoverBehaviorAtSide(tSide).letsEnergyIn(tSide, tBaseMetaTile.getCoverIDAtSide(tSide), tBaseMetaTile.getCoverDataAtSide(tSide), tBaseMetaTile) && ((IGregTechTileEntity) tTileEntity).getTimer() > 50) {
+ rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).transferElectricity(tSide, aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedSet);
+ }
+ } else {
+ rUsedAmperes += insertEnergyInto(tTileEntity, tSide, aVoltage, aAmperage - rUsedAmperes);
+ }
+
+ }
+ }
+ mTransferredVoltage = Math.max(mTransferredVoltage, aVoltage);
+ mTransferredAmperage += rUsedAmperes;
+ mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
+ mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
+ if (aVoltage > mVoltage) {
+ mOverheat += Math.max(100, 100 * GT_Utility.getTier(aVoltage) - GT_Utility.getTier(mVoltage));
+ }
+ if (mTransferredAmperage > mAmperage) return aAmperage;
+
+ // Always return amount of used amperes, used on overheat
+ return rUsedAmperes;
+ }
+
+
+
+ private long insertEnergyInto(TileEntity tTileEntity, byte tSide, long aVoltage, long aAmperage) {
+ if (aAmperage == 0 || tTileEntity == null) return 0;
+
+ final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
+ final ForgeDirection tDirection = ForgeDirection.getOrientation(tSide);
+
+ if (tTileEntity instanceof IEnergyConnected) {
+ return ((IEnergyConnected) tTileEntity).injectEnergyUnits(tSide, aVoltage, aAmperage);
+ }
+
+ // AE2 Compat
+ if (GT_Mod.gregtechproxy.mAE2Integration && tTileEntity instanceof appeng.tile.powersink.IC2) {
+ if (((appeng.tile.powersink.IC2) tTileEntity).acceptsEnergyFrom((TileEntity) baseMetaTile, tDirection)) {
+ long rUsedAmperes = 0;
+ while (aAmperage > rUsedAmperes && ((appeng.tile.powersink.IC2)tTileEntity).getDemandedEnergy() > 0 && ((appeng.tile.powersink.IC2)tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) <= aVoltage)
+ rUsedAmperes++;
+
+ return rUsedAmperes;
+ }
+ return 0;
+ }
+
+ if (Loader.isModLoaded("GalacticraftCore")) {
+ long gc = GT_GC_Compat.insertEnergyInto(tTileEntity, aVoltage, tDirection);
+ if (gc != 2)
+ return gc;
+ }
+
+ // IC2 Compat
+ {
+ final TileEntity tIc2Acceptor = (tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
+ EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
+
+ if (tIc2Acceptor instanceof IEnergySink && ((IEnergySink) tIc2Acceptor).acceptsEnergyFrom((TileEntity) baseMetaTile, tDirection)) {
+ long rUsedAmperes = 0;
+ while (aAmperage > rUsedAmperes && ((IEnergySink) tIc2Acceptor).getDemandedEnergy() > 0 && ((IEnergySink) tIc2Acceptor).injectEnergy(tDirection, aVoltage, aVoltage) <= aVoltage)
+ rUsedAmperes++;
+ return rUsedAmperes;
+ }
+ }
+
+ // RF Compat
+ if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
+ final IEnergyReceiver rfReceiver = (IEnergyReceiver) tTileEntity;
+ long rfOUT = aVoltage * GregTech_API.mEUtoRF / 100, rUsedAmperes = 0;
+ int rfOut = rfOUT > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) rfOUT;
+
+ if (rfReceiver.receiveEnergy(tDirection, rfOut, true) == rfOut) {
+ rfReceiver.receiveEnergy(tDirection, rfOut, false);
+ rUsedAmperes++;
+ }
+ else if (rfReceiver.receiveEnergy(tDirection, rfOut, true) > 0) {
+ if (mRestRF == 0) {
+ int RFtrans = rfReceiver.receiveEnergy(tDirection, (int) rfOut, false);
+ rUsedAmperes++;
+ mRestRF = rfOut - RFtrans;
+ } else {
+ int RFtrans = rfReceiver.receiveEnergy(tDirection, (int) mRestRF, false);
+ mRestRF = mRestRF - RFtrans;
+ }
+ }
+ if (GregTech_API.mRFExplosions && rfReceiver.getMaxEnergyStored(tDirection) < rfOut * 600) {
+ if (rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
+ }
+ return rUsedAmperes;
+ }
+
+ return 0;
+ }
+
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ if(aBaseMetaTileEntity.isServerSide()) {
+ lastAmperage = new int[16];
+ lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime() - 1;//sets initial value -1 since it is in the same tick as first on post tick
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+
+ { //amp handler
+ long worldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime();
+ int tickDiff = (int) (worldTick - lastWorldTick);
+ lastWorldTick = worldTick;
+
+ if (tickDiff >= 16) for (int i = 0; i <= 14; i++) lastAmperage[i] = 0;
+ else {
+ System.arraycopy(lastAmperage, tickDiff, lastAmperage, 0, 16 - tickDiff);
+ for (int i = 14; i >= 0; i--) {
+ if (--tickDiff > 0) lastAmperage[i] = 0;
+ else break;
+ }
+ }
+
+ lastAmperage[15] = mTransferredAmperage;
+
+ if (lastAmperage[15] > mAmperage) {
+ int i = 0;
+ for (; i <= 14; i++) {
+ if (lastAmperage[i] < mAmperage) {
+ lastAmperage[15] -= (int) mAmperage - lastAmperage[i];
+ lastAmperage[i] = (int)mAmperage;
+ if (lastAmperage[15] <= mAmperage) break;
+ }
+ }
+ if (lastAmperage[15] > mAmperage) {
+ mOverheat += 100 * (lastAmperage[15] - mAmperage);
+ lastAmperage[15] = (int) mAmperage;
+ } else if (lastAmperage[15] < mAmperage) {
+ lastAmperage[i] = lastAmperage[15];
+ lastAmperage[15] = (int) mAmperage;
+ }
+ }
+ }
+
+ if(mOverheat>=mMaxOverheat) {
+ //TODO someday
+ //int newMeta=aBaseMetaTileEntity.getMetaTileID()-6;
+ //if(mInsulated &&
+ // GregTech_API.METATILEENTITIES[newMeta] instanceof GT_MetaPipeEntity_Cable &&
+ // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mMaterial==mMaterial &&
+ // ((GT_MetaPipeEntity_Cable)GregTech_API.METATILEENTITIES[newMeta]).mAmperage<=mAmperage){
+ // aBaseMetaTileEntity.setOnFire();
+ // aBaseMetaTileEntity.setMetaTileEntity(GregTech_API.METATILEENTITIES[newMeta]);
+ // return;
+ //}else{
+ aBaseMetaTileEntity.setToFire();
+ //}
+ }else if (mOverheat>0) mOverheat--;
+
+ mTransferredVoltageOK=mTransferredVoltage;
+ mTransferredVoltage=0;
+ mTransferredAmperageOK=mTransferredAmperage;
+ mTransferredAmperage = 0;
+
+ if (aTick % 20 == 0) {
+ mTransferredVoltageLast20OK=mTransferredVoltageLast20;
+ mTransferredVoltageLast20 = 0;
+ mTransferredAmperageLast20OK=mTransferredAmperageLast20;
+ mTransferredAmperageLast20 = 0;
+ if (!GT_Mod.gregtechproxy.gt6Cable || mCheckConnections) checkConnections();
+ }
+ } else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
+ }
+
+ @Override
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Cable && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
+ if(isConnectedAtSide(aWrenchingSide)) {
+ disconnect(aWrenchingSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ }else if(!GT_Mod.gregtechproxy.costlyCableConnection){
+ if (connect(aWrenchingSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Cable && GT_ModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) {
+ if (isConnectedAtSide(aWrenchingSide)) {
+ disconnect(aWrenchingSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ } else if (!GT_Mod.gregtechproxy.costlyCableConnection || GT_ModHandler.consumeSolderingMaterial(aPlayer)) {
+ if (connect(aWrenchingSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return coverBehavior.letsEnergyIn(aSide, aCoverID, aCoverVariable, aTileEntity);
+ }
+
+ @Override
+ public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return coverBehavior.letsEnergyOut(aSide, aCoverID, aCoverVariable, aTileEntity);
+ }
+
+
+ @Override
+ public boolean canConnect(byte aSide, TileEntity tTileEntity) {
+ final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
+ final GT_CoverBehavior coverBehavior = baseMetaTile.getCoverBehaviorAtSide(aSide);
+ final byte tSide = GT_Utility.getOppositeSide(aSide);
+ final ForgeDirection tDir = ForgeDirection.getOrientation(tSide);
+
+ // GT Machine handling
+ if ((tTileEntity instanceof IEnergyConnected) &&
+ (((IEnergyConnected) tTileEntity).inputEnergyFrom(tSide, false) || ((IEnergyConnected) tTileEntity).outputsEnergyTo(tSide, false)))
+ return true;
+
+ // Solar Panel Compat
+ if (coverBehavior instanceof GT_Cover_SolarPanel) return true;
+
+ // ((tIsGregTechTileEntity && tIsTileEntityCable) && (tAlwaysLookConnected || tLetEnergyIn || tLetEnergyOut) ) --> Not needed
+ if (Loader.isModLoaded("GalacticraftCore") && GT_GC_Compat.canConnect(tTileEntity,tDir))
+ return true;
+
+ // AE2-p2p Compat
+ if (GT_Mod.gregtechproxy.mAE2Integration) {
+ if (tTileEntity instanceof IEnergySource && tTileEntity instanceof IPartHost && ((IPartHost)tTileEntity).getPart(tDir) instanceof PartP2PGTPower && ((IEnergySource) tTileEntity).emitsEnergyTo((TileEntity) baseMetaTile, tDir))
+ return true;
+ if (tTileEntity instanceof appeng.tile.powersink.IC2 && ((appeng.tile.powersink.IC2)tTileEntity).acceptsEnergyFrom((TileEntity)baseMetaTile, tDir))
+ return true;
+ }
+
+ // IC2 Compat
+ {
+ final TileEntity ic2Energy;
+
+ if (tTileEntity instanceof IReactorChamber)
+ ic2Energy = (TileEntity) ((IReactorChamber) tTileEntity).getReactor();
+ else
+ ic2Energy = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
+ EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
+
+ // IC2 Sink Compat
+ if ((ic2Energy instanceof IEnergySink) && ((IEnergySink) ic2Energy).acceptsEnergyFrom((TileEntity) baseMetaTile, tDir))
+ return true;
+
+ // IC2 Source Compat
+ if (GT_Mod.gregtechproxy.ic2EnergySourceCompat && (ic2Energy instanceof IEnergySource)) {
+ if (((IEnergySource) ic2Energy).emitsEnergyTo((TileEntity) baseMetaTile, tDir)) {
+ return true;
+ }
+ }
+ }
+ // RF Output Compat
+ if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver) tTileEntity).canConnectEnergy(tDir))
+ return true;
+
+ // RF Input Compat
+ if (GregTech_API.mInputRF && (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter) tTileEntity).emitsEnergyTo((TileEntity)baseMetaTile, tDir)))
+ return true;
+
+
+ return false;
+ }
+
+ @Override
+ public boolean getGT6StyleConnection() {
+ // Yes if GT6 Cables are enabled
+ return GT_Mod.gregtechproxy.gt6Cable;
+ }
+
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Max Voltage: %%%" + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: %%%" + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: %%%" + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + "%%% EU-Volt"
+ };
+ }
+
+ @Override
+ public float getThickNess() {
+ if(GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ return mThickNess;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (GT_Mod.gregtechproxy.gt6Cable)
+ aNBT.setByte("mConnections", mConnections);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (GT_Mod.gregtechproxy.gt6Cable) {
+ mConnections = aNBT.getByte("mConnections");
+ }
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{
+ //EnumChatFormatting.BLUE + mName + EnumChatFormatting.RESET,
+ "Heat: "+
+ EnumChatFormatting.RED+ mOverheat +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW+ mMaxOverheat + EnumChatFormatting.RESET,
+ "Max Load (1t):",
+ EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageOK) + EnumChatFormatting.RESET +" A / "+
+ EnumChatFormatting.YELLOW + Long.toString(mAmperage) + EnumChatFormatting.RESET +" A",
+ "Max EU/p (1t):",
+ EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageOK) + EnumChatFormatting.RESET +" EU / "+
+ EnumChatFormatting.YELLOW + Long.toString(mVoltage) + EnumChatFormatting.RESET +" EU",
+ "Max Load (20t): "+
+ EnumChatFormatting.GREEN + Integer.toString(mTransferredAmperageLast20OK) + EnumChatFormatting.RESET +" A",
+ "Max EU/p (20t): "+
+ EnumChatFormatting.GREEN + Long.toString(mTransferredVoltageLast20OK) + EnumChatFormatting.RESET +" EU"
+ };
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ float tSpace = (1f - mThickNess)/2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
+ if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
+ if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
+ if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
+ }
+
+ @Override
+ public boolean shouldJoinIc2Enet() {
+ if (!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return false;
+
+ if (mConnections != 0) {
+ final IGregTechTileEntity baseMeta = getBaseMetaTileEntity();
+ for( byte aSide = 0 ; aSide < 6 ; aSide++) if(isConnectedAtSide(aSide)) {
+ final TileEntity tTileEntity = baseMeta.getTileEntityAtSide(aSide);
+ final TileEntity tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity :
+ EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord);
+
+ if (tEmitter instanceof IEnergyEmitter)
+ return true;
+
+ }
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
index f77c419c0e..0767bd0081 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
@@ -1,658 +1,658 @@
-package gregtech.api.metatileentity.implementations;
-
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.MetaPipeEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_Client;
-import gregtech.common.covers.GT_Cover_Drain;
-import gregtech.common.covers.GT_Cover_FluidRegulator;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidHandler;
-import org.apache.commons.lang3.tuple.MutableTriple;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static gregtech.api.enums.GT_Values.D1;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
-public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
- public final float mThickNess;
- public final Materials mMaterial;
- public final int mCapacity, mHeatResistance, mPipeAmount;
- public final boolean mGasProof;
- public final FluidStack[] mFluids;
- public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
- /**
- * Bitmask for whether disable fluid input form each side.
- */
- public byte mDisableInput = 0;
-
- public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
- this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
- }
-
- public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
- super(aID, aName, aNameRegional, 0, false);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mCapacity = aCapacity;
- mGasProof = aGasProof;
- mHeatResistance = aHeatResistance;
- mPipeAmount = aFluidTypes;
- mFluids = new FluidStack[mPipeAmount];
- addInfo(aID);
- }
-
- @Deprecated
- public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
- this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
- }
-
- public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
- super(aName, 0);
- mThickNess = aThickNess;
- mMaterial = aMaterial;
- mCapacity = aCapacity;
- mGasProof = aGasProof;
- mHeatResistance = aHeatResistance;
- mPipeAmount = aFluidTypes;
- mFluids = new FluidStack[mPipeAmount];
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return (byte) (mMaterial == null ? 4 : (byte) (4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
- float tThickNess = getThickNess();
- if (mDisableInput == 0) return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
- byte tMask = 0;
- byte[][] sRestrictionArray = new byte[][]{
- {2, 3, 5, 4},
- {2, 3, 4, 5},
- {1, 0, 4, 5},
- {1, 0, 4, 5},
- {1, 0, 2, 3},
- {1, 0, 2, 3}
- };
- if (aSide >= 0 && aSide < 6) for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i;
- return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
- }
-
- protected static final ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) {
- if (aPipeAmount >= 9) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aPipeAmount >= 4) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.124F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.374F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.499F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.749F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- if (aThickNess < 0.874F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
- }
-
- protected static final ITexture getRestrictorTexture(byte aMask) {
- switch (aMask) {
- case 1: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UP);
- case 2: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DOWN);
- case 3: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UD);
- case 4: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LEFT);
- case 5: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UL);
- case 6: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DL);
- case 7: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NR);
- case 8: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_RIGHT);
- case 9: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UR);
- case 10: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DR);
- case 11: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NL);
- case 12: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LR);
- case 13: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_ND);
- case 14: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NU);
- case 15: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR);
- default: return null;
- }
- }
-
- @Override
- public void onValueUpdate(byte aValue) {
- mDisableInput = aValue;
- }
-
- @Override
- public byte getUpdateData() {
- return mDisableInput;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return false;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return false;
- }
-
- @Override
- public final boolean renderInside(byte aSide) {
- return false;
- }
-
- @Override
- public int getProgresstime() {
- return getFluidAmount();
- }
-
- @Override
- public int maxProgresstime() {
- return getCapacity();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- for (int i = 0; i < mPipeAmount; i++)
- if (mFluids[i] != null)
- aNBT.setTag("mFluid"+(i==0?"":i), mFluids[i].writeToNBT(new NBTTagCompound()));
- aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
- if (GT_Mod.gregtechproxy.gt6Pipe) {
- aNBT.setByte("mConnections", mConnections);
- aNBT.setByte("mDisableInput", mDisableInput);
- }
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- for (int i = 0; i < mPipeAmount; i++)
- mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"+(i==0?"":i)));
- mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
- if (GT_Mod.gregtechproxy.gt6Pipe) {
- mConnections = aNBT.getByte("mConnections");
- mDisableInput = aNBT.getByte("mDisableInput");
- }
- }
-
- @Override
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
- if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null) {
- int tTemperature = tFluid.getFluid().getTemperature(tFluid);
- if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
- GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break;
- } else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
- GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); break;
- }
- }
- }
- }
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) {
- mLastReceivedFrom &= 63;
- if (mLastReceivedFrom == 63) {
- mLastReceivedFrom = 0;
- }
-
- if (!GT_Mod.gregtechproxy.gt6Pipe || mCheckConnections) checkConnections();
-
- boolean shouldDistribute = (oLastReceivedFrom == mLastReceivedFrom);
- for (int i = 0, j = aBaseMetaTileEntity.getRandomNumber(mPipeAmount); i < mPipeAmount; i++) {
- int index = (i + j) % mPipeAmount;
- if (mFluids[index] != null && mFluids[index].amount <= 0) mFluids[index] = null;
- if (mFluids[index] == null) continue;
-
- if (checkEnvironment(index, aBaseMetaTileEntity)) return;
-
- if (shouldDistribute) {
- distributeFluid(index, aBaseMetaTileEntity);
- mLastReceivedFrom = 0;
- }
- }
-
- oLastReceivedFrom = mLastReceivedFrom;
-
- } else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
- }
-
- private boolean checkEnvironment(int index, IGregTechTileEntity aBaseMetaTileEntity) {
- // Check for hot liquids that melt the pipe or gasses that escape and burn/freeze people
- final FluidStack tFluid = mFluids[index];
-
- if (tFluid != null && tFluid.amount > 0) {
- int tTemperature = tFluid.getFluid().getTemperature(tFluid);
- if (tTemperature > mHeatResistance) {
- if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
- // Poof
- GT_Log.exp.println("Set Pipe to Fire due to to low heat resistance at "+aBaseMetaTileEntity.getXCoord()+ " | "+aBaseMetaTileEntity.getYCoord()+ " | "+aBaseMetaTileEntity.getZCoord()+ " DIMID: "+aBaseMetaTileEntity.getWorld().provider.dimensionId);
- aBaseMetaTileEntity.setToFire();
- return true;
- }
- // Mmhmm, Fire
- aBaseMetaTileEntity.setOnFire();
- GT_Log.exp.println("Set Blocks around Pipe to Fire due to to low heat resistance at "+aBaseMetaTileEntity.getXCoord()+ " | "+aBaseMetaTileEntity.getYCoord()+ " | "+aBaseMetaTileEntity.getZCoord()+ " DIMID: "+aBaseMetaTileEntity.getWorld().provider.dimensionId);
-
- }
- if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
- tFluid.amount -= 5;
- sendSound((byte) 9);
- if (tTemperature > 320) {
- try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
- GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- } else if (tTemperature < 260) {
- try {
- for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
- GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
- }
- } catch (Throwable e) {
- if (D1) e.printStackTrace(GT_Log.err);
- }
- }
- }
- if (tFluid.amount <= 0) mFluids[index] = null;
- }
- return false;
- }
-
- private void distributeFluid(int index, IGregTechTileEntity aBaseMetaTileEntity) {
- final FluidStack tFluid = mFluids[index];
- if (tFluid == null) return;
-
- // Tank, From, Amount to receive
- List<MutableTriple<IFluidHandler, ForgeDirection, Integer>> tTanks = new ArrayList<>();
-
- for (byte aSide, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
- // Get a list of tanks accepting fluids, and what side they're on
- aSide = (byte) ((i + j) % 6);
- final byte tSide = GT_Utility.getOppositeSide(aSide);
- final IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aSide);
- final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null;
-
- if (isConnectedAtSide(aSide) && tTank != null && (mLastReceivedFrom & (1 << aSide)) == 0 &&
- getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsFluidOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), tFluid.getFluid(), getBaseMetaTileEntity()) &&
- (gTank == null || gTank.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, gTank.getCoverIDAtSide(tSide), gTank.getCoverDataAtSide(tSide), tFluid.getFluid(), gTank)))
- {
- if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) {
- tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0));
- }
- }
- }
-
- // How much of this fluid is available for distribution?
- double tAmount = Math.max(1, Math.min(mCapacity * 10, tFluid.amount)), tNumTanks = tTanks.size();
- FluidStack maxFluid = tFluid.copy();
- maxFluid.amount = Integer.MAX_VALUE;
-
- double availableCapacity = 0;
- // Calculate available capacity for distribution from all tanks
- for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry: tTanks) {
- tEntry.right = tEntry.left.fill(tEntry.middle, maxFluid, false);
- availableCapacity += tEntry.right;
- }
-
- // Now distribute
- for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry: tTanks) {
- if (availableCapacity > tAmount) tEntry.right = (int) Math.floor(tEntry.right * tAmount / availableCapacity); // Distribue fluids based on percentage available space at destination
- if (tEntry.right == 0) tEntry.right = (int)Math.min(1, tAmount); // If the percent is not enough to give at least 1L, try to give 1L
- if (tEntry.right <= 0) continue;
-
- int tFilledAmount = tEntry.left.fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false);
-
- if (tFilledAmount > 0) tEntry.left.fill(tEntry.middle, drainFromIndex(tFilledAmount, true, index), true);
- }
-
- }
-
- @Override
- public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Mod.gregtechproxy.gt6Pipe) {
- byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
- byte tMask = (byte) (1 << tSide);
- if (aPlayer.isSneaking()) {
- if (isInputDisabledAtSide(tSide)) {
- mDisableInput &= ~tMask;
- GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
- if (!isConnectedAtSide(tSide))
- connect(tSide);
- } else {
- mDisableInput |= tMask;
- GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
- }
- } else {
- if (!isConnectedAtSide(tSide)) {
- if (connect(tSide) > 0)
- GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
- }
- else {
- disconnect(tSide);
- GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
- }
- }
- return true;
- }
- return false;
- }
-
- @Override
- public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return coverBehavior.letsFluidIn(aSide, aCoverID, aCoverVariable, null, aTileEntity);
- }
-
- @Override
- public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity);
- }
-
- @Override
- public boolean canConnect(byte aSide, TileEntity tTileEntity) {
- if (tTileEntity == null) return false;
-
- final byte tSide = (byte)ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
- final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
- if (baseMetaTile == null) return false;
-
- final GT_CoverBehavior coverBehavior = baseMetaTile.getCoverBehaviorAtSide(aSide);
- final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
-
- if (coverBehavior instanceof GT_Cover_Drain) return true;
-
- // Tinker Construct Faucets return a null tank info, so check the class
- if (GregTech_API.mTConstruct && tTileEntity instanceof tconstruct.smeltery.logic.FaucetLogic) return true;
-
- final IFluidHandler fTileEntity = (tTileEntity instanceof IFluidHandler) ? (IFluidHandler) tTileEntity : null;
-
- if (fTileEntity != null) {
- FluidTankInfo[] tInfo = fTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide));
- if (tInfo != null) {
- if (tInfo.length > 0) return true;
-
- // Translocators return a TankInfo, but it's of 0 length - so check the class if we see this pattern
- if (GregTech_API.mTranslocator && tTileEntity instanceof codechicken.translocator.TileLiquidTranslocator) return true;
- if (gTileEntity != null && gTileEntity.getCoverBehaviorAtSide(tSide) instanceof GT_Cover_FluidRegulator) return true;
-
- }
- }
- return false;
- }
-
- @Override
- public boolean getGT6StyleConnection() {
- // Yes if GT6 pipes are enabled
- return GT_Mod.gregtechproxy.gt6Pipe;
- }
-
- @Override
- public void doSound(byte aIndex, double aX, double aY, double aZ) {
- super.doSound(aIndex, aX, aY, aZ);
- if (aIndex == 9) {
- GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
- for (byte i = 0; i < 6; i++)
- getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + XSTR_INSTANCE.nextFloat(), aY - 0.5 + XSTR_INSTANCE.nextFloat(), aZ - 0.5 + XSTR_INSTANCE.nextFloat(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
- }
- }
-
- @Override
- public final int getCapacity() {
- return mCapacity * 20 * mPipeAmount;
- }
-
- @Override
- public FluidTankInfo getInfo() {
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- return new FluidTankInfo(tFluid, mCapacity * 20);
- }
- return new FluidTankInfo(null, mCapacity * 20);
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
- ArrayList<FluidTankInfo> tList = new ArrayList<>();
- for (FluidStack tFluid : mFluids)
- tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
- return tList.toArray(new FluidTankInfo[mPipeAmount]);
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return false;
- }
-
- @Override
- public final FluidStack getFluid() {
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- return tFluid;
- }
- return null;
- }
-
- @Override
- public final int getFluidAmount() {
- int rAmount = 0;
- for (FluidStack tFluid : mFluids) {
- if (tFluid != null)
- rAmount += tFluid.amount;
- }
- return rAmount;
- }
-
- @Override
- public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
-
- int index = -1;
- for (int i = 0; i < mPipeAmount; i++) {
- if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
- index = i; break;
- }
- else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
- index = i;
- }
- }
-
- return fill_default_intoIndex(aSide, aFluid, doFill, index);
- }
-
- private final int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
- if (index < 0 || index >= mPipeAmount) return 0;
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
-
- if (mFluids[index] == null || mFluids[index].getFluid().getID() <= 0) {
- if (aFluid.amount * mPipeAmount <= getCapacity()) {
- if (doFill) {
- mFluids[index] = aFluid.copy();
- mLastReceivedFrom |= (1 << aSide.ordinal());
- }
- return aFluid.amount;
- }
- if (doFill) {
- mFluids[index] = aFluid.copy();
- mLastReceivedFrom |= (1 << aSide.ordinal());
- mFluids[index].amount = getCapacity() / mPipeAmount;
- }
- return getCapacity() / mPipeAmount;
- }
-
- if (!mFluids[index].isFluidEqual(aFluid)) return 0;
-
- int space = getCapacity() / mPipeAmount - mFluids[index].amount;
- if (aFluid.amount <= space) {
- if (doFill) {
- mFluids[index].amount += aFluid.amount;
- mLastReceivedFrom |= (1 << aSide.ordinal());
- }
- return aFluid.amount;
- }
- if (doFill) {
- mFluids[index].amount = getCapacity() / mPipeAmount;
- mLastReceivedFrom |= (1 << aSide.ordinal());
- }
- return space;
- }
-
- @Override
- public final FluidStack drain(int maxDrain, boolean doDrain) {
- FluidStack drained = null;
- for (int i = 0; i < mPipeAmount; i++) {
- if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
- return drained;
- }
- return null;
- }
-
- private final FluidStack drainFromIndex(int maxDrain, boolean doDrain, int index) {
- if (index < 0 || index >= mPipeAmount) return null;
- if (mFluids[index] == null) return null;
- if (mFluids[index].amount <= 0) {
- mFluids[index] = null;
- return null;
- }
-
- int used = maxDrain;
- if (mFluids[index].amount < used)
- used = mFluids[index].amount;
-
- if (doDrain) {
- mFluids[index].amount -= used;
- }
-
- FluidStack drained = mFluids[index].copy();
- drained.amount = used;
-
- if (mFluids[index].amount <= 0) {
- mFluids[index] = null;
- }
-
- return drained;
- }
-
- @Override
- public int getTankPressure() {
- return getFluidAmount() - (getCapacity() / 2);
- }
-
- @Override
- public String[] getDescription() {
- if (mPipeAmount == 1) {
- return new String[]{
- EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
- };
- } else {
- return new String[]{
- EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
- EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
- EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY
- };
- }
- }
-
- @Override
- public float getThickNess() {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
- return mThickNess;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return !isInputDisabledAtSide(aSide);
- }
-
- @Override
- public boolean isLiquidOutput(byte aSide) {
- return true;
- }
-
- public boolean isInputDisabledAtSide(int aSide) {
- return (mDisableInput & (1 << aSide)) != 0;
- }
-
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
- else
- return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- float tSpace = (1f - mThickNess)/2;
- float tSide0 = tSpace;
- float tSide1 = 1f - tSpace;
- float tSide2 = tSpace;
- float tSide3 = 1f - tSpace;
- float tSide4 = tSpace;
- float tSide5 = 1f - tSpace;
-
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
- if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
-
- byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
- if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
- if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
- if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
- if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
- if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
- if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
-
- return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
- }
-
- @Override
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
- AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
- }
- }
-}
+package gregtech.api.metatileentity.implementations;
+
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.*;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Client;
+import gregtech.common.covers.GT_Cover_Drain;
+import gregtech.common.covers.GT_Cover_FluidRegulator;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+import org.apache.commons.lang3.tuple.MutableTriple;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+
+public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
+ public final float mThickNess;
+ public final Materials mMaterial;
+ public final int mCapacity, mHeatResistance, mPipeAmount;
+ public final boolean mGasProof;
+ public final FluidStack[] mFluids;
+ public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
+ /**
+ * Bitmask for whether disable fluid input form each side.
+ */
+ public byte mDisableInput = 0;
+
+ public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
+
+ public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
+ super(aID, aName, aNameRegional, 0, false);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
+ mPipeAmount = aFluidTypes;
+ mFluids = new FluidStack[mPipeAmount];
+ addInfo(aID);
+ }
+
+ @Deprecated
+ public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
+ }
+
+ public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
+ super(aName, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
+ mPipeAmount = aFluidTypes;
+ mFluids = new FluidStack[mPipeAmount];
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (mMaterial == null ? 4 : (byte) (4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ float tThickNess = getThickNess();
+ if (mDisableInput == 0) return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
+ byte tMask = 0;
+ byte[][] sRestrictionArray = new byte[][]{
+ {2, 3, 5, 4},
+ {2, 3, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 4, 5},
+ {1, 0, 2, 3},
+ {1, 0, 2, 3}
+ };
+ if (aSide >= 0 && aSide < 6) for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i;
+ return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
+ }
+
+ protected static final ITexture getBaseTexture(float aThickNess, int aPipeAmount, Materials aMaterial, byte aColorIndex) {
+ if (aPipeAmount >= 9) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aPipeAmount >= 4) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.124F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.374F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.499F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.749F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ if (aThickNess < 0.874F) return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ return new GT_RenderedTexture(aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa));
+ }
+
+ protected static final ITexture getRestrictorTexture(byte aMask) {
+ switch (aMask) {
+ case 1: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UP);
+ case 2: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DOWN);
+ case 3: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UD);
+ case 4: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LEFT);
+ case 5: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UL);
+ case 6: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DL);
+ case 7: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NR);
+ case 8: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_RIGHT);
+ case 9: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_UR);
+ case 10: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_DR);
+ case 11: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NL);
+ case 12: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_LR);
+ case 13: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_ND);
+ case 14: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR_NU);
+ case 15: return new GT_RenderedTexture(Textures.BlockIcons.PIPE_RESTRICTOR);
+ default: return null;
+ }
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ mDisableInput = aValue;
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return mDisableInput;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public final boolean renderInside(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return getFluidAmount();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return getCapacity();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ for (int i = 0; i < mPipeAmount; i++)
+ if (mFluids[i] != null)
+ aNBT.setTag("mFluid"+(i==0?"":i), mFluids[i].writeToNBT(new NBTTagCompound()));
+ aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ aNBT.setByte("mConnections", mConnections);
+ aNBT.setByte("mDisableInput", mDisableInput);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ for (int i = 0; i < mPipeAmount; i++)
+ mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"+(i==0?"":i)));
+ mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ mConnections = aNBT.getByte("mConnections");
+ mDisableInput = aNBT.getByte("mDisableInput");
+ }
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null) {
+ int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break;
+ } else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
+ GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aTick % 5 == 0) {
+ mLastReceivedFrom &= 63;
+ if (mLastReceivedFrom == 63) {
+ mLastReceivedFrom = 0;
+ }
+
+ if (!GT_Mod.gregtechproxy.gt6Pipe || mCheckConnections) checkConnections();
+
+ boolean shouldDistribute = (oLastReceivedFrom == mLastReceivedFrom);
+ for (int i = 0, j = aBaseMetaTileEntity.getRandomNumber(mPipeAmount); i < mPipeAmount; i++) {
+ int index = (i + j) % mPipeAmount;
+ if (mFluids[index] != null && mFluids[index].amount <= 0) mFluids[index] = null;
+ if (mFluids[index] == null) continue;
+
+ if (checkEnvironment(index, aBaseMetaTileEntity)) return;
+
+ if (shouldDistribute) {
+ distributeFluid(index, aBaseMetaTileEntity);
+ mLastReceivedFrom = 0;
+ }
+ }
+
+ oLastReceivedFrom = mLastReceivedFrom;
+
+ } else if(aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected==4) aBaseMetaTileEntity.issueTextureUpdate();
+ }
+
+ private boolean checkEnvironment(int index, IGregTechTileEntity aBaseMetaTileEntity) {
+ // Check for hot liquids that melt the pipe or gasses that escape and burn/freeze people
+ final FluidStack tFluid = mFluids[index];
+
+ if (tFluid != null && tFluid.amount > 0) {
+ int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ if (tTemperature > mHeatResistance) {
+ if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
+ // Poof
+ GT_Log.exp.println("Set Pipe to Fire due to to low heat resistance at "+aBaseMetaTileEntity.getXCoord()+ " | "+aBaseMetaTileEntity.getYCoord()+ " | "+aBaseMetaTileEntity.getZCoord()+ " DIMID: "+aBaseMetaTileEntity.getWorld().provider.dimensionId);
+ aBaseMetaTileEntity.setToFire();
+ return true;
+ }
+ // Mmhmm, Fire
+ aBaseMetaTileEntity.setOnFire();
+ GT_Log.exp.println("Set Blocks around Pipe to Fire due to to low heat resistance at "+aBaseMetaTileEntity.getXCoord()+ " | "+aBaseMetaTileEntity.getYCoord()+ " | "+aBaseMetaTileEntity.getZCoord()+ " DIMID: "+aBaseMetaTileEntity.getWorld().provider.dimensionId);
+
+ }
+ if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
+ tFluid.amount -= 5;
+ sendSound((byte) 9);
+ if (tTemperature > 320) {
+ try {
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
+ GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ } else if (tTemperature < 260) {
+ try {
+ for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
+ GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ if (tFluid.amount <= 0) mFluids[index] = null;
+ }
+ return false;
+ }
+
+ private void distributeFluid(int index, IGregTechTileEntity aBaseMetaTileEntity) {
+ final FluidStack tFluid = mFluids[index];
+ if (tFluid == null) return;
+
+ // Tank, From, Amount to receive
+ List<MutableTriple<IFluidHandler, ForgeDirection, Integer>> tTanks = new ArrayList<>();
+
+ for (byte aSide, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
+ // Get a list of tanks accepting fluids, and what side they're on
+ aSide = (byte) ((i + j) % 6);
+ final byte tSide = GT_Utility.getOppositeSide(aSide);
+ final IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aSide);
+ final IGregTechTileEntity gTank = tTank instanceof IGregTechTileEntity ? (IGregTechTileEntity) tTank : null;
+
+ if (isConnectedAtSide(aSide) && tTank != null && (mLastReceivedFrom & (1 << aSide)) == 0 &&
+ getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsFluidOut(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), tFluid.getFluid(), getBaseMetaTileEntity()) &&
+ (gTank == null || gTank.getCoverBehaviorAtSide(tSide).letsFluidIn(tSide, gTank.getCoverIDAtSide(tSide), gTank.getCoverDataAtSide(tSide), tFluid.getFluid(), gTank)))
+ {
+ if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) {
+ tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0));
+ }
+ }
+ }
+
+ // How much of this fluid is available for distribution?
+ double tAmount = Math.max(1, Math.min(mCapacity * 10, tFluid.amount)), tNumTanks = tTanks.size();
+ FluidStack maxFluid = tFluid.copy();
+ maxFluid.amount = Integer.MAX_VALUE;
+
+ double availableCapacity = 0;
+ // Calculate available capacity for distribution from all tanks
+ for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry: tTanks) {
+ tEntry.right = tEntry.left.fill(tEntry.middle, maxFluid, false);
+ availableCapacity += tEntry.right;
+ }
+
+ // Now distribute
+ for (MutableTriple<IFluidHandler, ForgeDirection, Integer> tEntry: tTanks) {
+ if (availableCapacity > tAmount) tEntry.right = (int) Math.floor(tEntry.right * tAmount / availableCapacity); // Distribue fluids based on percentage available space at destination
+ if (tEntry.right == 0) tEntry.right = (int)Math.min(1, tAmount); // If the percent is not enough to give at least 1L, try to give 1L
+ if (tEntry.right <= 0) continue;
+
+ int tFilledAmount = tEntry.left.fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false);
+
+ if (tFilledAmount > 0) tEntry.left.fill(tEntry.middle, drainFromIndex(tFilledAmount, true, index), true);
+ }
+
+ }
+
+ @Override
+ public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (GT_Mod.gregtechproxy.gt6Pipe) {
+ byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
+ byte tMask = (byte) (1 << tSide);
+ if (aPlayer.isSneaking()) {
+ if (isInputDisabledAtSide(tSide)) {
+ mDisableInput &= ~tMask;
+ GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
+ if (!isConnectedAtSide(tSide))
+ connect(tSide);
+ } else {
+ mDisableInput |= tMask;
+ GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
+ }
+ } else {
+ if (!isConnectedAtSide(tSide)) {
+ if (connect(tSide) > 0)
+ GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
+ }
+ else {
+ disconnect(tSide);
+ GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return coverBehavior.letsFluidIn(aSide, aCoverID, aCoverVariable, null, aTileEntity);
+ }
+
+ @Override
+ public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return coverBehavior.letsFluidOut(aSide, aCoverID, aCoverVariable, null, aTileEntity);
+ }
+
+ @Override
+ public boolean canConnect(byte aSide, TileEntity tTileEntity) {
+ if (tTileEntity == null) return false;
+
+ final byte tSide = (byte)ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
+ final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
+ if (baseMetaTile == null) return false;
+
+ final GT_CoverBehavior coverBehavior = baseMetaTile.getCoverBehaviorAtSide(aSide);
+ final IGregTechTileEntity gTileEntity = (tTileEntity instanceof IGregTechTileEntity) ? (IGregTechTileEntity) tTileEntity : null;
+
+ if (coverBehavior instanceof GT_Cover_Drain) return true;
+
+ // Tinker Construct Faucets return a null tank info, so check the class
+ if (GregTech_API.mTConstruct && tTileEntity instanceof tconstruct.smeltery.logic.FaucetLogic) return true;
+
+ final IFluidHandler fTileEntity = (tTileEntity instanceof IFluidHandler) ? (IFluidHandler) tTileEntity : null;
+
+ if (fTileEntity != null) {
+ FluidTankInfo[] tInfo = fTileEntity.getTankInfo(ForgeDirection.getOrientation(tSide));
+ if (tInfo != null) {
+ if (tInfo.length > 0) return true;
+
+ // Translocators return a TankInfo, but it's of 0 length - so check the class if we see this pattern
+ if (GregTech_API.mTranslocator && tTileEntity instanceof codechicken.translocator.TileLiquidTranslocator) return true;
+ if (gTileEntity != null && gTileEntity.getCoverBehaviorAtSide(tSide) instanceof GT_Cover_FluidRegulator) return true;
+
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean getGT6StyleConnection() {
+ // Yes if GT6 pipes are enabled
+ return GT_Mod.gregtechproxy.gt6Pipe;
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ super.doSound(aIndex, aX, aY, aZ);
+ if (aIndex == 9) {
+ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(4), 5, 1.0F, aX, aY, aZ);
+ for (byte i = 0; i < 6; i++)
+ getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5 + XSTR_INSTANCE.nextFloat(), aY - 0.5 + XSTR_INSTANCE.nextFloat(), aZ - 0.5 + XSTR_INSTANCE.nextFloat(), ForgeDirection.getOrientation(i).offsetX / 5.0, ForgeDirection.getOrientation(i).offsetY / 5.0, ForgeDirection.getOrientation(i).offsetZ / 5.0);
+ }
+ }
+
+ @Override
+ public final int getCapacity() {
+ return mCapacity * 20 * mPipeAmount;
+ }
+
+ @Override
+ public FluidTankInfo getInfo() {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ return new FluidTankInfo(tFluid, mCapacity * 20);
+ }
+ return new FluidTankInfo(null, mCapacity * 20);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
+ ArrayList<FluidTankInfo> tList = new ArrayList<>();
+ for (FluidStack tFluid : mFluids)
+ tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
+ return tList.toArray(new FluidTankInfo[mPipeAmount]);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public final FluidStack getFluid() {
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ return tFluid;
+ }
+ return null;
+ }
+
+ @Override
+ public final int getFluidAmount() {
+ int rAmount = 0;
+ for (FluidStack tFluid : mFluids) {
+ if (tFluid != null)
+ rAmount += tFluid.amount;
+ }
+ return rAmount;
+ }
+
+ @Override
+ public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+
+ int index = -1;
+ for (int i = 0; i < mPipeAmount; i++) {
+ if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
+ index = i; break;
+ }
+ else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
+ index = i;
+ }
+ }
+
+ return fill_default_intoIndex(aSide, aFluid, doFill, index);
+ }
+
+ private final int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
+ if (index < 0 || index >= mPipeAmount) return 0;
+ if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+
+ if (mFluids[index] == null || mFluids[index].getFluid().getID() <= 0) {
+ if (aFluid.amount * mPipeAmount <= getCapacity()) {
+ if (doFill) {
+ mFluids[index] = aFluid.copy();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ mFluids[index] = aFluid.copy();
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ mFluids[index].amount = getCapacity() / mPipeAmount;
+ }
+ return getCapacity() / mPipeAmount;
+ }
+
+ if (!mFluids[index].isFluidEqual(aFluid)) return 0;
+
+ int space = getCapacity() / mPipeAmount - mFluids[index].amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ mFluids[index].amount += aFluid.amount;
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ mFluids[index].amount = getCapacity() / mPipeAmount;
+ mLastReceivedFrom |= (1 << aSide.ordinal());
+ }
+ return space;
+ }
+
+ @Override
+ public final FluidStack drain(int maxDrain, boolean doDrain) {
+ FluidStack drained = null;
+ for (int i = 0; i < mPipeAmount; i++) {
+ if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
+ return drained;
+ }
+ return null;
+ }
+
+ private final FluidStack drainFromIndex(int maxDrain, boolean doDrain, int index) {
+ if (index < 0 || index >= mPipeAmount) return null;
+ if (mFluids[index] == null) return null;
+ if (mFluids[index].amount <= 0) {
+ mFluids[index] = null;
+ return null;
+ }
+
+ int used = maxDrain;
+ if (mFluids[index].amount < used)
+ used = mFluids[index].amount;
+
+ if (doDrain) {
+ mFluids[index].amount -= used;
+ }
+
+ FluidStack drained = mFluids[index].copy();
+ drained.amount = used;
+
+ if (mFluids[index].amount <= 0) {
+ mFluids[index] = null;
+ }
+
+ return drained;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return getFluidAmount() - (getCapacity() / 2);
+ }
+
+ @Override
+ public String[] getDescription() {
+ if (mPipeAmount == 1) {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
+ };
+ } else {
+ return new String[]{
+ EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
+ EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY
+ };
+ }
+ }
+
+ @Override
+ public float getThickNess() {
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x1) != 0) return 0.0625F;
+ return mThickNess;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return !isInputDisabledAtSide(aSide);
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return true;
+ }
+
+ public boolean isInputDisabledAtSide(int aSide) {
+ return (mDisableInput & (1 << aSide)) != 0;
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0)
+ return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 1, aZ + 1);
+ else
+ return getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ }
+
+ private AxisAlignedBB getActualCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ float tSpace = (1f - mThickNess)/2;
+ float tSide0 = tSpace;
+ float tSide1 = 1f - tSpace;
+ float tSide2 = tSpace;
+ float tSide3 = 1f - tSpace;
+ float tSide4 = tSpace;
+ float tSide5 = 1f - tSpace;
+
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;}
+ if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;}
+
+ byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections;
+ if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f;
+ if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f;
+ if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f;
+ if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f;
+ if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f;
+ if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f;
+
+ return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ }
+
+ @Override
+ public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) {
+ super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
+ if (GT_Mod.instance.isClientSide() && (GT_Client.hideValue & 0x2) != 0) {
+ AxisAlignedBB aabb = getActualCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb);
+ }
+ }
+}
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 75b682e825..6a735c869d 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -1,1832 +1,1832 @@
-package gregtech.api.util;
-
-import codechicken.nei.PositionedStack;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
-import gregtech.api.objects.GT_FluidStack;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.ItemData;
-import gregtech.api.objects.MaterialStack;
-import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack;
-import ic2.core.Ic2Items;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntityFurnace;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidContainerItem;
-
-import java.util.*;
-
-import static gregtech.api.enums.GT_Values.*;
-
-/**
- * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
- * <p/>
- * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
- * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
- * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
- * <p/>
- * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
- */
-public class GT_Recipe implements Comparable<GT_Recipe> {
- public static volatile int VERSION = 509;
- /**
- * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
- */
- public ItemStack[] mInputs, mOutputs;
- /**
- * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
- */
- public FluidStack[] mFluidInputs, mFluidOutputs;
- /**
- * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
- */
- public int[] mChances;
- /**
- * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
- */
- public Object mSpecialItems;
- public int mDuration, mEUt, mSpecialValue;
- /**
- * Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe.
- */
- public boolean mEnabled = true;
- /**
- * If this Recipe is hidden from NEI
- */
- public boolean mHidden = false;
- /**
- * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
- */
- public boolean mFakeRecipe = false;
- /**
- * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
- */
- public boolean mCanBeBuffered = true;
- /**
- * If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
- */
- public boolean mNeedsEmptyOutput = false;
- /**
- * Used for describing recipes that do not fit the default recipe pattern (for example Large Boiler Fuels)
- */
- private String[] neiDesc = null;
-
- private GT_Recipe(GT_Recipe aRecipe) {
- mInputs = GT_Utility.copyStackArray((Object[]) aRecipe.mInputs);
- mOutputs = GT_Utility.copyStackArray((Object[]) aRecipe.mOutputs);
- mSpecialItems = aRecipe.mSpecialItems;
- mChances = aRecipe.mChances;
- mFluidInputs = GT_Utility.copyFluidArray(aRecipe.mFluidInputs);
- mFluidOutputs = GT_Utility.copyFluidArray(aRecipe.mFluidOutputs);
- mDuration = aRecipe.mDuration;
- mSpecialValue = aRecipe.mSpecialValue;
- mEUt = aRecipe.mEUt;
- mNeedsEmptyOutput = aRecipe.mNeedsEmptyOutput;
- mCanBeBuffered = aRecipe.mCanBeBuffered;
- mFakeRecipe = aRecipe.mFakeRecipe;
- mEnabled = aRecipe.mEnabled;
- mHidden = aRecipe.mHidden;
- }
- protected GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (aInputs == null)
- aInputs = new ItemStack[0];
- if (aOutputs == null)
- aOutputs = new ItemStack[0];
- if (aFluidInputs == null)
- aFluidInputs = new FluidStack[0];
- if (aFluidOutputs == null)
- aFluidOutputs = new FluidStack[0];
- if (aChances == null)
- aChances = new int[aOutputs.length];
- if (aChances.length < aOutputs.length)
- aChances = Arrays.copyOf(aChances, aOutputs.length);
-
- aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
- aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
- aFluidInputs = GT_Utility.getArrayListWithoutNulls(aFluidInputs).toArray(new FluidStack[0]);
- aFluidOutputs = GT_Utility.getArrayListWithoutNulls(aFluidOutputs).toArray(new FluidStack[0]);
-
- GT_OreDictUnificator.setStackArray(true, aInputs);
- GT_OreDictUnificator.setStackArray(true, aOutputs);
-
- for (ItemStack tStack : aOutputs)
- GT_Utility.updateItemStack(tStack);
-
- for (int i = 0; i < aChances.length; i++)
- if (aChances[i] <= 0)
- aChances[i] = 10000;
- for (int i = 0; i < aFluidInputs.length; i++)
- aFluidInputs[i] = new GT_FluidStack(aFluidInputs[i]);
- for (int i = 0; i < aFluidOutputs.length; i++)
- aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]);
-
- for (ItemStack aInput : aInputs)
- if (aInput != null && Items.feather.getDamage(aInput) != W)
- for (int j = 0; j < aOutputs.length; j++) {
- if (GT_Utility.areStacksEqual(aInput, aOutputs[j])) {
- if (aInput.stackSize >= aOutputs[j].stackSize) {
- aInput.stackSize -= aOutputs[j].stackSize;
- aOutputs[j] = null;
- } else {
- aOutputs[j].stackSize -= aInput.stackSize;
- }
- }
- }
-
- if (aOptimize && aDuration >= 32) {
- ArrayList<ItemStack> tList = new ArrayList<>();
- tList.addAll(Arrays.asList(aInputs));
- tList.addAll(Arrays.asList(aOutputs));
- for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--);
-
- for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--)
- if (aDuration / i >= 16) {
- boolean temp = true;
- for (ItemStack stack : tList)
- if (stack.stackSize % i != 0) {
- temp = false;
- break;
- }
- if (temp)
- for (FluidStack aFluidInput : aFluidInputs)
- if (aFluidInput.amount % i != 0) {
- temp = false;
- break;
- }
- if (temp)
- for (FluidStack aFluidOutput : aFluidOutputs)
- if (aFluidOutput.amount % i != 0) {
- temp = false;
- break;
- }
- if (temp) {
- for (ItemStack itemStack : tList)
- itemStack.stackSize /= i;
- for (FluidStack aFluidInput : aFluidInputs)
- aFluidInput.amount /= i;
- for (FluidStack aFluidOutput : aFluidOutputs)
- aFluidOutput.amount /= i;
- aDuration /= i;
- }
- }
- }
-
- mInputs = aInputs;
- mOutputs = aOutputs;
- mSpecialItems = aSpecialItems;
- mChances = aChances;
- mFluidInputs = aFluidInputs;
- mFluidOutputs = aFluidOutputs;
- mDuration = aDuration;
- mSpecialValue = aSpecialValue;
- mEUt = aEUt;
-// checkCellBalance();
- }
-
- public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
- this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
- }
-
- // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
- public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
- this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
-
- if (mInputs.length > 0 && aSpecialValue > 0) {
- switch (aType) {
- // Diesel Generator
- case 0:
- GT_Recipe_Map.sDieselFuels.addRecipe(this);
- GT_Recipe_Map.sLargeBoilerFakeFuels.addDieselRecipe(this);
- break;
- // Gas Turbine
- case 1:
- GT_Recipe_Map.sTurbineFuels.addRecipe(this);
- break;
- // Thermal Generator
- case 2:
- GT_Recipe_Map.sHotFuels.addRecipe(this);
- break;
- // Plasma Generator
- case 4:
- GT_Recipe_Map.sPlasmaFuels.addRecipe(this);
- break;
- // Magic Generator
- case 5:
- GT_Recipe_Map.sMagicFuels.addRecipe(this);
- break;
- // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
- default:
- GT_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
- GT_Recipe_Map.sLargeBoilerFakeFuels.addDenseLiquidRecipe(this);
- break;
- }
- }
- }
-
- public GT_Recipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aSpecialValue) {
- this(true, null, null, null, null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aSpecialValue, 160000000), 0));
- if (mInputs.length > 1) {
- GT_Recipe_Map.sFusionRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
- this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, aDuration, aEUt, 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sLatheRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) {
- this(true, new ItemStack[]{aInput1, aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sDistillationRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) {
- this(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2 > 0 ? Math.min(aInput2, 64) : 1, new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1))}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sImplosionRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) {
- this(true, new ItemStack[]{aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize)}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sBenderRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) {
- this(true, aInput2 == null ? new ItemStack[]{aInput1} : new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sAlloySmelterRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, ItemStack aOutput2) {
- this(true, aInput2 == null ? new ItemStack[]{aInput1} : new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sCannerRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) {
- this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), 120, 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sVacuumRecipes.addRecipe(this);
- }
- }
-
- public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt, int VACUUM) {
- this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), aEUt, 0);
- if (mInputs.length > 0 && mOutputs[0] != null) {
- GT_Recipe_Map.sVacuumRecipes.addRecipe(this);
- }
- }
-
- //Dummy GT_Recipe maker...
- public GT_Recipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){
- this(true, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- }
-
- public static void reInit() {
- GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
- for (GT_Recipe_Map tMapEntry : GT_Recipe_Map.sMappings)
- tMapEntry.reInit();
- }
-
- // -----
- // Old Constructors, do not use!
- // -----
-
- public ItemStack getRepresentativeInput(int aIndex) {
- if (aIndex < 0 || aIndex >= mInputs.length) return null;
- return GT_Utility.copy(mInputs[aIndex]);
- }
-
- public ItemStack getOutput(int aIndex) {
- if (aIndex < 0 || aIndex >= mOutputs.length) return null;
- return GT_Utility.copy(mOutputs[aIndex]);
- }
-
- public int getOutputChance(int aIndex) {
- if (aIndex < 0 || aIndex >= mChances.length) return 10000;
- return mChances[aIndex];
- }
-
- public FluidStack getRepresentativeFluidInput(int aIndex) {
- if (aIndex < 0 || aIndex >= mFluidInputs.length || mFluidInputs[aIndex] == null) return null;
- return mFluidInputs[aIndex].copy();
- }
-
- public FluidStack getFluidOutput(int aIndex) {
- if (aIndex < 0 || aIndex >= mFluidOutputs.length || mFluidOutputs[aIndex] == null) return null;
- return mFluidOutputs[aIndex].copy();
- }
-
- public void checkCellBalance() {
- if (!D2 || mInputs.length < 1) return;
-
- int tInputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mInputs);
- int tOutputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mOutputs);
-
- if (tInputAmount < tOutputAmount) {
- if (!Materials.Tin.contains(mInputs)) {
- GT_Log.err.println("You get more Cells, than you put in? There must be something wrong.");
- new Exception().printStackTrace(GT_Log.err);
- }
- } else if (tInputAmount > tOutputAmount) {
- if (!Materials.Tin.contains(mOutputs)) {
- GT_Log.err.println("You get less Cells, than you put in? GT Machines usually don't destroy Cells.");
- new Exception().printStackTrace(GT_Log.err);
- }
- }
- }
-
- public GT_Recipe copy() {
- return new GT_Recipe(this);
- }
-
- public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
- return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
- }
-
- public static boolean GTppRecipeHelper;
-
- public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) {
- if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
- int amt;
- for (FluidStack tFluid : mFluidInputs)
- if (tFluid != null) {
- boolean temp = true;
- amt = tFluid.amount;
- for (FluidStack aFluid : aFluidInputs)
- if (aFluid != null && aFluid.isFluidEqual(tFluid)) {
- if (aDontCheckStackSizes) {
- temp = false;
- break;
- }
- amt -= aFluid.amount;
- if (amt < 1) {
- temp = false;
- break;
- }
- }
- if (temp) return false;
- }
-
- if (mInputs.length > 0 && aInputs == null) return false;
-
- for (ItemStack tStack : mInputs) {
- if (tStack != null) {
- amt = tStack.stackSize;
- boolean temp = true;
- for (ItemStack aStack : aInputs) {
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
- if (GTppRecipeHelper) {//remove once the fix is out
- if (GT_Utility.areStacksEqual(aStack, Ic2Items.FluidCell.copy(), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataStick.get(1L), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataOrb.get(1L), true)) {
- if (!GT_Utility.areStacksEqual(aStack, tStack, false))
- continue;
- }
- }
- if (aDontCheckStackSizes) {
- temp = false;
- break;
- }
- amt -= aStack.stackSize;
- if (amt < 1) {
- temp = false;
- break;
- }
- }
- }
- if (temp) return false;
- }
- }
- if (aDecreaseStacksizeBySuccess) {
- if (aFluidInputs != null) {
- for (FluidStack tFluid : mFluidInputs) {
- if (tFluid != null) {
- amt = tFluid.amount;
- for (FluidStack aFluid : aFluidInputs) {
- if (aFluid != null && aFluid.isFluidEqual(tFluid)) {
- if (aDontCheckStackSizes) {
- aFluid.amount -= amt;
- break;
- }
- if (aFluid.amount < amt) {
- amt -= aFluid.amount;
- aFluid.amount = 0;
- } else {
- aFluid.amount -= amt;
- amt = 0;
- break;
- }
- }
- }
- }
- }
- }
-
- if (aInputs != null) {
- for (ItemStack tStack : mInputs) {
- if (tStack != null) {
- amt = tStack.stackSize;
- for (ItemStack aStack : aInputs) {
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
- if (GTppRecipeHelper) {
- if (GT_Utility.areStacksEqual(aStack, Ic2Items.FluidCell.copy(), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataStick.get(1L), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataOrb.get(1L), true)) {
- if (!GT_Utility.areStacksEqual(aStack, tStack, false))
- continue;
- }
- }
- if (aDontCheckStackSizes){
- aStack.stackSize -= amt;
- break;
- }
- if (aStack.stackSize < amt){
- amt -= aStack.stackSize;
- aStack.stackSize = 0;
- }else{
- aStack.stackSize -= amt;
- amt = 0;
- break;
- }
- }
- }
- }
- }
- }
- }
-
- return true;
- }
-
- @Override
- public int compareTo(GT_Recipe recipe) {
- // first lowest tier recipes
- // then fastest
- // then with lowest special value
- // then dry recipes
- // then with fewer inputs
- if (this.mEUt != recipe.mEUt) {
- return this.mEUt - recipe.mEUt;
- } else if (this.mDuration != recipe.mDuration) {
- return this.mDuration - recipe.mDuration;
- } else if (this.mSpecialValue != recipe.mSpecialValue) {
- return this.mSpecialValue - recipe.mSpecialValue;
- } else if (this.mFluidInputs.length != recipe.mFluidInputs.length) {
- return this.mFluidInputs.length - recipe.mFluidInputs.length;
- } else if (this.mInputs.length != recipe.mInputs.length) {
- return this.mInputs.length - recipe.mInputs.length;
- }
- return 0;
- }
-
- public String[] getNeiDesc() {
- return neiDesc;
- }
-
- protected void setNeiDesc(String... neiDesc) {
- this.neiDesc = neiDesc;
- }
-
- /**
- * Overriding this method and getOutputPositionedStacks allows for custom NEI stack placement
- * @return A list of input stacks
- */
- public ArrayList<PositionedStack> getInputPositionedStacks(){
- return null;
- }
-
- /**
- * Overriding this method and getInputPositionedStacks allows for custom NEI stack placement
- * @return A list of output stacks
- */
- public ArrayList<PositionedStack> getOutputPositionedStacks(){
- return null;
- }
-
- public static class GT_Recipe_AssemblyLine{
- public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes = new ArrayList<GT_Recipe_AssemblyLine>();
-
- public ItemStack mResearchItem;
- public int mResearchTime;
- public ItemStack[] mInputs;
- public FluidStack[] mFluidInputs;
- public ItemStack mOutput;
- public int mDuration;
- public int mEUt;
- public ItemStack[][] mOreDictAlt;
-
- public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
- this(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt, new ItemStack[aInputs.length][]);
- }
-
- public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) {
- mResearchItem = aResearchItem;
- mResearchTime = aResearchTime;
- mInputs = aInputs;
- mFluidInputs = aFluidInputs;
- mOutput = aOutput;
- mDuration = aDuration;
- mEUt = aEUt;
- mOreDictAlt = aAlt;
- }
-
- }
-
- public static class GT_Recipe_Map {
- /**
- * Contains all Recipe Maps
- */
- public static final Collection<GT_Recipe_Map> sMappings = new ArrayList<>();
-
- public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map(new HashSet<>(500), "gt.recipe.orewasher", "Ore Washing Plant", null, RES_PATH_GUI + "basicmachines/OreWasher", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map(new HashSet<>(1000), "gt.recipe.thermalcentrifuge", "Thermal Centrifuge", null, RES_PATH_GUI + "basicmachines/ThermalCentrifuge", 1, 3, 1, 0, 2, E, 1, E, true, true);
- public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map(new HashSet<>(750), "gt.recipe.compressor", "Compressor", null, RES_PATH_GUI + "basicmachines/Compressor", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map(new HashSet<>(250), "gt.recipe.extractor", "Extractor", null, RES_PATH_GUI + "basicmachines/Extractor", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler(new HashSet<>(0), "ic.recipe.recycler", "Recycler", "ic2.recycler", RES_PATH_GUI + "basicmachines/Recycler", 1, 1, 1, 0, 1, E, 1, E, true, false);
- public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace(new HashSet<>(0), "mc.recipe.furnace", "Furnace", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 1, 0, 1, E, 1, E, true, false);
- public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave(new HashSet<>(0), "gt.recipe.microwave", "Microwave", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 1, 0, 1, E, 1, E, true, false);
-
- public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.scanner", "Scanner", null, RES_PATH_GUI + "basicmachines/Scanner", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map(new HashSet<>(200), "gt.recipe.rockbreaker", "Rock Breaker", null, RES_PATH_GUI + "basicmachines/RockBreaker", 1, 1, 0, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map(new HashSet<>(1000), "gt.recipe.byproductlist", "Ore Byproduct List", null, RES_PATH_GUI + "basicmachines/Default", 1, 6, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sReplicatorFakeRecipes = new GT_Recipe_Map(new HashSet<>(100), "gt.recipe.replicator", "Replicator", null, RES_PATH_GUI + "basicmachines/Replicator", 0, 1, 0, 1, 1, E, 1, E, true, true);
- //public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet<>(30), "gt.recipe.scanner", "Scanner", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map(new HashSet<>(110), "gt.recipe.fakeAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, false);
- public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map(new HashSet<>(20000), "gt.recipe.plasmaarcfurnace", "Plasma Arc Furnace", null, RES_PATH_GUI + "basicmachines/PlasmaArcFurnace", 1, 4, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map(new HashSet<>(20000), "gt.recipe.arcfurnace", "Arc Furnace", null, RES_PATH_GUI + "basicmachines/ArcFurnace", 1, 4, 1, 1, 3, E, 1, E, true, true);
- public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer(new HashSet<>(5), "gt.recipe.printer", "Printer", null, RES_PATH_GUI + "basicmachines/Printer", 1, 1, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sSifterRecipes = new GT_Recipe_Map(new HashSet<>(105), "gt.recipe.sifter", "Sifter", null, RES_PATH_GUI + "basicmachines/Sifter", 1, 9, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sPressRecipes = new GT_Recipe_Map_FormingPress(new HashSet<>(300), "gt.recipe.press", "Forming Press", null, RES_PATH_GUI + "basicmachines/Press", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sLaserEngraverRecipes = new GT_Recipe_Map(new HashSet<>(810), "gt.recipe.laserengraver", "Precision Laser Engraver", null, RES_PATH_GUI + "basicmachines/LaserEngraver", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sMixerRecipes = new GT_Recipe_Map(new HashSet<>(900), "gt.recipe.mixer", "Mixer", null, RES_PATH_GUI + "basicmachines/Mixer2", 9, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.autoclave", "Autoclave", null, RES_PATH_GUI + "basicmachines/Autoclave", 1, 1, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map(new HashSet<>(50), "gt.recipe.electromagneticseparator", "Electromagnetic Separator", null, RES_PATH_GUI + "basicmachines/ElectromagneticSeparator", 1, 3, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.polarizer", "Electromagnetic Polarizer", null, RES_PATH_GUI + "basicmachines/Polarizer", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator(new HashSet<>(16600), "gt.recipe.macerator", "Pulverization", null, RES_PATH_GUI + "basicmachines/Macerator4", 1, 4, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<>(2550), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner(new HashSet<>(2100), "gt.recipe.fluidcanner", "Fluid Canning Machine", null, RES_PATH_GUI + "basicmachines/FluidCannerNEI", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map(new HashSet<>(450), "gt.recipe.brewer", "Brewing Machine", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 0, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sFluidHeaterRecipes = new GT_Recipe_Map(new HashSet<>(10), "gt.recipe.fluidheater", "Fluid Heater", null, RES_PATH_GUI + "basicmachines/FluidHeater", 1, 0, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sDistilleryRecipes = new GT_Recipe_Map(new HashSet<>(400), "gt.recipe.distillery", "Distillery", null, RES_PATH_GUI + "basicmachines/Distillery", 1, 1, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sFermentingRecipes = new GT_Recipe_Map(new HashSet<>(50), "gt.recipe.fermenter", "Fermenter", null, RES_PATH_GUI + "basicmachines/Fermenter", 0, 0, 0, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sFluidSolidficationRecipes = new GT_Recipe_Map(new HashSet<>(35000), "gt.recipe.fluidsolidifier", "Fluid Solidifier", null, RES_PATH_GUI + "basicmachines/FluidSolidifier", 1, 1, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sFluidExtractionRecipes = new GT_Recipe_Map(new HashSet<>(15000), "gt.recipe.fluidextractor", "Fluid Extractor", null, RES_PATH_GUI + "basicmachines/FluidExtractor", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sBoxinatorRecipes = new GT_Recipe_Map(new HashSet<>(2500), "gt.recipe.packager", "Packager", null, RES_PATH_GUI + "basicmachines/Packager", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sUnboxinatorRecipes = new GT_Recipe_Map_Unboxinator(new HashSet<>(2500), "gt.recipe.unpackager", "Unpackager", null, RES_PATH_GUI + "basicmachines/Unpackager", 1, 2, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sFusionRecipes = new GT_Recipe_Map(new HashSet<>(50), "gt.recipe.fusionreactor", "Fusion Reactor", null, RES_PATH_GUI + "basicmachines/FusionReactor", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true);
- public static final GT_Recipe_Map sCentrifugeRecipes = new GT_Recipe_Map(new HashSet<>(1200), "gt.recipe.centrifuge", "Centrifuge", null, RES_PATH_GUI + "basicmachines/Centrifuge", 2, 6, 0, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sElectrolyzerRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.electrolyzer", "Electrolyzer", null, RES_PATH_GUI + "basicmachines/Electrolyzer", 2, 6, 0, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sBlastRecipes = new GT_Recipe_Map(new HashSet<>(800), "gt.recipe.blastfurnace", "Blast Furnace", null, RES_PATH_GUI + "basicmachines/Default", 2, 2, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true);
- public static final GT_Recipe_Map sPrimitiveBlastRecipes = new GT_Recipe_Map(new HashSet<>(200), "gt.recipe.primitiveblastfurnace", "Primitive Blast Furnace", null, RES_PATH_GUI + "basicmachines/Default", 3, 3, 1, 0, 1, E, 1, E, false, true);
- public static final GT_Recipe_Map sImplosionRecipes = new GT_Recipe_Map(new HashSet<>(900), "gt.recipe.implosioncompressor", "Implosion Compressor", null, RES_PATH_GUI + "basicmachines/Default", 2, 2, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sVacuumRecipes = new GT_Recipe_Map(new HashSet<>(305), "gt.recipe.vacuumfreezer", "Vacuum Freezer", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 1, 0, 1, E, 1, E, false, true);
- public static final GT_Recipe_Map sChemicalRecipes = new GT_Recipe_Map(new HashSet<>(1170), "gt.recipe.chemicalreactor", "Chemical Reactor", null, RES_PATH_GUI + "basicmachines/ChemicalReactor", 2, 2, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sMultiblockChemicalRecipes = new GT_Recipe_Map_LargeChemicalReactor();
- public static final GT_Recipe_Map sDistillationRecipes = new GT_Recipe_Map_DistillationTower();
- public static final GT_Recipe_Map sCrakingRecipes = new GT_Recipe_Map(new HashSet<>(70), "gt.recipe.craker", "Oil Cracker", null, RES_PATH_GUI + "basicmachines/OilCracker", 1, 1, 1, 2, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sPyrolyseRecipes = new GT_Recipe_Map(new HashSet<>(150), "gt.recipe.pyro", "Pyrolyse Oven", null, RES_PATH_GUI + "basicmachines/Default", 2, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sWiremillRecipes = new GT_Recipe_Map(new HashSet<>(450), "gt.recipe.wiremill", "Wiremill", null, RES_PATH_GUI + "basicmachines/Wiremill", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sBenderRecipes = new GT_Recipe_Map(new HashSet<>(5000), "gt.recipe.metalbender", "Bending Machine", null, RES_PATH_GUI + "basicmachines/Bender", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sAlloySmelterRecipes = new GT_Recipe_Map(new HashSet<>(12000), "gt.recipe.alloysmelter", "Alloy Smelter", null, RES_PATH_GUI + "basicmachines/AlloySmelter", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet<>(8200), "gt.recipe.assembler", "Assembler", null, RES_PATH_GUI + "basicmachines/Assembler2", 9, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sCircuitAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet<>(605), "gt.recipe.circuitassembler", "Circuit Assembler", null, RES_PATH_GUI + "basicmachines/CircuitAssembler", 6, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sCannerRecipes = new GT_Recipe_Map(new HashSet<>(900), "gt.recipe.canner", "Canning Machine", null, RES_PATH_GUI + "basicmachines/Canner", 2, 2, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sCNCRecipes = new GT_Recipe_Map(new HashSet<>(100), "gt.recipe.cncmachine", "CNC Machine", null, RES_PATH_GUI + "basicmachines/Default", 2, 1, 2, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sLatheRecipes = new GT_Recipe_Map(new HashSet<>(1150), "gt.recipe.lathe", "Lathe", null, RES_PATH_GUI + "basicmachines/Lathe", 1, 2, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sCutterRecipes = new GT_Recipe_Map(new HashSet<>(5125), "gt.recipe.cuttingsaw", "Cutting Machine", null, RES_PATH_GUI + "basicmachines/Cutter2", 2, 2, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sSlicerRecipes = new GT_Recipe_Map(new HashSet<>(20), "gt.recipe.slicer", "Slicing Machine", null, RES_PATH_GUI + "basicmachines/Slicer", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sExtruderRecipes = new GT_Recipe_Map(new HashSet<>(13000), "gt.recipe.extruder", "Extruder", null, RES_PATH_GUI + "basicmachines/Extruder", 2, 1, 2, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sHammerRecipes = new GT_Recipe_Map(new HashSet<>(3800), "gt.recipe.hammer", "Forge Hammer", null, RES_PATH_GUI + "basicmachines/Hammer", 1, 1, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map(new HashSet<>(2), "gt.recipe.uuamplifier", "Amplifabricator", null, RES_PATH_GUI + "basicmachines/Amplifabricator", 1, 0, 1, 0, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sMassFabFakeRecipes = new GT_Recipe_Map(new HashSet<>(2), "gt.recipe.massfab", "Mass Fabrication", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 0, 1, 0, 10, E, 1, E, true, true);
- public static final GT_Recipe_Map_Fuel sDieselFuels = new GT_Recipe_Map_Fuel(new HashSet<>(20), "gt.recipe.dieselgeneratorfuel", "Diesel Generator Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sTurbineFuels = new GT_Recipe_Map_Fuel(new HashSet<>(25), "gt.recipe.gasturbinefuel", "Gas Turbine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel(new HashSet<>(10), "gt.recipe.thermalgeneratorfuel", "Thermal Generator Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, false);
- public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet<>(15), "gt.recipe.semifluidboilerfuels", "Semifluid Boiler Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sPlasmaFuels = new GT_Recipe_Map_Fuel(new HashSet<>(100), "gt.recipe.plasmageneratorfuels", "Plasma Generator Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sMagicFuels = new GT_Recipe_Map_Fuel(new HashSet<>(100), "gt.recipe.magicfuels", "Magic Energy Absorber", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.smallnaquadahreactor", "Naquadah Reactor MkI", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.largenaquadahreactor", "Naquadah Reactor MkII", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sHugeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.fluidnaquadahreactor", "Naquadah Reactor MkIII", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sExtremeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.hugenaquadahreactor", "Naquadah Reactor MkIV", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sUltraHugeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.extrahugenaquadahreactor", "Naquadah Reactor MkV", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_Fuel sFluidNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.fluidnaquadahreactor", "Fluid Naquadah Reactor", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
- public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = new GT_Recipe_Map_LargeBoilerFakeFuels();
-
- /**
- * HashMap of Recipes based on their Items
- */
- public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new /*Concurrent*/HashMap<>();
- /**
- * HashMap of Recipes based on their Fluids
- */
- public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new /*Concurrent*/HashMap<>();
- public final HashSet<String> mRecipeFluidNameMap = new HashSet<>();
- /**
- * The List of all Recipes
- */
- public final Collection<GT_Recipe> mRecipeList;
- /**
- * String used as an unlocalised Name.
- */
- public final String mUnlocalizedName;
- /**
- * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead
- */
- public final String mNEIName;
- /**
- * GUI used for NEI Display. Usually the GUI of the Machine itself
- */
- public final String mNEIGUIPath;
- public final String mNEISpecialValuePre, mNEISpecialValuePost;
- public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage;
- public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
-
- /**
- * Initialises a new type of Recipe Handler.
- *
- * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
- * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
- * @param aLocalName the displayed Name inside the NEI Recipe GUI.
- * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
- * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
- * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
- * @param aNEISpecialValuePre the String in front of the Special Value in NEI.
- * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying
- * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
- * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
- */
- public GT_Recipe_Map(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- sMappings.add(this);
- mNEIAllowed = aNEIAllowed;
- mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
- mRecipeList = aRecipeList;
- mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName;
- mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
- mNEISpecialValuePre = aNEISpecialValuePre;
- mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
- mNEISpecialValuePost = aNEISpecialValuePost;
- mAmperage = aAmperage;
- mUsualInputCount = aUsualInputCount;
- mUsualOutputCount = aUsualOutputCount;
- mMinimalInputItems = aMinimalInputItems;
- mMinimalInputFluids = aMinimalInputFluids;
- GregTech_API.sFluidMappings.add(mRecipeFluidMap);
- GregTech_API.sItemStackMappings.add(mRecipeItemMap);
- GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
- }
-
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GT_Recipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
- }
-
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- public GT_Recipe addRecipe(GT_Recipe aRecipe) {
- return addRecipe(aRecipe, true, false, false);
- }
-
- protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
- aRecipe.mHidden = aHidden;
- aRecipe.mFakeRecipe = aFakeRecipe;
- if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems)
- return null;
- if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)
- return null;
- return add(aRecipe);
- }
-
- /**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
- */
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- /**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
- */
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) {
- return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue),hidden);
- }
-
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt ,boolean hidden) {
- return addFakeRecipe(aCheckForCollisions, new GT_Recipe_WithAlt(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue, aAlt),hidden);
- }
-
- /**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
- */
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
- return addRecipe(aRecipe, aCheckForCollisions, true, false);
- }
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe,boolean hidden) {
- return addRecipe(aRecipe, aCheckForCollisions, true, hidden);
- }
-
- public GT_Recipe add(GT_Recipe aRecipe) {
- mRecipeList.add(aRecipe);
- for (FluidStack aFluid : aRecipe.mFluidInputs)
- if (aFluid != null) {
- Collection<GT_Recipe> tList = mRecipeFluidMap.computeIfAbsent(aFluid.getFluid(), k -> new HashSet<>(1));
- tList.add(aRecipe);
- mRecipeFluidNameMap.add(aFluid.getFluid().getName());
- }
- return addToItemMap(aRecipe);
- }
-
- public void reInit() {
- mRecipeItemMap.clear();
- for (GT_Recipe tRecipe : mRecipeList) {
- GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
- GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
- addToItemMap(tRecipe);
- }
- }
-
- /**
- * @return if this Item is a valid Input for any for the Recipes
- */
- public boolean containsInput(ItemStack aStack) {
- return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))));
- }
-
- /**
- * @return if this Fluid is a valid Input for any for the Recipes
- */
- public boolean containsInput(FluidStack aFluid) {
- return aFluid != null && containsInput(aFluid.getFluid());
- }
-
- /**
- * @return if this Fluid is a valid Input for any for the Recipes
- */
- public boolean containsInput(Fluid aFluid) {
- return aFluid != null && mRecipeFluidNameMap.contains(aFluid.getName());
- }
-
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
- return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
- }
-
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
- return findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs);
- }
-
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
- return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
- }
-
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
- return findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs);
- }
-
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- return findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot, aInputs);
- }
- /**
- * finds a Recipe matching the aFluid and ItemStack Inputs.
- *
- * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
- * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
- * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
- * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input
- * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
- * @param aFluids the Fluid Inputs
- * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
- * @param aInputs the Item Inputs
- * @return the Recipe it has found or null for no matching Recipe
- */
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- // No Recipes? Well, nothing to be found then.
- if (mRecipeList.isEmpty()) return null;
-
- // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
- // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
- if (GregTech_API.sPostloadFinished) {
- if (mMinimalInputFluids > 0) {
- if (aFluids == null) return null;
- int tAmount = 0;
- for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
- if (tAmount < mMinimalInputFluids) return null;
- }
- if (mMinimalInputItems > 0) {
- if (aInputs == null) return null;
- int tAmount = 0;
- for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
- if (tAmount < mMinimalInputItems) return null;
- }
- }
-
- // Unification happens here in case the Input isn't already unificated.
- if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, aInputs);
-
- // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
- if (aRecipe != null)
- if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
-
- // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
- if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
- if (tStack != null) {
- Collection<GT_Recipe>
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
- if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
-
- // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
- if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
- if (aFluid != null) {
- Collection<GT_Recipe>
- tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
-
- // And nothing has been found.
- return null;
- }
-
- protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
- for (ItemStack aStack : aRecipe.mInputs)
- if (aStack != null) {
- GT_ItemStack tStack = new GT_ItemStack(aStack);
- Collection<GT_Recipe> tList = mRecipeItemMap.computeIfAbsent(tStack, k -> new HashSet<>(1));
- tList.add(aRecipe);
- }
- return aRecipe;
- }
- }
-
- // -----------------------------------------------------------------------------------------------------------------
- // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class.
- // -----------------------------------------------------------------------------------------------------------------
-
- /**
- * Abstract Class for general Recipe Handling of non GT Recipes
- */
- public static abstract class GT_Recipe_Map_NonGTRecipes extends GT_Recipe_Map {
- public GT_Recipe_Map_NonGTRecipes(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean containsInput(FluidStack aFluid) {
- return false;
- }
-
- @Override
- public boolean containsInput(Fluid aFluid) {
- return false;
- }
-
- @Override
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GT_Recipe addRecipe(GT_Recipe aRecipe) {
- return null;
- }
-
- @Override
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return null;
- }
-
- @Override
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) {
- return null;
- }
-
- @Override
- public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
- return null;
- }
-
- @Override
- public GT_Recipe add(GT_Recipe aRecipe) {
- return null;
- }
-
- @Override
- public void reInit() {/**/}
-
- @Override
- protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
- return null;
- }
- }
-
- /**
- * Just a Recipe Map with Utility specifically for Fuels.
- */
- public static class GT_Recipe_Map_Fuel extends GT_Recipe_Map {
- public GT_Recipe_Map_Fuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
- return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
- }
-
- public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
- return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
- }
-
- public GT_Recipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
- return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
- }
-
- public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
- return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
- }
-
- public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
- return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
- }
- }
-
- /**
- * Special Class for Furnace Recipe handling.
- */
- public static class GT_Recipe_Map_Furnace extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Furnace(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null);
- return tOutput == null ? null : new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 4, 0);
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_ModHandler.getSmeltingOutput(aStack, false, null) != null;
- }
- }
-
- /**
- * Special Class for Microwave Recipe handling.
- */
- public static class GT_Recipe_Map_Microwave extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Microwave(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null);
-
- if (GT_Utility.areStacksEqual(aInputs[0], new ItemStack(Items.book, 1, W))) {
- return new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1))}, null, null, null, null, 32, 4, 0);
- }
-
- // Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of Output and last check the Output itself
- for (ItemStack tStack : new ItemStack[]{GT_Utility.getContainerItem(aInputs[0], true), aInputs[0], GT_Utility.getContainerItem(tOutput, true), tOutput})
- if (tStack != null) {
- if (GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.netherrack, 1, W), true)
- || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true)
- || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), true)
- || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), true)
- || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), true)
- || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), true)
- ) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- GT_Log.exp.println("Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE");
- ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
- }
- return null;
- }
- ItemData tData = GT_OreDictUnificator.getItemData(tStack);
-
-
- if (tData != null) {
- if (tData.mMaterial != null && tData.mMaterial.mMaterial != null) {
- if (tData.mMaterial.mMaterial.contains(SubTag.METAL) || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- GT_Log.exp.println("Microwave Explosion due to METAL insertion");
- ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
- }
- return null;
- }
- if (tData.mMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion");
- ((IGregTechTileEntity) aTileEntity).setOnFire();
- }
- return null;
- }
- }
- for (MaterialStack tMaterial : tData.mByProducts)
- if (tMaterial != null) {
- if (tMaterial.mMaterial.contains(SubTag.METAL) || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- GT_Log.exp.println("Microwave Explosion due to METAL insertion");
- ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
- }
- return null;
- }
- if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- ((IGregTechTileEntity) aTileEntity).setOnFire();
- GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion");
- }
- return null;
- }
- }
- }
- if (TileEntityFurnace.getItemBurnTime(tStack) > 0) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- ((IGregTechTileEntity) aTileEntity).setOnFire();
- GT_Log.exp.println("Microwave INFLAMMATION due to BURNABLE insertion");
- }
- return null;
- }
-
- }
-
- return tOutput == null ? null : new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 32, 4, 0);
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_ModHandler.getSmeltingOutput(aStack, false, null) != null;
- }
- }
-
- /**
- * Special Class for Unboxinator handling.
- */
- public static class GT_Recipe_Map_Unboxinator extends GT_Recipe_Map {
- public GT_Recipe_Map_Unboxinator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || !ItemList.IC2_Scrapbox.isStackEqual(aInputs[0], false, true))
- return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- ItemStack tOutput = GT_ModHandler.getRandomScrapboxDrop();
- if (tOutput == null)
- return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- GT_Recipe rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.IC2_Scrapbox.get(1)}, new ItemStack[]{tOutput}, null, null, null, null, 16, 1, 0);
- // It is not allowed to be buffered due to the random Output
- rRecipe.mCanBeBuffered = false;
- // Due to its randomness it is not good if there are Items in the Output Slot, because those Items could manipulate the outcome.
- rRecipe.mNeedsEmptyOutput = true;
- return rRecipe;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return ItemList.IC2_Scrapbox.isStackEqual(aStack, false, true) || super.containsInput(aStack);
- }
- }
-
- /**
- * Special Class for Fluid Canner handling.
- */
- public static class GT_Recipe_Map_FluidCanner extends GT_Recipe_Map {
- public GT_Recipe_Map_FluidCanner(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe != null || !GregTech_API.sPostloadFinished)
- return rRecipe;
- if (aFluids != null && aFluids.length > 0 && aFluids[0] != null) {
- ItemStack tOutput = GT_Utility.fillFluidContainer(aFluids[0], aInputs[0], false, true);
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
- if (tFluid != null)
- rRecipe = new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, new FluidStack[]{tFluid}, null, Math.max(tFluid.amount / 64, 16), 1, 0);
- }
- if (rRecipe == null) {
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInputs[0], true);
- if (tFluid != null)
- rRecipe = new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{GT_Utility.getContainerItem(aInputs[0], true)}, null, null, null, new FluidStack[]{tFluid}, Math.max(tFluid.amount / 64, 16), 1, 0);
- }
- if (rRecipe != null) rRecipe.mCanBeBuffered = false;
- return rRecipe;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return aStack != null && (super.containsInput(aStack) || (aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0));
- }
-
- @Override
- public boolean containsInput(FluidStack aFluid) {
- return true;
- }
-
- @Override
- public boolean containsInput(Fluid aFluid) {
- return true;
- }
- }
-
- /**
- * Special Class for Recycler Recipe handling.
- */
- public static class GT_Recipe_Map_Recycler extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Recycler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- return new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null : new ItemStack[]{ItemList.IC2_Scrap.get(1)}, null, new int[]{1250}, null, null, 45, 1, 0);
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aStack), 0) != null;
- }
- }
-
- /**
- * Special Class for Compressor Recipe handling.
- */
- public static class GT_Recipe_Map_Compressor extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Compressor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
- ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.compressor.getRecipes(), true, new NBTTagCompound(), null, null, null);
- return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.compressor.getRecipes(), false, new NBTTagCompound(), null, null, null));
- }
- }
-
- /**
- * Special Class for Extractor Recipe handling.
- */
- public static class GT_Recipe_Map_Extractor extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Extractor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
- ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.extractor.getRecipes(), true, new NBTTagCompound(), null, null, null);
- return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.extractor.getRecipes(), false, new NBTTagCompound(), null, null, null));
- }
- }
-
- /**
- * Special Class for Thermal Centrifuge Recipe handling.
- */
- public static class GT_Recipe_Map_ThermalCentrifuge extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_ThermalCentrifuge(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
- ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.centrifuge.getRecipes(), true, new NBTTagCompound(), null, null, null);
- return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 48, 0) : null;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.centrifuge.getRecipes(), false, new NBTTagCompound(), null, null, null));
- }
- }
-
- /**
- * Special Class for Ore Washer Recipe handling.
- */
- public static class GT_Recipe_Map_OreWasher extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_OreWasher(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || aFluids == null || aFluids.length < 1 || !GT_ModHandler.isWater(aFluids[0]))
- return null;
- if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
- ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
- NBTTagCompound aRecipeMetaData = new NBTTagCompound();
- ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.oreWashing.getRecipes(), true, aRecipeMetaData, null, null, null);
- return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, new FluidStack[]{new FluidStack(aFluids[0].getFluid(), ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount"))}, null, 400, 16, 0) : null;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.oreWashing.getRecipes(), false, new NBTTagCompound(), null, null, null));
- }
-
- @Override
- public boolean containsInput(FluidStack aFluid) {
- return GT_ModHandler.isWater(aFluid);
- }
-
- @Override
- public boolean containsInput(Fluid aFluid) {
- return GT_ModHandler.isWater(new FluidStack(aFluid, 0));
- }
- }
-
- /**
- * Special Class for Macerator/RockCrusher Recipe handling.
- */
- public static class GT_Recipe_Map_Macerator extends GT_Recipe_Map {
- public GT_Recipe_Map_Macerator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || !GregTech_API.sPostloadFinished)
- return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- aRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- if (aRecipe != null) return aRecipe;
-
- try {
- List<ItemStack> tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher.getRecipe(GT_Utility.copyAmount(1, aInputs[0])).getRandomizedOuputs();
- if (tRecipeOutputs != null) {
- aRecipe = new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, tRecipeOutputs.toArray(new ItemStack[0]), null, null, null, null, 800, 2, 0);
- aRecipe.mCanBeBuffered = false;
- aRecipe.mNeedsEmptyOutput = true;
- return aRecipe;
- }
- } catch (NoClassDefFoundError e) {
- if (D1) GT_Log.err.println("Railcraft Not loaded");
- } catch (NullPointerException e) {/**/}
-
- ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
- ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.macerator.getRecipes(), true, new NBTTagCompound(), null, null, null);
- return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return super.containsInput(aStack) || GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.macerator.getRecipes(), false, new NBTTagCompound(), null, null, null));
- }
- }
-
- /**
- * Special Class for Assembler handling.
- */
- public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map {
-
- public GT_Recipe_Map_Assembler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
-
- GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, true, aVoltage, aFluids, aSpecialSlot, aInputs);
-/*
-
-
- Doesnt work, keep it as a reminder tho
-
- if (rRecipe == null){
- Set<ItemStack> aInputs2 = new TreeSet<ItemStack>();
- for (ItemStack aInput : aInputs) {
- aInputs2.add(aInput);
- }
-
- for (ItemStack aInput : aInputs) {
- aInputs2.remove(aInput);
- int[] oredictIDs = OreDictionary.getOreIDs(aInput);
- if ( oredictIDs.length > 1){
- for (final int i : oredictIDs){
- final ItemStack[] oredictIS = (ItemStack[]) OreDictionary.getOres(OreDictionary.getOreName(i)).toArray();
- if (oredictIS != null && oredictIS.length > 1){
- for (final ItemStack IS : oredictIS){
- aInputs2.add(IS);
- ItemStack[] temp = (ItemStack[]) aInputs2.toArray();
- rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot,temp);
- if(rRecipe!= null){
- break;
- }
- else {
- aInputs2.remove(IS);
- }
- }
- if(rRecipe!= null)
- break;
- }
- }
- if(rRecipe!= null)
- break;
- }else
- aInputs2.add(aInput);
- if(rRecipe!= null)
- break;
- }
- }
-*/
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe == null || !GregTech_API.sPostloadFinished)
- return rRecipe;
-
- for (ItemStack aInput : aInputs) {
- if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, false, true)) {
- rRecipe = rRecipe.copy();
- rRecipe.mCanBeBuffered = false;
- rRecipe.mOutputs[0].setTagCompound(aInput.getTagCompound());
- }
-
- }
- return rRecipe;
- }
-
- }
-
- /**
- * Special Class for Forming Press handling.
- */
- public static class GT_Recipe_Map_FormingPress extends GT_Recipe_Map {
- public GT_Recipe_Map_FormingPress(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- if (aInputs == null || aInputs.length < 2 || aInputs[0] == null || aInputs[1] == null || !GregTech_API.sPostloadFinished)
- return rRecipe;
- if (rRecipe == null) {
- if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[0], false, true)) {
- ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[1]);
- tOutput.setStackDisplayName(aInputs[0].getDisplayName());
- rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[1])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 8, 0);
- rRecipe.mCanBeBuffered = false;
- return rRecipe;
- }
- if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[1], false, true)) {
- ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[0]);
- tOutput.setStackDisplayName(aInputs[1].getDisplayName());
- rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 8, 0);
- rRecipe.mCanBeBuffered = false;
- return rRecipe;
- }
- return null;
- }
- for (ItemStack aMold : aInputs) {
- if (ItemList.Shape_Mold_Credit.isStackEqual(aMold, false, true)) {
- NBTTagCompound tNBT = aMold.getTagCompound();
- if (tNBT == null) tNBT = new NBTTagCompound();
- if (!tNBT.hasKey("credit_security_id")) tNBT.setLong("credit_security_id", System.nanoTime());
- aMold.setTagCompound(tNBT);
-
- rRecipe = rRecipe.copy();
- rRecipe.mCanBeBuffered = false;
- rRecipe.mOutputs[0].setTagCompound(tNBT);
- return rRecipe;
- }
- }
- return rRecipe;
- }
- }
-
- /**
- * Special Class for Printer handling.
- */
- public static class GT_Recipe_Map_Printer extends GT_Recipe_Map {
- public GT_Recipe_Map_Printer(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
- super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
- }
-
- @Override
- public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
- GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || aFluids == null || aFluids.length <= 0 || aFluids[0] == null || !GregTech_API.sPostloadFinished)
- return rRecipe;
-
- Dyes aDye = null;
- for (Dyes tDye : Dyes.VALUES)
- if (tDye.isFluidDye(aFluids[0])) {
- aDye = tDye;
- break;
- }
-
- if (aDye == null) return rRecipe;
-
- if (rRecipe == null) {
- ItemStack
- tOutput = GT_ModHandler.getAllRecipeOutput(aTileEntity == null ? null : aTileEntity.getWorld(), aInputs[0], aInputs[0], aInputs[0], aInputs[0], ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), aInputs[0], aInputs[0], aInputs[0], aInputs[0]);
- if (tOutput != null)
- return addRecipe(new GT_Recipe(true, new ItemStack[]{GT_Utility.copyAmount(8, aInputs[0])}, new ItemStack[]{tOutput}, null, null, new FluidStack[]{new FluidStack(aFluids[0].getFluid(), (int) L)}, null, 256, 2, 0), false, false, true);
-
- tOutput = GT_ModHandler.getAllRecipeOutput(aTileEntity == null ? null : aTileEntity.getWorld(), aInputs[0], ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1));
- if (tOutput != null)
- return addRecipe(new GT_Recipe(true, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, new FluidStack[]{new FluidStack(aFluids[0].getFluid(), (int) L)}, null, 32, 2, 0), false, false, true);
- } else {
- if (aInputs[0].getItem() == Items.paper) {
- if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
- NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
- if (tNBT == null || GT_Utility.isStringInvalid(tNBT.getString("title")) || GT_Utility.isStringInvalid(tNBT.getString("author")))
- return null;
-
- rRecipe = rRecipe.copy();
- rRecipe.mCanBeBuffered = false;
- rRecipe.mOutputs[0].setTagCompound(tNBT);
- return rRecipe;
- }
- if (aInputs[0].getItem() == Items.map) {
- if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
- NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
- if (tNBT == null || !tNBT.hasKey("map_id")) return null;
-
- rRecipe = rRecipe.copy();
- rRecipe.mCanBeBuffered = false;
- rRecipe.mOutputs[0].setItemDamage(tNBT.getShort("map_id"));
- return rRecipe;
- }
- if (ItemList.Paper_Punch_Card_Empty.isStackEqual(aInputs[0], false, true)) {
- if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
- NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
- if (tNBT == null || !tNBT.hasKey("GT.PunchCardData")) return null;
-
- rRecipe = rRecipe.copy();
- rRecipe.mCanBeBuffered = false;
- rRecipe.mOutputs[0].setTagCompound(GT_Utility.getNBTContainingString(new NBTTagCompound(), "GT.PunchCardData", tNBT.getString("GT.PunchCardData")));
- return rRecipe;
- }
- }
- return rRecipe;
- }
-
- @Override
- public boolean containsInput(ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean containsInput(FluidStack aFluid) {
- return super.containsInput(aFluid) || Dyes.isAnyFluidDye(aFluid);
- }
-
- @Override
- public boolean containsInput(Fluid aFluid) {
- return super.containsInput(aFluid) || Dyes.isAnyFluidDye(aFluid);
- }
- }
-
- public static class GT_Recipe_Map_LargeBoilerFakeFuels extends GT_Recipe_Map {
-
- public GT_Recipe_Map_LargeBoilerFakeFuels() {
- super(new HashSet<>(55), "gt.recipe.largeboilerfakefuels", "Large Boiler", null, RES_PATH_GUI + "basicmachines/Default", 1, 0, 1, 0, 1, E, 1, E, true, true);
- GT_Recipe explanatoryRecipe = new GT_Recipe(true, new ItemStack[]{}, new ItemStack[]{}, null, null, null, null, 1, 1, 1);
- explanatoryRecipe.setNeiDesc("Not all solid fuels are listed.", "Any item that burns in a", "vanilla furnace will burn in", "a Large Boiler.");
- addRecipe(explanatoryRecipe);
- }
-
- public GT_Recipe addDenseLiquidRecipe(GT_Recipe recipe) {
- return addRecipe(recipe, ((double) recipe.mSpecialValue) / 10);
- }
-
- public GT_Recipe addDieselRecipe(GT_Recipe recipe) {
- return addRecipe(recipe, ((double) recipe.mSpecialValue) / 40);
- }
-
- public void addSolidRecipes(ItemStack... itemStacks) {
- for (ItemStack itemStack : itemStacks) {
- addSolidRecipe(itemStack);
- }
- }
-
- public GT_Recipe addSolidRecipe(ItemStack fuelItemStack) {
- return addRecipe(new GT_Recipe(true, new ItemStack[]{fuelItemStack}, new ItemStack[]{}, null, null, null, null, 1, 0, GT_ModHandler.getFuelValue(fuelItemStack) / 1600), ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600);
- }
-
- private GT_Recipe addRecipe(GT_Recipe recipe, double baseBurnTime) {
- recipe = new GT_Recipe(recipe);
- //Some recipes will have a burn time like 15.9999999 and % always rounds down
- double floatErrorCorrection = 0.0001;
-
- double bronzeBurnTime = baseBurnTime * 2 + floatErrorCorrection;
- bronzeBurnTime -= bronzeBurnTime % 0.05;
- double steelBurnTime = baseBurnTime * 1.5 + floatErrorCorrection;
- steelBurnTime -= steelBurnTime % 0.05;
- double titaniumBurnTime = baseBurnTime * 1.3 + floatErrorCorrection;
- titaniumBurnTime -= titaniumBurnTime % 0.05;
- double tungstensteelBurnTime = baseBurnTime * 1.2 + floatErrorCorrection;
- tungstensteelBurnTime -= tungstensteelBurnTime % 0.05;
-
- recipe.setNeiDesc("Burn time in seconds:",
- String.format("Bronze Boiler: %.4f", bronzeBurnTime),
- String.format("Steel Boiler: %.4f", steelBurnTime),
- String.format("Titanium Boiler: %.4f", titaniumBurnTime),
- String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime));
- return super.addRecipe(recipe);
- }
-
- }
-
- public static class GT_Recipe_Map_LargeChemicalReactor extends GT_Recipe_Map{
- private static int TOTAL_INPUT_COUNT = 6;
- private static int OUTPUT_COUNT = 2;
- private static int FLUID_OUTPUT_COUNT = 4;
-
- public GT_Recipe_Map_LargeChemicalReactor() {
- super(new HashSet<>(1000), "gt.recipe.largechemicalreactor", "Large Chemical Reactor", null, RES_PATH_GUI + "basicmachines/Default", 2, OUTPUT_COUNT, 0, 0, 1, E, 1, E, true, true);
- }
-
- @Override
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- aOptimize = false;
- ArrayList<ItemStack> adjustedInputs = new ArrayList<>();
- ArrayList<ItemStack> adjustedOutputs = new ArrayList<>();
- ArrayList<FluidStack> adjustedFluidInputs = new ArrayList<>();
- ArrayList<FluidStack> adjustedFluidOutputs = new ArrayList<>();
-
- if (aInputs == null) {
- aInputs = new ItemStack[0];
- } else {
- aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
- }
-
- for (ItemStack input : aInputs) {
- FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input);
- if (inputFluidContent != null) {
- inputFluidContent.amount *= input.stackSize;
- if (inputFluidContent.getFluid().getName().equals("ic2steam")) {
- inputFluidContent = GT_ModHandler.getSteam(inputFluidContent.amount);
- }
- adjustedFluidInputs.add(inputFluidContent);
- } else {
- ItemData itemData = GT_OreDictUnificator.getItemData(input);
- if (itemData != null && itemData.hasValidPrefixMaterialData() && itemData.mMaterial.mMaterial == Materials.Empty) {
- continue;
- } else {
- if (itemData != null && itemData.hasValidPrefixMaterialData() && itemData.mPrefix == OrePrefixes.cell) {
- ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize);
- if (dustStack != null) {
- adjustedInputs.add(dustStack);
- } else {
- adjustedInputs.add(input);
- }
- } else {
- adjustedInputs.add(input);
- }
- }
- }
-
- if (aFluidInputs == null) {
- aFluidInputs = new FluidStack[0];
- }
- }
- Collections.addAll(adjustedFluidInputs, aFluidInputs);
- aInputs = adjustedInputs.toArray(new ItemStack[0]);
- aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[0]);
-
- if (aOutputs == null) {
- aOutputs = new ItemStack[0];
- } else {
- aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
- }
-
- for (ItemStack output : aOutputs) {
- FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output);
- if (outputFluidContent != null) {
- outputFluidContent.amount *= output.stackSize;
- if (outputFluidContent.getFluid().getName().equals("ic2steam")) {
- outputFluidContent = GT_ModHandler.getSteam(outputFluidContent.amount);
- }
- adjustedFluidOutputs.add(outputFluidContent);
- } else {
- ItemData itemData = GT_OreDictUnificator.getItemData(output);
- if (!(itemData != null && itemData.hasValidPrefixMaterialData() && itemData.mMaterial.mMaterial == Materials.Empty)) {
- adjustedOutputs.add(output);
- }
- }
- }
- if (aFluidOutputs == null) {
- aFluidOutputs = new FluidStack[0];
- }
- Collections.addAll(adjustedFluidOutputs, aFluidOutputs);
- aOutputs = adjustedOutputs.toArray(new ItemStack[0]);
- aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[0]);
-
- return addRecipe(new GT_Recipe_LargeChemicalReactor(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- private static class GT_Recipe_LargeChemicalReactor extends GT_Recipe{
-
- protected GT_Recipe_LargeChemicalReactor(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- }
-
- @Override
- public ArrayList<PositionedStack> getInputPositionedStacks() {
- int itemLimit = Math.min(mInputs.length, TOTAL_INPUT_COUNT);
- int fluidLimit = Math.min(mFluidInputs.length, TOTAL_INPUT_COUNT - itemLimit);
- int inputlimit = itemLimit + fluidLimit;
- int j = 0;
-
- ArrayList<PositionedStack> inputStacks = new ArrayList<>(inputlimit);
-
- for (int i = 0; i < itemLimit; i++, j++) {
- if (this.mInputs == null || (this.mInputs[i] == null && (i == 0 && itemLimit == 1))) {
- if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
- GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
- else
- GT_Log.out.println("recipe " + this.toString() + " has errored!");
-
- new Exception("Recipe Fixme").printStackTrace(GT_Log.out);
- }
-
-
- if ((this.mInputs != null && this.mInputs[i] != null) || !GT_Values.allow_broken_recipemap)
- inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
- else
- inputStacks.add(new FixedPositionedStack(new ItemStack(Items.command_block_minecart), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
- }
-
- for (int i = 0; i < fluidLimit; i++, j++) {
- if (this.mFluidInputs == null || this.mFluidInputs[i] == null) {
- if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
- GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
- else
- GT_Log.out.println("recipe " + this.toString() + " has errored!");
-
- new Exception("Recipe Fixme").printStackTrace(GT_Log.out);
- }
-
- if ((this.mFluidInputs != null && this.mFluidInputs[i] != null) || !GT_Values.allow_broken_recipemap)
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
- }
-
- return inputStacks;
- }
-
- @Override
- public ArrayList<PositionedStack> getOutputPositionedStacks() {
- int itemLimit = Math.min(mOutputs.length, OUTPUT_COUNT);
- int fluidLimit = Math.min(mFluidOutputs.length, FLUID_OUTPUT_COUNT);
- ArrayList<PositionedStack> outputStacks = new ArrayList<>(itemLimit + fluidLimit);
-
- for (int i = 0; i < itemLimit; i++) {
- outputStacks.add(new FixedPositionedStack(this.mOutputs[i].copy(), 102 + i * 18, 5));
- }
-
- for (int i = 0; i < fluidLimit; i++) {
- outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true), 102 + i * 18, 23));
- }
-
- return outputStacks;
- }
-
-
- }
- }
- public static class GT_Recipe_Map_DistillationTower extends GT_Recipe_Map {
- private static final int FLUID_OUTPUT_COUNT = 11;
- private static final int ROW_SIZE = 3;
-
- public GT_Recipe_Map_DistillationTower() {
- super(new HashSet<>(110), "gt.recipe.distillationtower", "Distillation Tower", null, RES_PATH_GUI + "basicmachines/DistillationTower", 2, 4, 0, 0, 1, E, 1, E, true, true);
- }
-
- @Override
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(new GT_Recipe_DistillationTower(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
- }
-
- @Override
- public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- return addRecipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- }
-
- private static class GT_Recipe_DistillationTower extends GT_Recipe{
- protected GT_Recipe_DistillationTower(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- }
-
- @Override
- public ArrayList<PositionedStack> getInputPositionedStacks() {
- ArrayList<PositionedStack> inputStacks = new ArrayList<>(1);
-
- if (this.mFluidInputs.length > 0 && this.mFluidInputs[0] != null) {
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[0], true), 48, 52));
- }
- return inputStacks;
- }
- @Override
- public ArrayList<PositionedStack> getOutputPositionedStacks() {
- int fluidLimit = Math.min(mFluidOutputs.length, FLUID_OUTPUT_COUNT);
- ArrayList<PositionedStack> outputStacks = new ArrayList<>(1 + fluidLimit);
-
- if (this.mOutputs.length > 0 && this.mOutputs[0] != null) {
- outputStacks.add(new FixedPositionedStack(this.getOutput(0), 102, 52));
- }
-
- for (int i = 0; i < fluidLimit; i++) {
- int x = 102 + ((i + 1) % ROW_SIZE) * 18;
- int y = 52 - ((i + 1) / ROW_SIZE) * 18;
- outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true), x, y));
- }
- return outputStacks;
- }
-
- }
- }
-
- public static class GT_Recipe_WithAlt extends GT_Recipe {
-
- ItemStack[][] mOreDictAlt;
-
- public GT_Recipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt) {
- super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
- mOreDictAlt = aAlt;
- }
-
-
- public Object getAltRepresentativeInput(int aIndex) {
- if (aIndex < 0) return null;
- if (aIndex < mOreDictAlt.length) {
- if (mOreDictAlt[aIndex] != null && mOreDictAlt[aIndex].length > 0) {
- ItemStack[] rStacks = new ItemStack[mOreDictAlt[aIndex].length];
- for (int i = 0; i < mOreDictAlt[aIndex].length; i++) {
- rStacks[i] = GT_Utility.copy(mOreDictAlt[aIndex][i]);
- }
- return rStacks;
- }
- }
- if (aIndex >= mInputs.length) return null;
- return GT_Utility.copy(mInputs[aIndex]);
- }
-
- }
-}
+package gregtech.api.util;
+
+import codechicken.nei.PositionedStack;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.*;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
+import gregtech.api.objects.GT_FluidStack;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack;
+import ic2.core.Ic2Items;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntityFurnace;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+
+import java.util.*;
+
+import static gregtech.api.enums.GT_Values.*;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
+ * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
+ * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
+ * <p/>
+ * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
+ */
+public class GT_Recipe implements Comparable<GT_Recipe> {
+ public static volatile int VERSION = 509;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public ItemStack[] mInputs, mOutputs;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public FluidStack[] mFluidInputs, mFluidOutputs;
+ /**
+ * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
+ */
+ public int[] mChances;
+ /**
+ * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
+ */
+ public Object mSpecialItems;
+ public int mDuration, mEUt, mSpecialValue;
+ /**
+ * Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe.
+ */
+ public boolean mEnabled = true;
+ /**
+ * If this Recipe is hidden from NEI
+ */
+ public boolean mHidden = false;
+ /**
+ * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
+ */
+ public boolean mFakeRecipe = false;
+ /**
+ * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
+ */
+ public boolean mCanBeBuffered = true;
+ /**
+ * If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
+ */
+ public boolean mNeedsEmptyOutput = false;
+ /**
+ * Used for describing recipes that do not fit the default recipe pattern (for example Large Boiler Fuels)
+ */
+ private String[] neiDesc = null;
+
+ private GT_Recipe(GT_Recipe aRecipe) {
+ mInputs = GT_Utility.copyStackArray((Object[]) aRecipe.mInputs);
+ mOutputs = GT_Utility.copyStackArray((Object[]) aRecipe.mOutputs);
+ mSpecialItems = aRecipe.mSpecialItems;
+ mChances = aRecipe.mChances;
+ mFluidInputs = GT_Utility.copyFluidArray(aRecipe.mFluidInputs);
+ mFluidOutputs = GT_Utility.copyFluidArray(aRecipe.mFluidOutputs);
+ mDuration = aRecipe.mDuration;
+ mSpecialValue = aRecipe.mSpecialValue;
+ mEUt = aRecipe.mEUt;
+ mNeedsEmptyOutput = aRecipe.mNeedsEmptyOutput;
+ mCanBeBuffered = aRecipe.mCanBeBuffered;
+ mFakeRecipe = aRecipe.mFakeRecipe;
+ mEnabled = aRecipe.mEnabled;
+ mHidden = aRecipe.mHidden;
+ }
+ protected GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ if (aInputs == null)
+ aInputs = new ItemStack[0];
+ if (aOutputs == null)
+ aOutputs = new ItemStack[0];
+ if (aFluidInputs == null)
+ aFluidInputs = new FluidStack[0];
+ if (aFluidOutputs == null)
+ aFluidOutputs = new FluidStack[0];
+ if (aChances == null)
+ aChances = new int[aOutputs.length];
+ if (aChances.length < aOutputs.length)
+ aChances = Arrays.copyOf(aChances, aOutputs.length);
+
+ aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
+ aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
+ aFluidInputs = GT_Utility.getArrayListWithoutNulls(aFluidInputs).toArray(new FluidStack[0]);
+ aFluidOutputs = GT_Utility.getArrayListWithoutNulls(aFluidOutputs).toArray(new FluidStack[0]);
+
+ GT_OreDictUnificator.setStackArray(true, aInputs);
+ GT_OreDictUnificator.setStackArray(true, aOutputs);
+
+ for (ItemStack tStack : aOutputs)
+ GT_Utility.updateItemStack(tStack);
+
+ for (int i = 0; i < aChances.length; i++)
+ if (aChances[i] <= 0)
+ aChances[i] = 10000;
+ for (int i = 0; i < aFluidInputs.length; i++)
+ aFluidInputs[i] = new GT_FluidStack(aFluidInputs[i]);
+ for (int i = 0; i < aFluidOutputs.length; i++)
+ aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]);
+
+ for (ItemStack aInput : aInputs)
+ if (aInput != null && Items.feather.getDamage(aInput) != W)
+ for (int j = 0; j < aOutputs.length; j++) {
+ if (GT_Utility.areStacksEqual(aInput, aOutputs[j])) {
+ if (aInput.stackSize >= aOutputs[j].stackSize) {
+ aInput.stackSize -= aOutputs[j].stackSize;
+ aOutputs[j] = null;
+ } else {
+ aOutputs[j].stackSize -= aInput.stackSize;
+ }
+ }
+ }
+
+ if (aOptimize && aDuration >= 32) {
+ ArrayList<ItemStack> tList = new ArrayList<>();
+ tList.addAll(Arrays.asList(aInputs));
+ tList.addAll(Arrays.asList(aOutputs));
+ for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--);
+
+ for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--)
+ if (aDuration / i >= 16) {
+ boolean temp = true;
+ for (ItemStack stack : tList)
+ if (stack.stackSize % i != 0) {
+ temp = false;
+ break;
+ }
+ if (temp)
+ for (FluidStack aFluidInput : aFluidInputs)
+ if (aFluidInput.amount % i != 0) {
+ temp = false;
+ break;
+ }
+ if (temp)
+ for (FluidStack aFluidOutput : aFluidOutputs)
+ if (aFluidOutput.amount % i != 0) {
+ temp = false;
+ break;
+ }
+ if (temp) {
+ for (ItemStack itemStack : tList)
+ itemStack.stackSize /= i;
+ for (FluidStack aFluidInput : aFluidInputs)
+ aFluidInput.amount /= i;
+ for (FluidStack aFluidOutput : aFluidOutputs)
+ aFluidOutput.amount /= i;
+ aDuration /= i;
+ }
+ }
+ }
+
+ mInputs = aInputs;
+ mOutputs = aOutputs;
+ mSpecialItems = aSpecialItems;
+ mChances = aChances;
+ mFluidInputs = aFluidInputs;
+ mFluidOutputs = aFluidOutputs;
+ mDuration = aDuration;
+ mSpecialValue = aSpecialValue;
+ mEUt = aEUt;
+// checkCellBalance();
+ }
+
+ public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
+ this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
+ }
+
+ // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
+ public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
+
+ if (mInputs.length > 0 && aSpecialValue > 0) {
+ switch (aType) {
+ // Diesel Generator
+ case 0:
+ GT_Recipe_Map.sDieselFuels.addRecipe(this);
+ GT_Recipe_Map.sLargeBoilerFakeFuels.addDieselRecipe(this);
+ break;
+ // Gas Turbine
+ case 1:
+ GT_Recipe_Map.sTurbineFuels.addRecipe(this);
+ break;
+ // Thermal Generator
+ case 2:
+ GT_Recipe_Map.sHotFuels.addRecipe(this);
+ break;
+ // Plasma Generator
+ case 4:
+ GT_Recipe_Map.sPlasmaFuels.addRecipe(this);
+ break;
+ // Magic Generator
+ case 5:
+ GT_Recipe_Map.sMagicFuels.addRecipe(this);
+ break;
+ // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
+ default:
+ GT_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
+ GT_Recipe_Map.sLargeBoilerFakeFuels.addDenseLiquidRecipe(this);
+ break;
+ }
+ }
+ }
+
+ public GT_Recipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aSpecialValue) {
+ this(true, null, null, null, null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, Math.max(aDuration, 1), aEUt, Math.max(Math.min(aSpecialValue, 160000000), 0));
+ if (mInputs.length > 1) {
+ GT_Recipe_Map.sFusionRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, aDuration, aEUt, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sLatheRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) {
+ this(true, new ItemStack[]{aInput1, aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sDistillationRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) {
+ this(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("industrialTnt", aInput2 > 0 ? Math.min(aInput2, 64) : 1, new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1))}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sImplosionRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) {
+ this(true, new ItemStack[]{aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize)}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sBenderRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) {
+ this(true, aInput2 == null ? new ItemStack[]{aInput1} : new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sAlloySmelterRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, ItemStack aOutput2) {
+ this(true, aInput2 == null ? new ItemStack[]{aInput1} : new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, Math.max(aDuration, 1), Math.max(aEUt, 1), 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sCannerRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), 120, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sVacuumRecipes.addRecipe(this);
+ }
+ }
+
+ public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt, int VACUUM) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, null, Math.max(aDuration, 1), aEUt, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ GT_Recipe_Map.sVacuumRecipes.addRecipe(this);
+ }
+ }
+
+ //Dummy GT_Recipe maker...
+ public GT_Recipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){
+ this(true, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
+ }
+
+ public static void reInit() {
+ GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
+ for (GT_Recipe_Map tMapEntry : GT_Recipe_Map.sMappings)
+ tMapEntry.reInit();
+ }
+
+ // -----
+ // Old Constructors, do not use!
+ // -----
+
+ public ItemStack getRepresentativeInput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mInputs.length) return null;
+ return GT_Utility.copy(mInputs[aIndex]);
+ }
+
+ public ItemStack getOutput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mOutputs.length) return null;
+ return GT_Utility.copy(mOutputs[aIndex]);
+ }
+
+ public int getOutputChance(int aIndex) {
+ if (aIndex < 0 || aIndex >= mChances.length) return 10000;
+ return mChances[aIndex];
+ }
+
+ public FluidStack getRepresentativeFluidInput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mFluidInputs.length || mFluidInputs[aIndex] == null) return null;
+ return mFluidInputs[aIndex].copy();
+ }
+
+ public FluidStack getFluidOutput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mFluidOutputs.length || mFluidOutputs[aIndex] == null) return null;
+ return mFluidOutputs[aIndex].copy();
+ }
+
+ public void checkCellBalance() {
+ if (!D2 || mInputs.length < 1) return;
+
+ int tInputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mInputs);
+ int tOutputAmount = GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(mOutputs);
+
+ if (tInputAmount < tOutputAmount) {
+ if (!Materials.Tin.contains(mInputs)) {
+ GT_Log.err.println("You get more Cells, than you put in? There must be something wrong.");
+ new Exception().printStackTrace(GT_Log.err);
+ }
+ } else if (tInputAmount > tOutputAmount) {
+ if (!Materials.Tin.contains(mOutputs)) {
+ GT_Log.err.println("You get less Cells, than you put in? GT Machines usually don't destroy Cells.");
+ new Exception().printStackTrace(GT_Log.err);
+ }
+ }
+ }
+
+ public GT_Recipe copy() {
+ return new GT_Recipe(this);
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
+ }
+
+ public static boolean GTppRecipeHelper;
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
+ int amt;
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ boolean temp = true;
+ amt = tFluid.amount;
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid)) {
+ if (aDontCheckStackSizes) {
+ temp = false;
+ break;
+ }
+ amt -= aFluid.amount;
+ if (amt < 1) {
+ temp = false;
+ break;
+ }
+ }
+ if (temp) return false;
+ }
+
+ if (mInputs.length > 0 && aInputs == null) return false;
+
+ for (ItemStack tStack : mInputs) {
+ if (tStack != null) {
+ amt = tStack.stackSize;
+ boolean temp = true;
+ for (ItemStack aStack : aInputs) {
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
+ if (GTppRecipeHelper) {//remove once the fix is out
+ if (GT_Utility.areStacksEqual(aStack, Ic2Items.FluidCell.copy(), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataStick.get(1L), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataOrb.get(1L), true)) {
+ if (!GT_Utility.areStacksEqual(aStack, tStack, false))
+ continue;
+ }
+ }
+ if (aDontCheckStackSizes) {
+ temp = false;
+ break;
+ }
+ amt -= aStack.stackSize;
+ if (amt < 1) {
+ temp = false;
+ break;
+ }
+ }
+ }
+ if (temp) return false;
+ }
+ }
+ if (aDecreaseStacksizeBySuccess) {
+ if (aFluidInputs != null) {
+ for (FluidStack tFluid : mFluidInputs) {
+ if (tFluid != null) {
+ amt = tFluid.amount;
+ for (FluidStack aFluid : aFluidInputs) {
+ if (aFluid != null && aFluid.isFluidEqual(tFluid)) {
+ if (aDontCheckStackSizes) {
+ aFluid.amount -= amt;
+ break;
+ }
+ if (aFluid.amount < amt) {
+ amt -= aFluid.amount;
+ aFluid.amount = 0;
+ } else {
+ aFluid.amount -= amt;
+ amt = 0;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (aInputs != null) {
+ for (ItemStack tStack : mInputs) {
+ if (tStack != null) {
+ amt = tStack.stackSize;
+ for (ItemStack aStack : aInputs) {
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
+ if (GTppRecipeHelper) {
+ if (GT_Utility.areStacksEqual(aStack, Ic2Items.FluidCell.copy(), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataStick.get(1L), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataOrb.get(1L), true)) {
+ if (!GT_Utility.areStacksEqual(aStack, tStack, false))
+ continue;
+ }
+ }
+ if (aDontCheckStackSizes){
+ aStack.stackSize -= amt;
+ break;
+ }
+ if (aStack.stackSize < amt){
+ amt -= aStack.stackSize;
+ aStack.stackSize = 0;
+ }else{
+ aStack.stackSize -= amt;
+ amt = 0;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public int compareTo(GT_Recipe recipe) {
+ // first lowest tier recipes
+ // then fastest
+ // then with lowest special value
+ // then dry recipes
+ // then with fewer inputs
+ if (this.mEUt != recipe.mEUt) {
+ return this.mEUt - recipe.mEUt;
+ } else if (this.mDuration != recipe.mDuration) {
+ return this.mDuration - recipe.mDuration;
+ } else if (this.mSpecialValue != recipe.mSpecialValue) {
+ return this.mSpecialValue - recipe.mSpecialValue;
+ } else if (this.mFluidInputs.length != recipe.mFluidInputs.length) {
+ return this.mFluidInputs.length - recipe.mFluidInputs.length;
+ } else if (this.mInputs.length != recipe.mInputs.length) {
+ return this.mInputs.length - recipe.mInputs.length;
+ }
+ return 0;
+ }
+
+ public String[] getNeiDesc() {
+ return neiDesc;
+ }
+
+ protected void setNeiDesc(String... neiDesc) {
+ this.neiDesc = neiDesc;
+ }
+
+ /**
+ * Overriding this method and getOutputPositionedStacks allows for custom NEI stack placement
+ * @return A list of input stacks
+ */
+ public ArrayList<PositionedStack> getInputPositionedStacks(){
+ return null;
+ }
+
+ /**
+ * Overriding this method and getInputPositionedStacks allows for custom NEI stack placement
+ * @return A list of output stacks
+ */
+ public ArrayList<PositionedStack> getOutputPositionedStacks(){
+ return null;
+ }
+
+ public static class GT_Recipe_AssemblyLine{
+ public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes = new ArrayList<GT_Recipe_AssemblyLine>();
+
+ public ItemStack mResearchItem;
+ public int mResearchTime;
+ public ItemStack[] mInputs;
+ public FluidStack[] mFluidInputs;
+ public ItemStack mOutput;
+ public int mDuration;
+ public int mEUt;
+ public ItemStack[][] mOreDictAlt;
+
+ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
+ this(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt, new ItemStack[aInputs.length][]);
+ }
+
+ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) {
+ mResearchItem = aResearchItem;
+ mResearchTime = aResearchTime;
+ mInputs = aInputs;
+ mFluidInputs = aFluidInputs;
+ mOutput = aOutput;
+ mDuration = aDuration;
+ mEUt = aEUt;
+ mOreDictAlt = aAlt;
+ }
+
+ }
+
+ public static class GT_Recipe_Map {
+ /**
+ * Contains all Recipe Maps
+ */
+ public static final Collection<GT_Recipe_Map> sMappings = new ArrayList<>();
+
+ public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map(new HashSet<>(500), "gt.recipe.orewasher", "Ore Washing Plant", null, RES_PATH_GUI + "basicmachines/OreWasher", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map(new HashSet<>(1000), "gt.recipe.thermalcentrifuge", "Thermal Centrifuge", null, RES_PATH_GUI + "basicmachines/ThermalCentrifuge", 1, 3, 1, 0, 2, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map(new HashSet<>(750), "gt.recipe.compressor", "Compressor", null, RES_PATH_GUI + "basicmachines/Compressor", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map(new HashSet<>(250), "gt.recipe.extractor", "Extractor", null, RES_PATH_GUI + "basicmachines/Extractor", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler(new HashSet<>(0), "ic.recipe.recycler", "Recycler", "ic2.recycler", RES_PATH_GUI + "basicmachines/Recycler", 1, 1, 1, 0, 1, E, 1, E, true, false);
+ public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace(new HashSet<>(0), "mc.recipe.furnace", "Furnace", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 1, 0, 1, E, 1, E, true, false);
+ public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave(new HashSet<>(0), "gt.recipe.microwave", "Microwave", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 1, 0, 1, E, 1, E, true, false);
+
+ public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.scanner", "Scanner", null, RES_PATH_GUI + "basicmachines/Scanner", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map(new HashSet<>(200), "gt.recipe.rockbreaker", "Rock Breaker", null, RES_PATH_GUI + "basicmachines/RockBreaker", 1, 1, 0, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map(new HashSet<>(1000), "gt.recipe.byproductlist", "Ore Byproduct List", null, RES_PATH_GUI + "basicmachines/Default", 1, 6, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sReplicatorFakeRecipes = new GT_Recipe_Map(new HashSet<>(100), "gt.recipe.replicator", "Replicator", null, RES_PATH_GUI + "basicmachines/Replicator", 0, 1, 0, 1, 1, E, 1, E, true, true);
+ //public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet<>(30), "gt.recipe.scanner", "Scanner", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map(new HashSet<>(110), "gt.recipe.fakeAssemblylineProcess", "Assemblyline Process", null, RES_PATH_GUI + "FakeAssemblyline", 1, 1, 1, 0, 1, E, 1, E, true, false);
+ public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map(new HashSet<>(20000), "gt.recipe.plasmaarcfurnace", "Plasma Arc Furnace", null, RES_PATH_GUI + "basicmachines/PlasmaArcFurnace", 1, 4, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map(new HashSet<>(20000), "gt.recipe.arcfurnace", "Arc Furnace", null, RES_PATH_GUI + "basicmachines/ArcFurnace", 1, 4, 1, 1, 3, E, 1, E, true, true);
+ public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer(new HashSet<>(5), "gt.recipe.printer", "Printer", null, RES_PATH_GUI + "basicmachines/Printer", 1, 1, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sSifterRecipes = new GT_Recipe_Map(new HashSet<>(105), "gt.recipe.sifter", "Sifter", null, RES_PATH_GUI + "basicmachines/Sifter", 1, 9, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sPressRecipes = new GT_Recipe_Map_FormingPress(new HashSet<>(300), "gt.recipe.press", "Forming Press", null, RES_PATH_GUI + "basicmachines/Press", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sLaserEngraverRecipes = new GT_Recipe_Map(new HashSet<>(810), "gt.recipe.laserengraver", "Precision Laser Engraver", null, RES_PATH_GUI + "basicmachines/LaserEngraver", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMixerRecipes = new GT_Recipe_Map(new HashSet<>(900), "gt.recipe.mixer", "Mixer", null, RES_PATH_GUI + "basicmachines/Mixer2", 9, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.autoclave", "Autoclave", null, RES_PATH_GUI + "basicmachines/Autoclave", 1, 1, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map(new HashSet<>(50), "gt.recipe.electromagneticseparator", "Electromagnetic Separator", null, RES_PATH_GUI + "basicmachines/ElectromagneticSeparator", 1, 3, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.polarizer", "Electromagnetic Polarizer", null, RES_PATH_GUI + "basicmachines/Polarizer", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator(new HashSet<>(16600), "gt.recipe.macerator", "Pulverization", null, RES_PATH_GUI + "basicmachines/Macerator4", 1, 4, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<>(2550), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner(new HashSet<>(2100), "gt.recipe.fluidcanner", "Fluid Canning Machine", null, RES_PATH_GUI + "basicmachines/FluidCannerNEI", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map(new HashSet<>(450), "gt.recipe.brewer", "Brewing Machine", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 0, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sFluidHeaterRecipes = new GT_Recipe_Map(new HashSet<>(10), "gt.recipe.fluidheater", "Fluid Heater", null, RES_PATH_GUI + "basicmachines/FluidHeater", 1, 0, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sDistilleryRecipes = new GT_Recipe_Map(new HashSet<>(400), "gt.recipe.distillery", "Distillery", null, RES_PATH_GUI + "basicmachines/Distillery", 1, 1, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sFermentingRecipes = new GT_Recipe_Map(new HashSet<>(50), "gt.recipe.fermenter", "Fermenter", null, RES_PATH_GUI + "basicmachines/Fermenter", 0, 0, 0, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sFluidSolidficationRecipes = new GT_Recipe_Map(new HashSet<>(35000), "gt.recipe.fluidsolidifier", "Fluid Solidifier", null, RES_PATH_GUI + "basicmachines/FluidSolidifier", 1, 1, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sFluidExtractionRecipes = new GT_Recipe_Map(new HashSet<>(15000), "gt.recipe.fluidextractor", "Fluid Extractor", null, RES_PATH_GUI + "basicmachines/FluidExtractor", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sBoxinatorRecipes = new GT_Recipe_Map(new HashSet<>(2500), "gt.recipe.packager", "Packager", null, RES_PATH_GUI + "basicmachines/Packager", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sUnboxinatorRecipes = new GT_Recipe_Map_Unboxinator(new HashSet<>(2500), "gt.recipe.unpackager", "Unpackager", null, RES_PATH_GUI + "basicmachines/Unpackager", 1, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sFusionRecipes = new GT_Recipe_Map(new HashSet<>(50), "gt.recipe.fusionreactor", "Fusion Reactor", null, RES_PATH_GUI + "basicmachines/FusionReactor", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true);
+ public static final GT_Recipe_Map sCentrifugeRecipes = new GT_Recipe_Map(new HashSet<>(1200), "gt.recipe.centrifuge", "Centrifuge", null, RES_PATH_GUI + "basicmachines/Centrifuge", 2, 6, 0, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sElectrolyzerRecipes = new GT_Recipe_Map(new HashSet<>(300), "gt.recipe.electrolyzer", "Electrolyzer", null, RES_PATH_GUI + "basicmachines/Electrolyzer", 2, 6, 0, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sBlastRecipes = new GT_Recipe_Map(new HashSet<>(800), "gt.recipe.blastfurnace", "Blast Furnace", null, RES_PATH_GUI + "basicmachines/Default", 2, 2, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true);
+ public static final GT_Recipe_Map sPrimitiveBlastRecipes = new GT_Recipe_Map(new HashSet<>(200), "gt.recipe.primitiveblastfurnace", "Primitive Blast Furnace", null, RES_PATH_GUI + "basicmachines/Default", 3, 3, 1, 0, 1, E, 1, E, false, true);
+ public static final GT_Recipe_Map sImplosionRecipes = new GT_Recipe_Map(new HashSet<>(900), "gt.recipe.implosioncompressor", "Implosion Compressor", null, RES_PATH_GUI + "basicmachines/Default", 2, 2, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sVacuumRecipes = new GT_Recipe_Map(new HashSet<>(305), "gt.recipe.vacuumfreezer", "Vacuum Freezer", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 1, 0, 1, E, 1, E, false, true);
+ public static final GT_Recipe_Map sChemicalRecipes = new GT_Recipe_Map(new HashSet<>(1170), "gt.recipe.chemicalreactor", "Chemical Reactor", null, RES_PATH_GUI + "basicmachines/ChemicalReactor", 2, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMultiblockChemicalRecipes = new GT_Recipe_Map_LargeChemicalReactor();
+ public static final GT_Recipe_Map sDistillationRecipes = new GT_Recipe_Map_DistillationTower();
+ public static final GT_Recipe_Map sCrakingRecipes = new GT_Recipe_Map(new HashSet<>(70), "gt.recipe.craker", "Oil Cracker", null, RES_PATH_GUI + "basicmachines/OilCracker", 1, 1, 1, 2, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sPyrolyseRecipes = new GT_Recipe_Map(new HashSet<>(150), "gt.recipe.pyro", "Pyrolyse Oven", null, RES_PATH_GUI + "basicmachines/Default", 2, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sWiremillRecipes = new GT_Recipe_Map(new HashSet<>(450), "gt.recipe.wiremill", "Wiremill", null, RES_PATH_GUI + "basicmachines/Wiremill", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sBenderRecipes = new GT_Recipe_Map(new HashSet<>(5000), "gt.recipe.metalbender", "Bending Machine", null, RES_PATH_GUI + "basicmachines/Bender", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sAlloySmelterRecipes = new GT_Recipe_Map(new HashSet<>(12000), "gt.recipe.alloysmelter", "Alloy Smelter", null, RES_PATH_GUI + "basicmachines/AlloySmelter", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet<>(8200), "gt.recipe.assembler", "Assembler", null, RES_PATH_GUI + "basicmachines/Assembler2", 9, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCircuitAssemblerRecipes = new GT_Recipe_Map_Assembler(new HashSet<>(605), "gt.recipe.circuitassembler", "Circuit Assembler", null, RES_PATH_GUI + "basicmachines/CircuitAssembler", 6, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCannerRecipes = new GT_Recipe_Map(new HashSet<>(900), "gt.recipe.canner", "Canning Machine", null, RES_PATH_GUI + "basicmachines/Canner", 2, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCNCRecipes = new GT_Recipe_Map(new HashSet<>(100), "gt.recipe.cncmachine", "CNC Machine", null, RES_PATH_GUI + "basicmachines/Default", 2, 1, 2, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sLatheRecipes = new GT_Recipe_Map(new HashSet<>(1150), "gt.recipe.lathe", "Lathe", null, RES_PATH_GUI + "basicmachines/Lathe", 1, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCutterRecipes = new GT_Recipe_Map(new HashSet<>(5125), "gt.recipe.cuttingsaw", "Cutting Machine", null, RES_PATH_GUI + "basicmachines/Cutter2", 2, 2, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sSlicerRecipes = new GT_Recipe_Map(new HashSet<>(20), "gt.recipe.slicer", "Slicing Machine", null, RES_PATH_GUI + "basicmachines/Slicer", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sExtruderRecipes = new GT_Recipe_Map(new HashSet<>(13000), "gt.recipe.extruder", "Extruder", null, RES_PATH_GUI + "basicmachines/Extruder", 2, 1, 2, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sHammerRecipes = new GT_Recipe_Map(new HashSet<>(3800), "gt.recipe.hammer", "Forge Hammer", null, RES_PATH_GUI + "basicmachines/Hammer", 1, 1, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map(new HashSet<>(2), "gt.recipe.uuamplifier", "Amplifabricator", null, RES_PATH_GUI + "basicmachines/Amplifabricator", 1, 0, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMassFabFakeRecipes = new GT_Recipe_Map(new HashSet<>(2), "gt.recipe.massfab", "Mass Fabrication", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 0, 1, 0, 10, E, 1, E, true, true);
+ public static final GT_Recipe_Map_Fuel sDieselFuels = new GT_Recipe_Map_Fuel(new HashSet<>(20), "gt.recipe.dieselgeneratorfuel", "Diesel Generator Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sTurbineFuels = new GT_Recipe_Map_Fuel(new HashSet<>(25), "gt.recipe.gasturbinefuel", "Gas Turbine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel(new HashSet<>(10), "gt.recipe.thermalgeneratorfuel", "Thermal Generator Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, false);
+ public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = new GT_Recipe_Map_Fuel(new HashSet<>(15), "gt.recipe.semifluidboilerfuels", "Semifluid Boiler Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sPlasmaFuels = new GT_Recipe_Map_Fuel(new HashSet<>(100), "gt.recipe.plasmageneratorfuels", "Plasma Generator Fuels", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sMagicFuels = new GT_Recipe_Map_Fuel(new HashSet<>(100), "gt.recipe.magicfuels", "Magic Energy Absorber", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.smallnaquadahreactor", "Naquadah Reactor MkI", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.largenaquadahreactor", "Naquadah Reactor MkII", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sHugeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.fluidnaquadahreactor", "Naquadah Reactor MkIII", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sExtremeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.hugenaquadahreactor", "Naquadah Reactor MkIV", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sUltraHugeNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.extrahugenaquadahreactor", "Naquadah Reactor MkV", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_Fuel sFluidNaquadahReactorFuels = new GT_Recipe_Map_Fuel(new HashSet<>(1), "gt.recipe.fluidnaquadahreactor", "Fluid Naquadah Reactor", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = new GT_Recipe_Map_LargeBoilerFakeFuels();
+
+ /**
+ * HashMap of Recipes based on their Items
+ */
+ public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new /*Concurrent*/HashMap<>();
+ /**
+ * HashMap of Recipes based on their Fluids
+ */
+ public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new /*Concurrent*/HashMap<>();
+ public final HashSet<String> mRecipeFluidNameMap = new HashSet<>();
+ /**
+ * The List of all Recipes
+ */
+ public final Collection<GT_Recipe> mRecipeList;
+ /**
+ * String used as an unlocalised Name.
+ */
+ public final String mUnlocalizedName;
+ /**
+ * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead
+ */
+ public final String mNEIName;
+ /**
+ * GUI used for NEI Display. Usually the GUI of the Machine itself
+ */
+ public final String mNEIGUIPath;
+ public final String mNEISpecialValuePre, mNEISpecialValuePost;
+ public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage;
+ public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
+
+ /**
+ * Initialises a new type of Recipe Handler.
+ *
+ * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
+ * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
+ * @param aLocalName the displayed Name inside the NEI Recipe GUI.
+ * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
+ * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
+ * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
+ * @param aNEISpecialValuePre the String in front of the Special Value in NEI.
+ * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying
+ * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
+ * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
+ */
+ public GT_Recipe_Map(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ sMappings.add(this);
+ mNEIAllowed = aNEIAllowed;
+ mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
+ mRecipeList = aRecipeList;
+ mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName;
+ mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
+ mNEISpecialValuePre = aNEISpecialValuePre;
+ mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
+ mNEISpecialValuePost = aNEISpecialValuePost;
+ mAmperage = aAmperage;
+ mUsualInputCount = aUsualInputCount;
+ mUsualOutputCount = aUsualOutputCount;
+ mMinimalInputItems = aMinimalInputItems;
+ mMinimalInputFluids = aMinimalInputFluids;
+ GregTech_API.sFluidMappings.add(mRecipeFluidMap);
+ GregTech_API.sItemStackMappings.add(mRecipeItemMap);
+ GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
+ }
+
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
+ }
+
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GT_Recipe addRecipe(GT_Recipe aRecipe) {
+ return addRecipe(aRecipe, true, false, false);
+ }
+
+ protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ aRecipe.mHidden = aHidden;
+ aRecipe.mFakeRecipe = aFakeRecipe;
+ if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems)
+ return null;
+ if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)
+ return null;
+ return add(aRecipe);
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) {
+ return addFakeRecipe(aCheckForCollisions, new GT_Recipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue),hidden);
+ }
+
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt ,boolean hidden) {
+ return addFakeRecipe(aCheckForCollisions, new GT_Recipe_WithAlt(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue, aAlt),hidden);
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
+ return addRecipe(aRecipe, aCheckForCollisions, true, false);
+ }
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe,boolean hidden) {
+ return addRecipe(aRecipe, aCheckForCollisions, true, hidden);
+ }
+
+ public GT_Recipe add(GT_Recipe aRecipe) {
+ mRecipeList.add(aRecipe);
+ for (FluidStack aFluid : aRecipe.mFluidInputs)
+ if (aFluid != null) {
+ Collection<GT_Recipe> tList = mRecipeFluidMap.computeIfAbsent(aFluid.getFluid(), k -> new HashSet<>(1));
+ tList.add(aRecipe);
+ mRecipeFluidNameMap.add(aFluid.getFluid().getName());
+ }
+ return addToItemMap(aRecipe);
+ }
+
+ public void reInit() {
+ mRecipeItemMap.clear();
+ for (GT_Recipe tRecipe : mRecipeList) {
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
+ addToItemMap(tRecipe);
+ }
+ }
+
+ /**
+ * @return if this Item is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(ItemStack aStack) {
+ return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))));
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(FluidStack aFluid) {
+ return aFluid != null && containsInput(aFluid.getFluid());
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(Fluid aFluid) {
+ return aFluid != null && mRecipeFluidNameMap.contains(aFluid.getName());
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot, aInputs);
+ }
+ /**
+ * finds a Recipe matching the aFluid and ItemStack Inputs.
+ *
+ * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
+ * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
+ * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
+ * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input
+ * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
+ * @param aFluids the Fluid Inputs
+ * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
+ * @param aInputs the Item Inputs
+ * @return the Recipe it has found or null for no matching Recipe
+ */
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeList.isEmpty()) return null;
+
+ // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
+ // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
+ if (GregTech_API.sPostloadFinished) {
+ if (mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mMinimalInputFluids) return null;
+ }
+ if (mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, aInputs);
+
+ // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
+ if (aRecipe != null)
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GT_Recipe>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GT_Recipe>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+
+ protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
+ for (ItemStack aStack : aRecipe.mInputs)
+ if (aStack != null) {
+ GT_ItemStack tStack = new GT_ItemStack(aStack);
+ Collection<GT_Recipe> tList = mRecipeItemMap.computeIfAbsent(tStack, k -> new HashSet<>(1));
+ tList.add(aRecipe);
+ }
+ return aRecipe;
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class.
+ // -----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Abstract Class for general Recipe Handling of non GT Recipes
+ */
+ public static abstract class GT_Recipe_Map_NonGTRecipes extends GT_Recipe_Map {
+ public GT_Recipe_Map_NonGTRecipes(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return false;
+ }
+
+ @Override
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addRecipe(GT_Recipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue,boolean hidden) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GT_Recipe add(GT_Recipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public void reInit() {/**/}
+
+ @Override
+ protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
+ return null;
+ }
+ }
+
+ /**
+ * Just a Recipe Map with Utility specifically for Fuels.
+ */
+ public static class GT_Recipe_Map_Fuel extends GT_Recipe_Map {
+ public GT_Recipe_Map_Fuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
+ return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
+ return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
+ return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
+ }
+ }
+
+ /**
+ * Special Class for Furnace Recipe handling.
+ */
+ public static class GT_Recipe_Map_Furnace extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_Furnace(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null);
+ return tOutput == null ? null : new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 4, 0);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_ModHandler.getSmeltingOutput(aStack, false, null) != null;
+ }
+ }
+
+ /**
+ * Special Class for Microwave Recipe handling.
+ */
+ public static class GT_Recipe_Map_Microwave extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_Microwave(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null);
+
+ if (GT_Utility.areStacksEqual(aInputs[0], new ItemStack(Items.book, 1, W))) {
+ return new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1))}, null, null, null, null, 32, 4, 0);
+ }
+
+ // Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of Output and last check the Output itself
+ for (ItemStack tStack : new ItemStack[]{GT_Utility.getContainerItem(aInputs[0], true), aInputs[0], GT_Utility.getContainerItem(tOutput, true), tOutput})
+ if (tStack != null) {
+ if (GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.netherrack, 1, W), true)
+ || GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true)
+ || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.egg, 1, W), true)
+ || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.firework_charge, 1, W), true)
+ || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fireworks, 1, W), true)
+ || GT_Utility.areStacksEqual(tStack, new ItemStack(Items.fire_charge, 1, W), true)
+ ) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ GT_Log.exp.println("Microwave Explosion due to TNT || EGG || FIREWORKCHARGE || FIREWORK || FIRE CHARGE");
+ ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
+ }
+ return null;
+ }
+ ItemData tData = GT_OreDictUnificator.getItemData(tStack);
+
+
+ if (tData != null) {
+ if (tData.mMaterial != null && tData.mMaterial.mMaterial != null) {
+ if (tData.mMaterial.mMaterial.contains(SubTag.METAL) || tData.mMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ GT_Log.exp.println("Microwave Explosion due to METAL insertion");
+ ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
+ }
+ return null;
+ }
+ if (tData.mMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion");
+ ((IGregTechTileEntity) aTileEntity).setOnFire();
+ }
+ return null;
+ }
+ }
+ for (MaterialStack tMaterial : tData.mByProducts)
+ if (tMaterial != null) {
+ if (tMaterial.mMaterial.contains(SubTag.METAL) || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ GT_Log.exp.println("Microwave Explosion due to METAL insertion");
+ ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
+ }
+ return null;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ ((IGregTechTileEntity) aTileEntity).setOnFire();
+ GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion");
+ }
+ return null;
+ }
+ }
+ }
+ if (TileEntityFurnace.getItemBurnTime(tStack) > 0) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ ((IGregTechTileEntity) aTileEntity).setOnFire();
+ GT_Log.exp.println("Microwave INFLAMMATION due to BURNABLE insertion");
+ }
+ return null;
+ }
+
+ }
+
+ return tOutput == null ? null : new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 32, 4, 0);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_ModHandler.getSmeltingOutput(aStack, false, null) != null;
+ }
+ }
+
+ /**
+ * Special Class for Unboxinator handling.
+ */
+ public static class GT_Recipe_Map_Unboxinator extends GT_Recipe_Map {
+ public GT_Recipe_Map_Unboxinator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || !ItemList.IC2_Scrapbox.isStackEqual(aInputs[0], false, true))
+ return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ ItemStack tOutput = GT_ModHandler.getRandomScrapboxDrop();
+ if (tOutput == null)
+ return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ GT_Recipe rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.IC2_Scrapbox.get(1)}, new ItemStack[]{tOutput}, null, null, null, null, 16, 1, 0);
+ // It is not allowed to be buffered due to the random Output
+ rRecipe.mCanBeBuffered = false;
+ // Due to its randomness it is not good if there are Items in the Output Slot, because those Items could manipulate the outcome.
+ rRecipe.mNeedsEmptyOutput = true;
+ return rRecipe;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return ItemList.IC2_Scrapbox.isStackEqual(aStack, false, true) || super.containsInput(aStack);
+ }
+ }
+
+ /**
+ * Special Class for Fluid Canner handling.
+ */
+ public static class GT_Recipe_Map_FluidCanner extends GT_Recipe_Map {
+ public GT_Recipe_Map_FluidCanner(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe != null || !GregTech_API.sPostloadFinished)
+ return rRecipe;
+ if (aFluids != null && aFluids.length > 0 && aFluids[0] != null) {
+ ItemStack tOutput = GT_Utility.fillFluidContainer(aFluids[0], aInputs[0], false, true);
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
+ if (tFluid != null)
+ rRecipe = new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, new FluidStack[]{tFluid}, null, Math.max(tFluid.amount / 64, 16), 1, 0);
+ }
+ if (rRecipe == null) {
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInputs[0], true);
+ if (tFluid != null)
+ rRecipe = new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{GT_Utility.getContainerItem(aInputs[0], true)}, null, null, null, new FluidStack[]{tFluid}, Math.max(tFluid.amount / 64, 16), 1, 0);
+ }
+ if (rRecipe != null) rRecipe.mCanBeBuffered = false;
+ return rRecipe;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return aStack != null && (super.containsInput(aStack) || (aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0));
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return true;
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return true;
+ }
+ }
+
+ /**
+ * Special Class for Recycler Recipe handling.
+ */
+ public static class GT_Recipe_Map_Recycler extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_Recycler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ return new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null : new ItemStack[]{ItemList.IC2_Scrap.get(1)}, null, new int[]{1250}, null, null, 45, 1, 0);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aStack), 0) != null;
+ }
+ }
+
+ /**
+ * Special Class for Compressor Recipe handling.
+ */
+ public static class GT_Recipe_Map_Compressor extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_Compressor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
+ ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.compressor.getRecipes(), true, new NBTTagCompound(), null, null, null);
+ return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.compressor.getRecipes(), false, new NBTTagCompound(), null, null, null));
+ }
+ }
+
+ /**
+ * Special Class for Extractor Recipe handling.
+ */
+ public static class GT_Recipe_Map_Extractor extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_Extractor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
+ ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.extractor.getRecipes(), true, new NBTTagCompound(), null, null, null);
+ return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.extractor.getRecipes(), false, new NBTTagCompound(), null, null, null));
+ }
+ }
+
+ /**
+ * Special Class for Thermal Centrifuge Recipe handling.
+ */
+ public static class GT_Recipe_Map_ThermalCentrifuge extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_ThermalCentrifuge(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
+ ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.centrifuge.getRecipes(), true, new NBTTagCompound(), null, null, null);
+ return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 48, 0) : null;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.centrifuge.getRecipes(), false, new NBTTagCompound(), null, null, null));
+ }
+ }
+
+ /**
+ * Special Class for Ore Washer Recipe handling.
+ */
+ public static class GT_Recipe_Map_OreWasher extends GT_Recipe_Map_NonGTRecipes {
+ public GT_Recipe_Map_OreWasher(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || aFluids == null || aFluids.length < 1 || !GT_ModHandler.isWater(aFluids[0]))
+ return null;
+ if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
+ ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
+ NBTTagCompound aRecipeMetaData = new NBTTagCompound();
+ ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.oreWashing.getRecipes(), true, aRecipeMetaData, null, null, null);
+ return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, new FluidStack[]{new FluidStack(aFluids[0].getFluid(), ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount"))}, null, 400, 16, 0) : null;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.oreWashing.getRecipes(), false, new NBTTagCompound(), null, null, null));
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return GT_ModHandler.isWater(aFluid);
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return GT_ModHandler.isWater(new FluidStack(aFluid, 0));
+ }
+ }
+
+ /**
+ * Special Class for Macerator/RockCrusher Recipe handling.
+ */
+ public static class GT_Recipe_Map_Macerator extends GT_Recipe_Map {
+ public GT_Recipe_Map_Macerator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || !GregTech_API.sPostloadFinished)
+ return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ aRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ if (aRecipe != null) return aRecipe;
+
+ try {
+ List<ItemStack> tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher.getRecipe(GT_Utility.copyAmount(1, aInputs[0])).getRandomizedOuputs();
+ if (tRecipeOutputs != null) {
+ aRecipe = new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, tRecipeOutputs.toArray(new ItemStack[0]), null, null, null, null, 800, 2, 0);
+ aRecipe.mCanBeBuffered = false;
+ aRecipe.mNeedsEmptyOutput = true;
+ return aRecipe;
+ }
+ } catch (NoClassDefFoundError e) {
+ if (D1) GT_Log.err.println("Railcraft Not loaded");
+ } catch (NullPointerException e) {/**/}
+
+ ItemStack tComparedInput = GT_Utility.copy(aInputs[0]);
+ ItemStack[] tOutputItems = GT_ModHandler.getMachineOutput(tComparedInput, ic2.api.recipe.Recipes.macerator.getRecipes(), true, new NBTTagCompound(), null, null, null);
+ return GT_Utility.arrayContainsNonNull(tOutputItems) ? new GT_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])}, tOutputItems, null, null, null, null, 400, 2, 0) : null;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return super.containsInput(aStack) || GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(GT_Utility.copyAmount(64, aStack), ic2.api.recipe.Recipes.macerator.getRecipes(), false, new NBTTagCompound(), null, null, null));
+ }
+ }
+
+ /**
+ * Special Class for Assembler handling.
+ */
+ public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map {
+
+ public GT_Recipe_Map_Assembler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+
+ GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, true, aVoltage, aFluids, aSpecialSlot, aInputs);
+/*
+
+
+ Doesnt work, keep it as a reminder tho
+
+ if (rRecipe == null){
+ Set<ItemStack> aInputs2 = new TreeSet<ItemStack>();
+ for (ItemStack aInput : aInputs) {
+ aInputs2.add(aInput);
+ }
+
+ for (ItemStack aInput : aInputs) {
+ aInputs2.remove(aInput);
+ int[] oredictIDs = OreDictionary.getOreIDs(aInput);
+ if ( oredictIDs.length > 1){
+ for (final int i : oredictIDs){
+ final ItemStack[] oredictIS = (ItemStack[]) OreDictionary.getOres(OreDictionary.getOreName(i)).toArray();
+ if (oredictIS != null && oredictIS.length > 1){
+ for (final ItemStack IS : oredictIS){
+ aInputs2.add(IS);
+ ItemStack[] temp = (ItemStack[]) aInputs2.toArray();
+ rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot,temp);
+ if(rRecipe!= null){
+ break;
+ }
+ else {
+ aInputs2.remove(IS);
+ }
+ }
+ if(rRecipe!= null)
+ break;
+ }
+ }
+ if(rRecipe!= null)
+ break;
+ }else
+ aInputs2.add(aInput);
+ if(rRecipe!= null)
+ break;
+ }
+ }
+*/
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || rRecipe == null || !GregTech_API.sPostloadFinished)
+ return rRecipe;
+
+ for (ItemStack aInput : aInputs) {
+ if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, false, true)) {
+ rRecipe = rRecipe.copy();
+ rRecipe.mCanBeBuffered = false;
+ rRecipe.mOutputs[0].setTagCompound(aInput.getTagCompound());
+ }
+
+ }
+ return rRecipe;
+ }
+
+ }
+
+ /**
+ * Special Class for Forming Press handling.
+ */
+ public static class GT_Recipe_Map_FormingPress extends GT_Recipe_Map {
+ public GT_Recipe_Map_FormingPress(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ if (aInputs == null || aInputs.length < 2 || aInputs[0] == null || aInputs[1] == null || !GregTech_API.sPostloadFinished)
+ return rRecipe;
+ if (rRecipe == null) {
+ if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[0], false, true)) {
+ ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[1]);
+ tOutput.setStackDisplayName(aInputs[0].getDisplayName());
+ rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[1])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 8, 0);
+ rRecipe.mCanBeBuffered = false;
+ return rRecipe;
+ }
+ if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[1], false, true)) {
+ ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[0]);
+ tOutput.setStackDisplayName(aInputs[1].getDisplayName());
+ rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 8, 0);
+ rRecipe.mCanBeBuffered = false;
+ return rRecipe;
+ }
+ return null;
+ }
+ for (ItemStack aMold : aInputs) {
+ if (ItemList.Shape_Mold_Credit.isStackEqual(aMold, false, true)) {
+ NBTTagCompound tNBT = aMold.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ if (!tNBT.hasKey("credit_security_id")) tNBT.setLong("credit_security_id", System.nanoTime());
+ aMold.setTagCompound(tNBT);
+
+ rRecipe = rRecipe.copy();
+ rRecipe.mCanBeBuffered = false;
+ rRecipe.mOutputs[0].setTagCompound(tNBT);
+ return rRecipe;
+ }
+ }
+ return rRecipe;
+ }
+ }
+
+ /**
+ * Special Class for Printer handling.
+ */
+ public static class GT_Recipe_Map_Printer extends GT_Recipe_Map {
+ public GT_Recipe_Map_Printer(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
+ if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || aFluids == null || aFluids.length <= 0 || aFluids[0] == null || !GregTech_API.sPostloadFinished)
+ return rRecipe;
+
+ Dyes aDye = null;
+ for (Dyes tDye : Dyes.VALUES)
+ if (tDye.isFluidDye(aFluids[0])) {
+ aDye = tDye;
+ break;
+ }
+
+ if (aDye == null) return rRecipe;
+
+ if (rRecipe == null) {
+ ItemStack
+ tOutput = GT_ModHandler.getAllRecipeOutput(aTileEntity == null ? null : aTileEntity.getWorld(), aInputs[0], aInputs[0], aInputs[0], aInputs[0], ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1), aInputs[0], aInputs[0], aInputs[0], aInputs[0]);
+ if (tOutput != null)
+ return addRecipe(new GT_Recipe(true, new ItemStack[]{GT_Utility.copyAmount(8, aInputs[0])}, new ItemStack[]{tOutput}, null, null, new FluidStack[]{new FluidStack(aFluids[0].getFluid(), (int) L)}, null, 256, 2, 0), false, false, true);
+
+ tOutput = GT_ModHandler.getAllRecipeOutput(aTileEntity == null ? null : aTileEntity.getWorld(), aInputs[0], ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1));
+ if (tOutput != null)
+ return addRecipe(new GT_Recipe(true, new ItemStack[]{GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, new FluidStack[]{new FluidStack(aFluids[0].getFluid(), (int) L)}, null, 32, 2, 0), false, false, true);
+ } else {
+ if (aInputs[0].getItem() == Items.paper) {
+ if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
+ NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
+ if (tNBT == null || GT_Utility.isStringInvalid(tNBT.getString("title")) || GT_Utility.isStringInvalid(tNBT.getString("author")))
+ return null;
+
+ rRecipe = rRecipe.copy();
+ rRecipe.mCanBeBuffered = false;
+ rRecipe.mOutputs[0].setTagCompound(tNBT);
+ return rRecipe;
+ }
+ if (aInputs[0].getItem() == Items.map) {
+ if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
+ NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
+ if (tNBT == null || !tNBT.hasKey("map_id")) return null;
+
+ rRecipe = rRecipe.copy();
+ rRecipe.mCanBeBuffered = false;
+ rRecipe.mOutputs[0].setItemDamage(tNBT.getShort("map_id"));
+ return rRecipe;
+ }
+ if (ItemList.Paper_Punch_Card_Empty.isStackEqual(aInputs[0], false, true)) {
+ if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
+ NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
+ if (tNBT == null || !tNBT.hasKey("GT.PunchCardData")) return null;
+
+ rRecipe = rRecipe.copy();
+ rRecipe.mCanBeBuffered = false;
+ rRecipe.mOutputs[0].setTagCompound(GT_Utility.getNBTContainingString(new NBTTagCompound(), "GT.PunchCardData", tNBT.getString("GT.PunchCardData")));
+ return rRecipe;
+ }
+ }
+ return rRecipe;
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return super.containsInput(aFluid) || Dyes.isAnyFluidDye(aFluid);
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return super.containsInput(aFluid) || Dyes.isAnyFluidDye(aFluid);
+ }
+ }
+
+ public static class GT_Recipe_Map_LargeBoilerFakeFuels extends GT_Recipe_Map {
+
+ public GT_Recipe_Map_LargeBoilerFakeFuels() {
+ super(new HashSet<>(55), "gt.recipe.largeboilerfakefuels", "Large Boiler", null, RES_PATH_GUI + "basicmachines/Default", 1, 0, 1, 0, 1, E, 1, E, true, true);
+ GT_Recipe explanatoryRecipe = new GT_Recipe(true, new ItemStack[]{}, new ItemStack[]{}, null, null, null, null, 1, 1, 1);
+ explanatoryRecipe.setNeiDesc("Not all solid fuels are listed.", "Any item that burns in a", "vanilla furnace will burn in", "a Large Boiler.");
+ addRecipe(explanatoryRecipe);
+ }
+
+ public GT_Recipe addDenseLiquidRecipe(GT_Recipe recipe) {
+ return addRecipe(recipe, ((double) recipe.mSpecialValue) / 10);
+ }
+
+ public GT_Recipe addDieselRecipe(GT_Recipe recipe) {
+ return addRecipe(recipe, ((double) recipe.mSpecialValue) / 40);
+ }
+
+ public void addSolidRecipes(ItemStack... itemStacks) {
+ for (ItemStack itemStack : itemStacks) {
+ addSolidRecipe(itemStack);
+ }
+ }
+
+ public GT_Recipe addSolidRecipe(ItemStack fuelItemStack) {
+ return addRecipe(new GT_Recipe(true, new ItemStack[]{fuelItemStack}, new ItemStack[]{}, null, null, null, null, 1, 0, GT_ModHandler.getFuelValue(fuelItemStack) / 1600), ((double) GT_ModHandler.getFuelValue(fuelItemStack)) / 1600);
+ }
+
+ private GT_Recipe addRecipe(GT_Recipe recipe, double baseBurnTime) {
+ recipe = new GT_Recipe(recipe);
+ //Some recipes will have a burn time like 15.9999999 and % always rounds down
+ double floatErrorCorrection = 0.0001;
+
+ double bronzeBurnTime = baseBurnTime * 2 + floatErrorCorrection;
+ bronzeBurnTime -= bronzeBurnTime % 0.05;
+ double steelBurnTime = baseBurnTime * 1.5 + floatErrorCorrection;
+ steelBurnTime -= steelBurnTime % 0.05;
+ double titaniumBurnTime = baseBurnTime * 1.3 + floatErrorCorrection;
+ titaniumBurnTime -= titaniumBurnTime % 0.05;
+ double tungstensteelBurnTime = baseBurnTime * 1.2 + floatErrorCorrection;
+ tungstensteelBurnTime -= tungstensteelBurnTime % 0.05;
+
+ recipe.setNeiDesc("Burn time in seconds:",
+ String.format("Bronze Boiler: %.4f", bronzeBurnTime),
+ String.format("Steel Boiler: %.4f", steelBurnTime),
+ String.format("Titanium Boiler: %.4f", titaniumBurnTime),
+ String.format("Tungstensteel Boiler: %.4f", tungstensteelBurnTime));
+ return super.addRecipe(recipe);
+ }
+
+ }
+
+ public static class GT_Recipe_Map_LargeChemicalReactor extends GT_Recipe_Map{
+ private static int TOTAL_INPUT_COUNT = 6;
+ private static int OUTPUT_COUNT = 2;
+ private static int FLUID_OUTPUT_COUNT = 4;
+
+ public GT_Recipe_Map_LargeChemicalReactor() {
+ super(new HashSet<>(1000), "gt.recipe.largechemicalreactor", "Large Chemical Reactor", null, RES_PATH_GUI + "basicmachines/Default", 2, OUTPUT_COUNT, 0, 0, 1, E, 1, E, true, true);
+ }
+
+ @Override
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ aOptimize = false;
+ ArrayList<ItemStack> adjustedInputs = new ArrayList<>();
+ ArrayList<ItemStack> adjustedOutputs = new ArrayList<>();
+ ArrayList<FluidStack> adjustedFluidInputs = new ArrayList<>();
+ ArrayList<FluidStack> adjustedFluidOutputs = new ArrayList<>();
+
+ if (aInputs == null) {
+ aInputs = new ItemStack[0];
+ } else {
+ aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
+ }
+
+ for (ItemStack input : aInputs) {
+ FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input);
+ if (inputFluidContent != null) {
+ inputFluidContent.amount *= input.stackSize;
+ if (inputFluidContent.getFluid().getName().equals("ic2steam")) {
+ inputFluidContent = GT_ModHandler.getSteam(inputFluidContent.amount);
+ }
+ adjustedFluidInputs.add(inputFluidContent);
+ } else {
+ ItemData itemData = GT_OreDictUnificator.getItemData(input);
+ if (itemData != null && itemData.hasValidPrefixMaterialData() && itemData.mMaterial.mMaterial == Materials.Empty) {
+ continue;
+ } else {
+ if (itemData != null && itemData.hasValidPrefixMaterialData() && itemData.mPrefix == OrePrefixes.cell) {
+ ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize);
+ if (dustStack != null) {
+ adjustedInputs.add(dustStack);
+ } else {
+ adjustedInputs.add(input);
+ }
+ } else {
+ adjustedInputs.add(input);
+ }
+ }
+ }
+
+ if (aFluidInputs == null) {
+ aFluidInputs = new FluidStack[0];
+ }
+ }
+ Collections.addAll(adjustedFluidInputs, aFluidInputs);
+ aInputs = adjustedInputs.toArray(new ItemStack[0]);
+ aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[0]);
+
+ if (aOutputs == null) {
+ aOutputs = new ItemStack[0];
+ } else {
+ aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
+ }
+
+ for (ItemStack output : aOutputs) {
+ FluidStack outputFluidContent = FluidContainerRegistry.getFluidForFilledItem(output);
+ if (outputFluidContent != null) {
+ outputFluidContent.amount *= output.stackSize;
+ if (outputFluidContent.getFluid().getName().equals("ic2steam")) {
+ outputFluidContent = GT_ModHandler.getSteam(outputFluidContent.amount);
+ }
+ adjustedFluidOutputs.add(outputFluidContent);
+ } else {
+ ItemData itemData = GT_OreDictUnificator.getItemData(output);
+ if (!(itemData != null && itemData.hasValidPrefixMaterialData() && itemData.mMaterial.mMaterial == Materials.Empty)) {
+ adjustedOutputs.add(output);
+ }
+ }
+ }
+ if (aFluidOutputs == null) {
+ aFluidOutputs = new FluidStack[0];
+ }
+ Collections.addAll(adjustedFluidOutputs, aFluidOutputs);
+ aOutputs = adjustedOutputs.toArray(new ItemStack[0]);
+ aFluidOutputs = adjustedFluidOutputs.toArray(new FluidStack[0]);
+
+ return addRecipe(new GT_Recipe_LargeChemicalReactor(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ private static class GT_Recipe_LargeChemicalReactor extends GT_Recipe{
+
+ protected GT_Recipe_LargeChemicalReactor(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getInputPositionedStacks() {
+ int itemLimit = Math.min(mInputs.length, TOTAL_INPUT_COUNT);
+ int fluidLimit = Math.min(mFluidInputs.length, TOTAL_INPUT_COUNT - itemLimit);
+ int inputlimit = itemLimit + fluidLimit;
+ int j = 0;
+
+ ArrayList<PositionedStack> inputStacks = new ArrayList<>(inputlimit);
+
+ for (int i = 0; i < itemLimit; i++, j++) {
+ if (this.mInputs == null || (this.mInputs[i] == null && (i == 0 && itemLimit == 1))) {
+ if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
+ GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
+ else
+ GT_Log.out.println("recipe " + this.toString() + " has errored!");
+
+ new Exception("Recipe Fixme").printStackTrace(GT_Log.out);
+ }
+
+
+ if ((this.mInputs != null && this.mInputs[i] != null) || !GT_Values.allow_broken_recipemap)
+ inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ else
+ inputStacks.add(new FixedPositionedStack(new ItemStack(Items.command_block_minecart), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ }
+
+ for (int i = 0; i < fluidLimit; i++, j++) {
+ if (this.mFluidInputs == null || this.mFluidInputs[i] == null) {
+ if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
+ GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
+ else
+ GT_Log.out.println("recipe " + this.toString() + " has errored!");
+
+ new Exception("Recipe Fixme").printStackTrace(GT_Log.out);
+ }
+
+ if ((this.mFluidInputs != null && this.mFluidInputs[i] != null) || !GT_Values.allow_broken_recipemap)
+ inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ }
+
+ return inputStacks;
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getOutputPositionedStacks() {
+ int itemLimit = Math.min(mOutputs.length, OUTPUT_COUNT);
+ int fluidLimit = Math.min(mFluidOutputs.length, FLUID_OUTPUT_COUNT);
+ ArrayList<PositionedStack> outputStacks = new ArrayList<>(itemLimit + fluidLimit);
+
+ for (int i = 0; i < itemLimit; i++) {
+ outputStacks.add(new FixedPositionedStack(this.mOutputs[i].copy(), 102 + i * 18, 5));
+ }
+
+ for (int i = 0; i < fluidLimit; i++) {
+ outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true), 102 + i * 18, 23));
+ }
+
+ return outputStacks;
+ }
+
+
+ }
+ }
+ public static class GT_Recipe_Map_DistillationTower extends GT_Recipe_Map {
+ private static final int FLUID_OUTPUT_COUNT = 11;
+ private static final int ROW_SIZE = 3;
+
+ public GT_Recipe_Map_DistillationTower() {
+ super(new HashSet<>(110), "gt.recipe.distillationtower", "Distillation Tower", null, RES_PATH_GUI + "basicmachines/DistillationTower", 2, 4, 0, 0, 1, E, 1, E, true, true);
+ }
+
+ @Override
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GT_Recipe_DistillationTower(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ @Override
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
+ }
+
+ private static class GT_Recipe_DistillationTower extends GT_Recipe{
+ protected GT_Recipe_DistillationTower(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
+ }
+
+ @Override
+ public ArrayList<PositionedStack> getInputPositionedStacks() {
+ ArrayList<PositionedStack> inputStacks = new ArrayList<>(1);
+
+ if (this.mFluidInputs.length > 0 && this.mFluidInputs[0] != null) {
+ inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[0], true), 48, 52));
+ }
+ return inputStacks;
+ }
+ @Override
+ public ArrayList<PositionedStack> getOutputPositionedStacks() {
+ int fluidLimit = Math.min(mFluidOutputs.length, FLUID_OUTPUT_COUNT);
+ ArrayList<PositionedStack> outputStacks = new ArrayList<>(1 + fluidLimit);
+
+ if (this.mOutputs.length > 0 && this.mOutputs[0] != null) {
+ outputStacks.add(new FixedPositionedStack(this.getOutput(0), 102, 52));
+ }
+
+ for (int i = 0; i < fluidLimit; i++) {
+ int x = 102 + ((i + 1) % ROW_SIZE) * 18;
+ int y = 52 - ((i + 1) / ROW_SIZE) * 18;
+ outputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidOutputs[i], true), x, y));
+ }
+ return outputStacks;
+ }
+
+ }
+ }
+
+ public static class GT_Recipe_WithAlt extends GT_Recipe {
+
+ ItemStack[][] mOreDictAlt;
+
+ public GT_Recipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, ItemStack[][] aAlt) {
+ super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
+ mOreDictAlt = aAlt;
+ }
+
+
+ public Object getAltRepresentativeInput(int aIndex) {
+ if (aIndex < 0) return null;
+ if (aIndex < mOreDictAlt.length) {
+ if (mOreDictAlt[aIndex] != null && mOreDictAlt[aIndex].length > 0) {
+ ItemStack[] rStacks = new ItemStack[mOreDictAlt[aIndex].length];
+ for (int i = 0; i < mOreDictAlt[aIndex].length; i++) {
+ rStacks[i] = GT_Utility.copy(mOreDictAlt[aIndex][i]);
+ }
+ return rStacks;
+ }
+ }
+ if (aIndex >= mInputs.length) return null;
+ return GT_Utility.copy(mInputs[aIndex]);
+ }
+
+ }
+}