aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/gregtech
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-06-20 02:01:03 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-06-20 02:01:03 +1000
commit92cedd818ccdb57085b14c8ed735e903479ac581 (patch)
tree381e97ba38cdd36359ce5d386bbeec85ba90fe81 /src/Java/miscutil/gregtech
parent92f6969706a9c8c4cbe1bcc6a96c6d1de4f6185d (diff)
downloadGT5-Unofficial-92cedd818ccdb57085b14c8ed735e903479ac581.tar.gz
GT5-Unofficial-92cedd818ccdb57085b14c8ed735e903479ac581.tar.bz2
GT5-Unofficial-92cedd818ccdb57085b14c8ed735e903479ac581.zip
+Added New Circuits & Components along with recipes.
+Added A complete set of Machine components up to MAX voltage along with recipes. +Started Initial work on multiblock items (Similar to the turbine rotor needed in Large turbines) +Added better support for future recipe additions.
Diffstat (limited to 'src/Java/miscutil/gregtech')
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechItemList.java10
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechOreDictNames.java30
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java744
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechTextureSet.java144
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechTextures.java96
-rw-r--r--src/Java/miscutil/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java16
-rw-r--r--src/Java/miscutil/gregtech/api/interfaces/internal/Interface_ToolStats.java155
-rw-r--r--src/Java/miscutil/gregtech/api/items/Gregtech_MetaItem_Base.java85
-rw-r--r--src/Java/miscutil/gregtech/api/items/Gregtech_MetaTool.java605
-rw-r--r--src/Java/miscutil/gregtech/api/objects/GregtechItemData.java131
-rw-r--r--src/Java/miscutil/gregtech/api/util/GregtechRecipe.java35
-rw-r--r--src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java1
-rw-r--r--src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechItems.java48
-rw-r--r--src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechTools.java24
-rw-r--r--src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_Base.java168
-rw-r--r--src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java49
-rw-r--r--src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java27
17 files changed, 2265 insertions, 103 deletions
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java b/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java
index 784f521765..6db2a06be7 100644
--- a/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java
@@ -69,8 +69,16 @@ public enum GregtechItemList implements GregtechItemContainer {
Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX,
Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX,
Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX,
+
+ //Circuits
Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
- Circuit_Data, Circuit_Elite, Circuit_Master;
+ Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ //Circuit Parts
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
public static final GregtechItemList[]
DYE_ONLY_ITEMS = {
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechOreDictNames.java b/src/Java/miscutil/gregtech/api/enums/GregtechOreDictNames.java
index 56079d38c1..7720ed8c0f 100644
--- a/src/Java/miscutil/gregtech/api/enums/GregtechOreDictNames.java
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechOreDictNames.java
@@ -1,8 +1,34 @@
package miscutil.gregtech.api.enums;
-
+/* 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)
+*
+Circuits
+ Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
+ Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+Circuit Parts
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
+*/
public enum GregtechOreDictNames {
- buffer_core, itemGregConduit;
+ buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
public String unlocalisedName;
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java
new file mode 100644
index 0000000000..305f248345
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java
@@ -0,0 +1,744 @@
+package miscutil.gregtech.api.enums;
+
+import static gregtech.api.enums.GT_Values.D2;
+import static gregtech.api.enums.GT_Values.M;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Element;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.interfaces.IColorModulationContainer;
+import gregtech.api.interfaces.ICondition;
+import gregtech.api.interfaces.ISubTagContainer;
+import gregtech.api.objects.GT_FluidStack;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+import miscutil.core.lib.CORE;
+import miscutil.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import miscutil.gregtech.api.objects.GregtechItemData;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+
+public enum GregtechOrePrefixes {
+ /* 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
+
+ //public static volatile int VERSION = 508;
+
+ 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<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<GregtechOrePrefixes>();
+ /**
+ * 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;
+ private final Collection<Materials> mNotGeneratedItems = new HashSet<Materials>(), mIgnoredMaterials = new HashSet<Materials>(), mGeneratedItems = new HashSet<Materials>();
+ private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<Interface_OreRecipeRegistrator>();
+ public ItemStack mContainerItem = null;
+ public ICondition<ISubTagContainer> mCondition = null;
+ public byte mDefaultStackSize = 64;
+ public MaterialStack mSecondaryMaterial = null;
+ public GregtechOrePrefixes mPrefixInto = this;
+ public float mHeatDamage = 0.0F; // Negative for Frost Damage
+ /**
+ * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
+ */
+ public int mMaterialGenerationBits = 0;
+ private GregtechOrePrefixes(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 GregtechOrePrefixes getOrePrefix(String aOre) {
+ for (GregtechOrePrefixes tPrefix : values())
+ if (aOre.startsWith(tPrefix.toString())) {
+ return tPrefix;
+ }
+ return null;
+ }
+
+ public static String stripPrefix(String aOre) {
+ for (GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), "");
+ }
+ }
+ return aOre;
+ }
+
+ public static String replacePrefix(String aOre, GregtechOrePrefixes aPrefix) {
+ for (GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
+ }
+ }
+ return "";
+ }
+
+ public static GregtechOrePrefixes getPrefix(String aPrefixName) {
+ return getPrefix(aPrefixName, null);
+ }
+
+ public static GregtechOrePrefixes getPrefix(String aPrefixName, GregtechOrePrefixes aReplacement) {
+ Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
+ if (tObject != null && tObject instanceof GregtechOrePrefixes) return (GregtechOrePrefixes) tObject;
+ return aReplacement;
+ }
+
+ public static Materials getMaterial(String aOre) {
+ return Materials.get(stripPrefix(aOre));
+ }
+
+ public static Materials getMaterial(String aOre, GregtechOrePrefixes aPrefix) {
+ return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static Materials getRealMaterial(String aOre, GregtechOrePrefixes aPrefix) {
+ return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static boolean isInstanceOf(String aName, GregtechOrePrefixes aPrefix) {
+ return aName == null ? false : aName.startsWith(aPrefix.toString());
+ }
+
+ public boolean add(ItemStack aStack) {
+ if (aStack == null) return false;
+ if (!contains(aStack)) mPrefixedItems.add(aStack);
+ while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null);
+ return true;
+ }
+
+ public boolean contains(ItemStack aStack) {
+ if (aStack == null) return false;
+ 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)) && !mNotGeneratedItems.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(GregtechOrePrefixes aPrefix) {
+ if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false;
+ return mFamiliarPrefixes.add(aPrefix);
+ }
+
+ public boolean add(Interface_OreRecipeRegistrator 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))
+ for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessing) {
+ if (D2)
+ GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' 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 GregtechItemData(this, (Materials) aMaterial);
+ return name() + aMaterial;
+ }
+
+ @SuppressWarnings("incomplete-switch")
+ public String getDefaultLocalNameForItem(Materials aMaterial) {
+
+
+ // Use Standard Localization
+ return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + mLocalizedMaterialPost;
+ }
+
+ public enum GT_Materials implements IColorModulationContainer, ISubTagContainer {
+
+
+
+ /**
+ * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen.
+ * <p/>
+ * Mainly for preventing NullPointer Exceptions and providing Default Values.
+ */
+ _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Arrays.asList(new TC_AspectStack(TC_Aspects.VACUOS, 1))),
+
+
+ /**
+ * Circuitry, Batteries and other Technical things
+ */
+ Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 4), new TC_AspectStack(TC_Aspects.MACHINA, 4))),
+ Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 6), new TC_AspectStack(TC_Aspects.MACHINA, 6))),
+ Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 8), new TC_AspectStack(TC_Aspects.MACHINA, 8)));
+
+ /*Advanced(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Advanced", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 4))),
+ Data(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Data", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 5))),
+ Elite(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Elite", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 6))),
+ Master(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Master", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 7))),
+ Ultimate(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Ultimate", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 8))),
+ Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Superconductor", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 8))),
+ Infinite(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Infinite", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray);*/
+
+ /**
+ * List of all Materials.
+ */
+ public static final Collection<GT_Materials> VALUES = new HashSet<GT_Materials>(Arrays.asList(values()));
+
+
+ static {
+ /*Primitive.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Basic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Good.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Advanced.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Data.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Elite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Master.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Ultimate.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Superconductor.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Infinite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);*/
+ Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ }
+
+
+ /**
+ * This Array can be changed dynamically by a Tick Handler in order to get a glowing Effect on all GT Meta Items out of this Material.
+ */
+ public final short[] mRGBa = new short[]{255, 255, 255, 0}, mMoltenRGBa = new short[]{255, 255, 255, 0};
+ public final TextureSet mIconSet;
+ public final int mMetaItemSubID;
+ public final boolean mUnificatable;
+ public final GT_Materials mMaterialInto;
+ public final List<MaterialStack> mMaterialList = new ArrayList<MaterialStack>();
+ public final List<GT_Materials> mOreByProducts = new ArrayList<GT_Materials>(), mOreReRegistrations = new ArrayList<GT_Materials>();
+ public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
+ private final ArrayList<ItemStack> mMaterialItems = new ArrayList<ItemStack>();
+ private final Collection<SubTag> mSubTags = new HashSet<SubTag>();
+ public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
+ public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
+ public boolean mBlastFurnaceRequired = false;
+ public float mToolSpeed = 1.0F, mHeatDamage = 0.0F;
+ public String mChemicalFormula = "?", mDefaultLocalName = "null";
+ public Dyes mColor = Dyes._NULL;
+ public short mMeltingPoint = 0, mBlastFurnaceTemp = 0;
+ public int mTypes = 0, mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1;
+ public long mDensity = M;
+ public Element mElement = null;
+ public GT_Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this;
+ public byte mToolQuality = 0;
+ public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null;
+ /**
+ * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one Material Unit worth
+ */
+ public Fluid mStandardMoltenFluid = null;
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, boolean aUnificatable) {
+ mUnificatable = aUnificatable;
+ mMaterialInto = this;
+ mMetaItemSubID = aMetaItemSubID;
+ mToolQuality = (byte) aToolQuality;
+ mDurability = aToolDurability;
+ mToolSpeed = aToolSpeed;
+ mIconSet = aIconSet;
+ if (aMetaItemSubID >= 0) {
+ if (CORE.sMU_GeneratedMaterials[aMetaItemSubID] == null) {
+ CORE.sMU_GeneratedMaterials[aMetaItemSubID] = this;
+ } else {
+ throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!");
+ }
+ }
+ }
+
+ private GT_Materials(GT_Materials aMaterialInto, boolean aReRegisterIntoThis) {
+ mUnificatable = false;
+ mDefaultLocalName = aMaterialInto.mDefaultLocalName;
+ mMaterialInto = aMaterialInto.mMaterialInto;
+ if (aReRegisterIntoThis) mMaterialInto.mOreReRegistrations.add(this);
+ mChemicalFormula = aMaterialInto.mChemicalFormula;
+ mMetaItemSubID = -1;
+ mIconSet = TextureSet.SET_NONE;
+ }
+
+ /**
+ * @param aMetaItemSubID the Sub-ID used in my own MetaItems. Range 0-1000. -1 for no Material
+ * @param aTypes which kind of Items should be generated. Bitmask as follows:
+ * 1 = Dusts of all kinds.
+ * 2 = Dusts, Ingots, Plates, Rods/Sticks, Machine Components and other Metal specific things.
+ * 4 = Dusts, Gems, Plates, Lenses (if transparent).
+ * 8 = Dusts, Impure Dusts, crushed Ores, purified Ores, centrifuged Ores etc.
+ * 16 = Cells
+ * 32 = Plasma Cells
+ * 64 = Tool Heads
+ * 128 = Gears
+ * @param aR, aG, aB Color of the Material 0-255 each.
+ * @param aA transparency of the Material Texture. 0 = fully visible, 255 = Invisible.
+ * @param aLocalName The Name used as Default for localization.
+ * @param aFuelType Type of Generator to get Energy from this Material.
+ * @param aFuelPower EU generated. Will be multiplied by 1000, also additionally multiplied by 2 for Gems.
+ * @param aAmplificationValue Amount of UUM amplifier gotten from this.
+ * @param aUUMEnergy Amount of EU needed to shape the UUM into this Material.
+ * @param aMeltingPoint Used to determine the smelting Costs in Furnii.
+ * @param aBlastFurnaceTemp Used to determine the needed Heat capactiy Costs in Blast Furnii.
+ * @param aBlastFurnaceRequired If this requires a Blast Furnace.
+ * @param aColor Vanilla MC Wool Color which comes the closest to this.
+ */
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
+ mDefaultLocalName = aLocalName;
+ mMeltingPoint = (short) aMeltingPoint;
+ mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
+ mBlastFurnaceRequired = aBlastFurnaceRequired;
+ if (aTransparent) add(SubTag.TRANSPARENT);
+ mFuelPower = aFuelPower;
+ mFuelType = aFuelType;
+ mOreValue = aOreValue;
+ mDensity = (M * aDensityMultiplier) / aDensityDivider;
+ mColor = aColor == null ? Dyes._NULL : aColor;
+ if (mColor != null) add(SubTag.HAS_COLOR);
+ mRGBa[0] = mMoltenRGBa[0] = (short) aR;
+ mRGBa[1] = mMoltenRGBa[1] = (short) aG;
+ mRGBa[2] = mMoltenRGBa[2] = (short) aB;
+ mRGBa[3] = mMoltenRGBa[3] = (short) aA;
+ mTypes = aTypes;
+ if ((mTypes & 2) != 0) add(SubTag.SMELTING_TO_FLUID);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mAspects.addAll(aAspects);
+ }
+
+ /**
+ * @param aElement The Element Enum represented by this Material
+ */
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mElement = aElement;
+ //mElement.mLinkedMaterials.add(this);
+ if (aElement == Element._NULL) {
+ mChemicalFormula = "Empty";
+ } else {
+ mChemicalFormula = aElement.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
+ }
+ mAspects.addAll(aAspects);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList, null);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mExtraData = aExtraData;
+ mMaterialList.addAll(aMaterialList);
+ mChemicalFormula = "";
+ for (MaterialStack tMaterial : mMaterialList) mChemicalFormula += tMaterial.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
+
+ int tAmountOfComponents = 0, tMeltingPoint = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmountOfComponents += tMaterial.mAmount;
+ if (tMaterial.mMaterial.mMeltingPoint > 0)
+ tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount;
+ if (aAspects == null)
+ for (TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) tAspect.addToAspectList(mAspects);
+ }
+
+ if (mMeltingPoint < 0) mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
+
+ tAmountOfComponents *= aDensityMultiplier;
+ tAmountOfComponents /= aDensityDivider;
+ if (aAspects == null) for (TC_AspectStack tAspect : mAspects)
+ tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
+ else mAspects.addAll(aAspects);
+ }
+
+ public static GT_Materials get(String aMaterialName) {
+ Object tObject = GT_Utility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
+ if (tObject != null && tObject instanceof Materials) return (GT_Materials) tObject;
+ return _NULL;
+ }
+
+ public static GT_Materials getRealMaterial(String aMaterialName) {
+ return get(aMaterialName).mMaterialInto;
+ }
+
+ /**
+ * Called in preInit with the Config to set Values.
+ *
+ * @param aConfiguration
+ */
+ public static void init(GT_Config aConfiguration) {
+ for (GT_Materials tMaterial : VALUES) {
+ String tString = tMaterial.toString().toLowerCase();
+ tMaterial.mHeatDamage = (float) aConfiguration.get(ConfigCategories.Materials.heatdamage, tString, tMaterial.mHeatDamage);
+ if (tMaterial.mBlastFurnaceRequired)
+ tMaterial.mBlastFurnaceRequired = aConfiguration.get(ConfigCategories.Materials.blastfurnacerequirements, tString, true);
+ if (tMaterial.mBlastFurnaceRequired && aConfiguration.get(ConfigCategories.Materials.blastinductionsmelter, tString, tMaterial.mBlastFurnaceTemp < 1500)){}
+ //GT_ModHandler.ThermalExpansion.addSmelterBlastOre(tMaterial);
+ //tMaterial.mHandleMaterial = (tMaterial == Desh ? tMaterial.mHandleMaterial : tMaterial == Diamond || tMaterial == Thaumium ? Wood : tMaterial.contains(SubTag.BURNING) ? Blaze : tMaterial.contains(SubTag.MAGICAL) && tMaterial.contains(SubTag.CRYSTAL) && Loader.isModLoaded(MOD_ID_TC) ? Thaumium : tMaterial.getMass() > Element.Tc.getMass() * 2 ? TungstenSteel : tMaterial.getMass() > Element.Tc.getMass() ? Steel : Wood);
+ }
+ }
+
+ public boolean isRadioactive() {
+ if (mElement != null) return mElement.mHalfLifeSeconds >= 0;
+ for (MaterialStack tMaterial : mMaterialList) if (tMaterial.mMaterial.isRadioactive()) return true;
+ return false;
+ }
+
+ public long getProtons() {
+ if (mElement != null) return mElement.getProtons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getProtons();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getNeutrons() {
+ if (mElement != null) return mElement.getNeutrons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getNeutrons();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getMass() {
+ if (mElement != null) return mElement.getMass();
+ if (mMaterialList.size() <= 0) return Element.Tc.getMass();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getDensity() {
+ return mDensity;
+ }
+
+ public String getToolTip() {
+ return getToolTip(1, false);
+ }
+
+ public String getToolTip(boolean aShowQuestionMarks) {
+ return getToolTip(1, aShowQuestionMarks);
+ }
+
+ public String getToolTip(long aMultiplier) {
+ return getToolTip(aMultiplier, false);
+ }
+
+ public String getToolTip(long aMultiplier, boolean aShowQuestionMarks) {
+ if (!aShowQuestionMarks && mChemicalFormula.equals("?")) return "";
+ if (aMultiplier >= M * 2 && !mMaterialList.isEmpty()) {
+ return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1)) ? mChemicalFormula : "(" + mChemicalFormula + ")") + aMultiplier;
+ }
+ return mChemicalFormula;
+ }
+
+ /**
+ * Adds an ItemStack to this Material.
+ */
+ public GT_Materials add(ItemStack aStack) {
+ if (aStack != null && !contains(aStack)) mMaterialItems.add(aStack);
+ return this;
+ }
+
+ /**
+ * This is used to determine if any of the ItemStacks belongs to this Material.
+ */
+ public boolean contains(ItemStack... aStacks) {
+ if (aStacks == null || aStacks.length <= 0) return false;
+ for (ItemStack tStack : mMaterialItems)
+ for (ItemStack aStack : aStacks)
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true;
+ return false;
+ }
+
+ /**
+ * This is used to determine if an ItemStack belongs to this Material.
+ */
+ public boolean remove(ItemStack aStack) {
+ if (aStack == null) return false;
+ boolean temp = false;
+ for (int i = 0; i < mMaterialItems.size(); i++)
+ if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) {
+ mMaterialItems.remove(i--);
+ temp = true;
+ }
+ return temp;
+ }
+
+ /**
+ * Adds a SubTag to this Material
+ */
+ @Override
+ public ISubTagContainer add(SubTag... aTags) {
+ if (aTags != null) for (SubTag aTag : aTags)
+ if (aTag != null && !contains(aTag)) {
+ aTag.addContainerToList(this);
+ mSubTags.add(aTag);
+ }
+ return this;
+ }
+
+ /**
+ * If this Material has this exact SubTag
+ */
+ @Override
+ public boolean contains(SubTag aTag) {
+ return mSubTags.contains(aTag);
+ }
+
+ /**
+ * Removes a SubTag from this Material
+ */
+ @Override
+ public boolean remove(SubTag aTag) {
+ return mSubTags.remove(aTag);
+ }
+
+ /**
+ * Sets the Heat Damage for this Material (negative = frost)
+ */
+ public GT_Materials setHeatDamage(float aHeatDamage) {
+ mHeatDamage = aHeatDamage;
+ return this;
+ }
+
+ /**
+ * Adds a Material to the List of Byproducts when grinding this Ore.
+ * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials.
+ */
+ public GT_Materials addOreByProduct(GT_Materials aMaterial) {
+ if (!mOreByProducts.contains(aMaterial.mMaterialInto)) mOreByProducts.add(aMaterial.mMaterialInto);
+ return this;
+ }
+
+ /**
+ * Adds multiple Materials to the List of Byproducts when grinding this Ore.
+ * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials.
+ */
+ public GT_Materials addOreByProducts(GT_Materials... aMaterials) {
+ for (GT_Materials tMaterial : aMaterials) if (tMaterial != null) addOreByProduct(tMaterial);
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setOreMultiplier(int aOreMultiplier) {
+ if (aOreMultiplier > 0) mOreMultiplier = aOreMultiplier;
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Byproduct Material.
+ */
+ public GT_Materials setByProductMultiplier(int aByProductMultiplier) {
+ if (aByProductMultiplier > 0) mByProductMultiplier = aByProductMultiplier;
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setSmeltingMultiplier(int aSmeltingMultiplier) {
+ if (aSmeltingMultiplier > 0) mSmeltingMultiplier = aSmeltingMultiplier;
+ return this;
+ }
+
+ /**
+ * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself.
+ */
+ public GT_Materials setDirectSmelting(GT_Materials aMaterial) {
+ if (aMaterial != null) mDirectSmelting = aMaterial.mMaterialInto.mDirectSmelting;
+ return this;
+ }
+
+ /**
+ * This Material should be the Main Material this Ore gets ground into.
+ * Example, Chromite giving Chrome or Tungstate giving Tungsten.
+ */
+ public GT_Materials setOreReplacement(GT_Materials aMaterial) {
+ if (aMaterial != null) mOreReplacement = aMaterial.mMaterialInto.mOreReplacement;
+ return this;
+ }
+
+ /**
+ * This Material smelts always into an instance of aMaterial. Used for Magnets.
+ */
+ public GT_Materials setSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
+ return this;
+ }
+
+ /**
+ * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron.
+ */
+ public GT_Materials setArcSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
+ return this;
+ }
+
+ /**
+ * This Material macerates always into an instance of aMaterial.
+ */
+ public GT_Materials setMaceratingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mMacerateInto = aMaterial.mMaterialInto.mMacerateInto;
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForTools(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentTools = aEnchantment;
+ mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForArmors(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentArmors = aEnchantment;
+ mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public FluidStack getSolid(long aAmount) {
+ if (mSolid == null) return null;
+ return new GT_FluidStack(mSolid, (int) aAmount);
+ }
+
+ public FluidStack getFluid(long aAmount) {
+ if (mFluid == null) return null;
+ return new GT_FluidStack(mFluid, (int) aAmount);
+ }
+
+ public FluidStack getGas(long aAmount) {
+ if (mGas == null) return null;
+ return new GT_FluidStack(mGas, (int) aAmount);
+ }
+
+ public FluidStack getPlasma(long aAmount) {
+ if (mPlasma == null) return null;
+ return new GT_FluidStack(mPlasma, (int) aAmount);
+ }
+
+ public FluidStack getMolten(long aAmount) {
+ if (mStandardMoltenFluid == null) return null;
+ return new GT_FluidStack(mStandardMoltenFluid, (int) aAmount);
+ }
+
+ @Override
+ public short[] getRGBA() {
+ return mRGBa;
+ }
+
+ public static volatile int VERSION = 508;
+
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechTextureSet.java b/src/Java/miscutil/gregtech/api/enums/GregtechTextureSet.java
new file mode 100644
index 0000000000..e8d10d4d32
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechTextureSet.java
@@ -0,0 +1,144 @@
+package miscutil.gregtech.api.enums;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+
+public class GregtechTextureSet {
+ public static final GregtechTextureSet
+ SET_NONE = new GregtechTextureSet("NONE"), SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"), SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"), SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"), SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"), SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"), SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"), SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"), SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"), SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"), SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"), SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL");
+
+ public final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
+
+ public GregtechTextureSet(String aSetName) {
+ mSetName = aSetName;
+ mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/turbineBlade");
+ mTextures[1] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java b/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java
index 2db6f14599..816f1ba543 100644
--- a/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java
@@ -1,8 +1,11 @@
package miscutil.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 miscutil.core.lib.CORE;
+import miscutil.core.util.Utils;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
@@ -69,7 +72,7 @@ public class GregtechTextures {
@Override
public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
+ return TextureMap.locationBlocksTexture; //TODO
}
public static class CustomIcon implements IIconContainer, Runnable {
@@ -102,5 +105,96 @@ public class GregtechTextures {
}
}
}
+
+
+ public enum ItemIcons implements IIconContainer, Runnable {
+ VOID, RENDERING_ERROR, // The Empty Texture
+ TURBINE, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
+
+ public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private 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(CORE.MODID+":" + "iconsets/" + this);
+ if (mIcon != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.MODID+":" + "iconsets/" + this);
+ }
+ else if (mIcon == null){
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this);
+ if (mIcon != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this);
+ }
+ else {
+ Utils.LOG_INFO("Did not find Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this);
+ }
+ }
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + "iconsets/" + this + "_OVERLAY");
+ if (mOverlay != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.MODID+":" + "iconsets/" + this+ "_OVERLAY");
+ }
+ else if (mOverlay == null){
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY");
+ if (mOverlay != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY");
+ }
+ else {
+ Utils.LOG_INFO("Did not find Texture at "+CORE.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(CORE.MODID+":" + mIconName);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
+
}
diff --git a/src/Java/miscutil/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/Java/miscutil/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
new file mode 100644
index 0000000000..83a7a1d1fc
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
@@ -0,0 +1,16 @@
+package miscutil.gregtech.api.interfaces.internal;
+
+import gregtech.api.enums.Materials;
+import miscutil.gregtech.api.enums.GregtechOrePrefixes;
+import net.minecraft.item.ItemStack;
+
+public interface Interface_OreRecipeRegistrator {
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/Java/miscutil/gregtech/api/interfaces/internal/Interface_ToolStats.java
new file mode 100644
index 0000000000..3ac112ecc4
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/interfaces/internal/Interface_ToolStats.java
@@ -0,0 +1,155 @@
+package miscutil.gregtech.api.interfaces.internal;
+
+import gregtech.api.interfaces.IIconContainer;
+
+import java.util.List;
+
+import miscutil.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+import net.minecraftforge.event.world.BlockEvent;
+
+/**
+ * The Stats for GT Tools. Not including any Material Modifiers.
+ * <p/>
+ * And this is supposed to not have any ItemStack Parameters as these are generic Stats.
+ */
+public interface Interface_ToolStats {
+ /**
+ * Called when aPlayer crafts this Tool
+ */
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
+
+ /**
+ * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerBlockBreak();
+
+ /**
+ * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerDropConversion();
+
+ /**
+ * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal.
+ */
+ public int getToolDamagePerContainerCraft();
+
+ /**
+ * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
+ */
+ public int getToolDamagePerEntityAttack();
+
+ /**
+ * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible.
+ */
+ public int getBaseQuality();
+
+ /**
+ * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
+ */
+ public float getBaseDamage();
+
+ /**
+ * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
+ */
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
+ */
+ public float getSpeedMultiplier();
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
+ */
+ public float getMaxDurabilityMultiplier();
+
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+
+ public String getMiningSound();
+
+ public String getCraftingSound();
+
+ public String getEntityHitSound();
+
+ public String getBreakingSound();
+
+ public Enchantment[] getEnchantments(ItemStack aStack);
+
+ public int[] getEnchantmentLevels(ItemStack aStack);
+
+ /**
+ * @return If this Tool can be used for blocking Damage like a Sword.
+ */
+ public boolean canBlock();
+
+ /**
+ * @return If this Tool can be used as an RC Crowbar.
+ */
+ public boolean isCrowbar();
+
+ /**
+ * @return If this Tool can be used as an BC Wrench.
+ */
+ public boolean isWrench();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isWeapon();
+
+ /**
+ * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something
+ */
+ public boolean isRangedWeapon();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isMiningTool();
+
+ /**
+ * aBlock.getHarvestTool(aMetaData) can return the following Values for example.
+ * "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch"
+ *
+ * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check.
+ */
+ public boolean isMinableBlock(Block aBlock, byte aMetaData);
+
+ /**
+ * This lets you modify the Drop List, when this type of Tool has been used.
+ *
+ * @return the Amount of modified Items.
+ */
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
+
+ /**
+ * @return Returns a broken Version of the Item.
+ */
+ public ItemStack getBrokenItem(ItemStack aStack);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/items/Gregtech_MetaItem_Base.java b/src/Java/miscutil/gregtech/api/items/Gregtech_MetaItem_Base.java
index 288d90a577..5186e1905c 100644
--- a/src/Java/miscutil/gregtech/api/items/Gregtech_MetaItem_Base.java
+++ b/src/Java/miscutil/gregtech/api/items/Gregtech_MetaItem_Base.java
@@ -325,91 +325,6 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item imple
}
}
- /*
-
- @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;
diff --git a/src/Java/miscutil/gregtech/api/items/Gregtech_MetaTool.java b/src/Java/miscutil/gregtech/api/items/Gregtech_MetaTool.java
new file mode 100644
index 0000000000..8e659b959a
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/items/Gregtech_MetaTool.java
@@ -0,0 +1,605 @@
+package miscutil.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.MOD_ID_RC;
+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.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Random;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.gregtech.api.interfaces.internal.Interface_ToolStats;
+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.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.event.world.BlockEvent;
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * 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(16, 1, Materials.Bismuth, Materials.Bismuth, null);
+ */
+@Optional.InterfaceList(value = {@Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft")})
+public abstract class Gregtech_MetaTool extends Gregtech_MetaItem_Base implements IDamagableItem, IToolCrowbar, IToolWrench {
+ /**
+ * 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 HashMap<String, Gregtech_MetaTool> sInstances = new HashMap<String, Gregtech_MetaTool>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final HashMap<Short, Interface_ToolStats> mToolStats = new HashMap<Short, Interface_ToolStats>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaTool(String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ 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, Interface_ToolStats 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);
+ Interface_ToolStats tToolStats = getToolStats(rStack);
+ if (tToolStats != null) {
+ NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound();
+ if (aPrimaryMaterial != null) {
+ tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.toString());
+ tToolNBT.setLong("MaxDamage", 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
+ }
+ if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.toString());
+
+ 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
+ */
+ 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) {
+ Interface_ToolStats 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());
+ }
+
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ Interface_ToolStats 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) {
+ Interface_ToolStats 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) {
+ Interface_ToolStats 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);
+ }
+ }
+
+ @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) {
+ long tMaxDamage = getToolMaxDamage(aStack);
+ Materials tMaterial = getPrimaryMaterial(aStack);
+ Interface_ToolStats tStats = getToolStats(aStack);
+ int tOffset = getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ String name = aStack.getUnlocalizedName();
+ if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172") || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "L/sec");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 25) + EnumChatFormatting.GRAY + "EU/t");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "EU/t");
+
+ } else {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + getToolCombatDamage(aStack) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) + 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) {
+ Interface_ToolStats 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)) {
+ Interface_ToolStats 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 (new Random().nextInt(25) == 0) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ Interface_ToolStats 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;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || Math.max(0, getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData)) return 0.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) {
+ Interface_ToolStats 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;
+ Interface_ToolStats 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);
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return null;
+ doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ aStack = aStack.stackSize > 0 ? aStack : null;
+ if (playSound) {
+ //String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ //GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ }
+ return aStack;
+ }
+
+ public Interface_ToolStats getToolStats(ItemStack aStack) {
+ isItemStackUsable(aStack);
+ return getToolStatsInternal(aStack);
+ }
+
+ private Interface_ToolStats getToolStatsInternal(ItemStack aStack) {
+ return aStack == null ? null : mToolStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canWrench(EntityPlayer player, int x, int y, int z) {
+ System.out.println("canWrench");
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ Interface_ToolStats 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;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ if (tStats != null) doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ Interface_ToolStats 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;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ Interface_ToolStats 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) {
+ Interface_ToolStats tStats = getToolStatsInternal(aStack);
+ if (aStack.getItemDamage() % 2 == 1 || tStats == null) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return false;
+ }
+ Materials aMaterial = getPrimaryMaterial(aStack);
+ HashMap<Integer, Integer> tMap = new HashMap<Integer, Integer>(), tResult = new HashMap<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;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/objects/GregtechItemData.java b/src/Java/miscutil/gregtech/api/objects/GregtechItemData.java
new file mode 100644
index 0000000000..1a0351a00f
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/objects/GregtechItemData.java
@@ -0,0 +1,131 @@
+package miscutil.gregtech.api.objects;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.objects.GT_ArrayList;
+import gregtech.api.objects.MaterialStack;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import miscutil.gregtech.api.enums.GregtechOrePrefixes;
+import net.minecraft.item.ItemStack;
+
+public class GregtechItemData {
+ private static final MaterialStack[] EMPTY_MATERIALSTACK_ARRAY = new MaterialStack[0];
+
+ public final List<Object> mExtraData = new GT_ArrayList<Object>(false, 1);
+ public final GregtechOrePrefixes mPrefix;
+ public final MaterialStack mMaterial;
+ public final MaterialStack[] mByProducts;
+ public boolean mBlackListed = false;
+ public ItemStack mUnificationTarget = null;
+
+ public GregtechItemData(GregtechOrePrefixes aPrefix, Materials aMaterial, boolean aBlackListed) {
+ mPrefix = aPrefix;
+ mMaterial = aMaterial == null ? null : new MaterialStack(aMaterial, aPrefix.mMaterialAmount);
+ mBlackListed = aBlackListed;
+ mByProducts = aPrefix.mSecondaryMaterial == null || aPrefix.mSecondaryMaterial.mMaterial == null ? EMPTY_MATERIALSTACK_ARRAY : new MaterialStack[]{aPrefix.mSecondaryMaterial.clone()};
+ }
+
+ public GregtechItemData(GregtechOrePrefixes aPrefix, Materials aMaterial) {
+ this(aPrefix, aMaterial, false);
+ }
+
+ public GregtechItemData(MaterialStack aMaterial, MaterialStack... aByProducts) {
+ mPrefix = null;
+ mMaterial = aMaterial.mMaterial == null ? null : aMaterial.clone();
+ mBlackListed = true;
+ if (aByProducts == null) {
+ mByProducts = EMPTY_MATERIALSTACK_ARRAY;
+ } else {
+ MaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_MATERIALSTACK_ARRAY : new MaterialStack[aByProducts.length];
+ int j = 0;
+ for (int i = 0; i < aByProducts.length; i++)
+ if (aByProducts[i] != null && aByProducts[i].mMaterial != null)
+ tByProducts[j++] = aByProducts[i].clone();
+ mByProducts = j > 0 ? new MaterialStack[j] : EMPTY_MATERIALSTACK_ARRAY;
+ for (int i = 0; i < mByProducts.length; i++) mByProducts[i] = tByProducts[i];
+ }
+ }
+
+ public GregtechItemData(Materials aMaterial, long aAmount, MaterialStack... aByProducts) {
+ this(new MaterialStack(aMaterial, aAmount), aByProducts);
+ }
+
+ public GregtechItemData(Materials aMaterial, long aAmount, Materials aByProduct, long aByProductAmount) {
+ this(new MaterialStack(aMaterial, aAmount), new MaterialStack(aByProduct, aByProductAmount));
+ }
+
+ public GregtechItemData(GregtechItemData... aData) {
+ mPrefix = null;
+ mBlackListed = true;
+
+ ArrayList<MaterialStack> aList = new ArrayList<MaterialStack>(), rList = new ArrayList<MaterialStack>();
+
+ for (GregtechItemData tData : aData)
+ if (tData != null) {
+ if (tData.hasValidMaterialData() && tData.mMaterial.mAmount > 0) aList.add(tData.mMaterial.clone());
+ for (MaterialStack tMaterial : tData.mByProducts)
+ if (tMaterial.mAmount > 0) aList.add(tMaterial.clone());
+ }
+
+ for (MaterialStack aMaterial : aList) {
+ boolean temp = true;
+ for (MaterialStack tMaterial : rList)
+ if (aMaterial.mMaterial == tMaterial.mMaterial) {
+ tMaterial.mAmount += aMaterial.mAmount;
+ temp = false;
+ break;
+ }
+ if (temp) rList.add(aMaterial.clone());
+ }
+
+ Collections.sort(rList, new Comparator<MaterialStack>() {
+ @Override
+ public int compare(MaterialStack a, MaterialStack b) {
+ return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;
+ }
+ });
+
+ if (rList.isEmpty()) {
+ mMaterial = null;
+ } else {
+ mMaterial = rList.get(0);
+ rList.remove(0);
+ }
+
+ mByProducts = rList.toArray(new MaterialStack[rList.size()]);
+ }
+
+ public boolean hasValidPrefixMaterialData() {
+ return mPrefix != null && mMaterial != null && mMaterial.mMaterial != null;
+ }
+
+ public boolean hasValidPrefixData() {
+ return mPrefix != null;
+ }
+
+ public boolean hasValidMaterialData() {
+ return mMaterial != null && mMaterial.mMaterial != null;
+ }
+
+ public ArrayList<MaterialStack> getAllMaterialStacks() {
+ ArrayList<MaterialStack> rList = new ArrayList();
+ if (hasValidMaterialData()) rList.add(mMaterial);
+ rList.addAll(Arrays.asList(mByProducts));
+ return rList;
+ }
+
+ public MaterialStack getByProduct(int aIndex) {
+ return aIndex >= 0 && aIndex < mByProducts.length ? mByProducts[aIndex] : null;
+ }
+
+ @Override
+ public String toString() {
+ if (mPrefix == null || mMaterial == null || mMaterial.mMaterial == null) return "";
+ return mPrefix.name() + mMaterial.mMaterial.name();
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/util/GregtechRecipe.java b/src/Java/miscutil/gregtech/api/util/GregtechRecipe.java
index fb55ec6720..b6eb424e32 100644
--- a/src/Java/miscutil/gregtech/api/util/GregtechRecipe.java
+++ b/src/Java/miscutil/gregtech/api/util/GregtechRecipe.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
+import miscutil.core.util.Utils;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@@ -171,11 +172,13 @@ public class GregtechRecipe {
public GregtechRecipe(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));
+ Utils.LOG_INFO("Switch case method for adding fuels");
if (mInputs.length > 0 && aSpecialValue > 0) {
switch (aType) {
// Diesel Generator
case 0:
- Gregtech_Recipe_Map.sRocketFuels.addRecipe(this);
+ Utils.LOG_INFO("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing");
+ Gregtech_Recipe_Map.sRocketFuels.addRecipe(this);
break;
// Gas Turbine
case 1:
@@ -384,16 +387,21 @@ public class GregtechRecipe {
}*/
public GregtechRecipe addRecipe(GregtechRecipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 1");
return addRecipe(aRecipe, true, false, false);
}
protected GregtechRecipe addRecipe(GregtechRecipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ Utils.LOG_INFO("Adding Recipe Method 2");
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)
+ if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems){
+ Utils.LOG_INFO("Step 2 failed");
+ return null;}
+ if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null){
+ Utils.LOG_INFO("Step 2 failed - 2");
return null;
+ }
return add(aRecipe);
}
@@ -419,9 +427,11 @@ public class GregtechRecipe {
}
public GregtechRecipe add(GregtechRecipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 3");
mRecipeList.add(aRecipe);
for (FluidStack aFluid : aRecipe.mFluidInputs)
if (aFluid != null) {
+ Utils.LOG_INFO("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap.");
Collection<GregtechRecipe> tList = mRecipeFluidMap.get(aFluid.getFluid());
if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GregtechRecipe>(1));
tList.add(aRecipe);
@@ -538,12 +548,22 @@ public class GregtechRecipe {
}
protected GregtechRecipe addToItemMap(GregtechRecipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 4");
for (ItemStack aStack : aRecipe.mInputs)
if (aStack != null) {
+ Utils.LOG_INFO("Method 4 - Manipulating "+aStack.getDisplayName());
GT_ItemStack tStack = new GT_ItemStack(aStack);
+ Utils.LOG_INFO("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName());
Collection<GregtechRecipe> tList = mRecipeItemMap.get(tStack);
- if (tList == null) mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe>(1));
+ if (tList != null){
+ Utils.LOG_INFO("Method 4 - Gt Recipe Hashmap: "+tList.toString());
+ }
+ if (tList == null){
+ Utils.LOG_INFO("Method 4 - brrr list was NUll");
+ mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe>(1));
+ }
tList.add(aRecipe);
+ Utils.LOG_INFO("Method 4 - Added recipe to map? I think.");
}
return aRecipe;
}
@@ -629,22 +649,27 @@ public class GregtechRecipe {
}
public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 1");
return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
}
public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 2");
return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
}
public GregtechRecipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 3");
return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
}
public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 4");
return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
}
public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 5");
return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
}
}
diff --git a/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java b/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java
index 77e21f7607..af75e71324 100644
--- a/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java
+++ b/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java
@@ -108,6 +108,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) {
if (aInput1 == null) {
+ Utils.LOG_INFO("Fuel Input is Invalid.");
return false;
}
new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
diff --git a/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechItems.java
index 77e3b7b015..f1cc7eaa76 100644
--- a/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechItems.java
+++ b/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -1,7 +1,6 @@
package miscutil.gregtech.common.items;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.Textures;
@@ -12,6 +11,8 @@ import gregtech.common.covers.GT_Cover_Arm;
import gregtech.common.covers.GT_Cover_Conveyor;
import gregtech.common.covers.GT_Cover_Pump;
import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import miscutil.gregtech.api.items.Gregtech_MetaItem_X32;
public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
@@ -107,14 +108,43 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
//GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite)});
- //GregtechItemList.Circuit_Primitive.set(addItem(tLastID = 700, "NAND Chip", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}));
- //GregtechItemList.Circuit_Basic.set(addItem(tLastID = 701, "Basic Electronic Circuit", "A basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic)}));
- //GregtechItemList.Circuit_Good.set(addItem(tLastID = 702, "Good Electronic Circuit", "A good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good)}));
- //GregtechItemList.Circuit_Advanced.set(addItem(tLastID = 703, "Advanced Circuit", "An advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced)}));
- GregtechItemList.Circuit_Data.set(addItem(tLastID = 704, "Circuit I", "A Data Chip", new Object[]{OrePrefixes.circuit.get(Materials.Data)}));
- GregtechItemList.Circuit_Elite.set(addItem(tLastID = 705, "Circuit II", "A Processor", new Object[]{OrePrefixes.circuit.get(Materials.Elite)}));
- GregtechItemList.Circuit_Master.set(addItem(tLastID = 706, "Circuit III", "A High Voltage Processor", new Object[]{OrePrefixes.circuit.get(Materials.Master)}));
-
+ /* GregtechItemList.Circuit_Primitive.set(addItem(tLastID = 700, "Circuit"+" "+tLastID, "A simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}));
+ GregtechItemList.Circuit_Basic.set(addItem(tLastID = 701, "Circuit"+" "+tLastID, "A basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic)}));
+ GregtechItemList.Circuit_Good.set(addItem(tLastID = 702, "Circuit"+" "+tLastID, "A good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good)}));
+ GregtechItemList.Circuit_Advanced.set(addItem(tLastID = 703, "Circuit"+" "+tLastID, "An advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced)}));
+ GregtechItemList.Circuit_Data.set(addItem(tLastID = 704, "Circuit"+" "+tLastID, "A Data Chip", new Object[]{OrePrefixes.circuit.get(Materials.Data)}));
+ GregtechItemList.Circuit_Elite.set(addItem(tLastID = 705, "Circuit"+" "+tLastID, "A Processor", new Object[]{OrePrefixes.circuit.get(Materials.Elite)}));
+ GregtechItemList.Circuit_Master.set(addItem(tLastID = 706, "Circuit"+" "+tLastID, "A High Voltage Processor", new Object[]{OrePrefixes.circuit.get(Materials.Master)}));
+ GregtechItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION, new Behaviour_DataOrb()}));
+ GregtechItemList.Circuit_Ultimate.set(ItemList.Tool_DataOrb.get(1L, new Object[0]));
+ GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataOrb.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataOrb.get(1L, new Object[0])});
+ GregtechItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, new Behaviour_DataStick()}));
+ GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataStick.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataStick.get(1L, new Object[0])});
+
+*
+*
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
+*
+*/
+ GregtechItemList.Circuit_IV.set(addItem(tLastID = 704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)}));
+ GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Neutronic)}));
+ GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Quantum)}));
+ GregtechItemList.Circuit_Board_IV.set(addItem(tLastID = 710, "IV Circuit Board", "An IV Voltage Rated Circuit Board", new Object[0]));
+ GregtechItemList.Circuit_Board_LuV.set(addItem(tLastID = 711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board", new Object[0]));
+ GregtechItemList.Circuit_Board_ZPM.set(addItem(tLastID = 712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_IV.set(addItem(tLastID = 713, "(IV) Energized Crystal Chip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set(addItem(tLastID = 714, "(LuV) Neutron based Microchip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.set(addItem(tLastID = 715, "(ZPM) Quantum Chip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_IV.set(addItem(tLastID = 716, "(IV) Energized Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_LuV.set(addItem(tLastID = 717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_ZPM.set(addItem(tLastID = 718, "(ZPM) Quantum Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_IV.set(addItem(tLastID = 719, "Etched IV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_LuV.set(addItem(tLastID = 720, "Etched LuV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_ZPM.set(addItem(tLastID = 721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards", new Object[0]));
diff --git a/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechTools.java
new file mode 100644
index 0000000000..d2800fa2c0
--- /dev/null
+++ b/src/Java/miscutil/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -0,0 +1,24 @@
+package miscutil.gregtech.common.items;
+
+import miscutil.gregtech.api.items.Gregtech_MetaTool;
+import miscutil.gregtech.common.tools.TOOL_Gregtech_MaxEfficiencyMultiBlockItem;
+
+public class MetaGeneratedGregtechTools extends Gregtech_MetaTool {
+
+ public static final short TURBINE_SMALL = 10;
+ public static final short TURBINE = 12;
+ public static final short TURBINE_LARGE = 14;
+ public static final short HUGE_ITEM = 16;
+ public static final short TURBINE_BLADE = 18;
+ public static MetaGeneratedGregtechTools INSTANCE;
+
+ public MetaGeneratedGregtechTools() {
+ super("MU-metaitem.02");
+ INSTANCE = this;
+ //addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small(), new Object[]{});
+ //addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal(), new Object[]{});
+ //addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large(), new Object[]{});
+ addTool(HUGE_ITEM, "Huge Item", "Item 4 for your power station", new TOOL_Gregtech_MaxEfficiencyMultiBlockItem(), new Object[]{});
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_Base.java
new file mode 100644
index 0000000000..79afb7025d
--- /dev/null
+++ b/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_Base.java
@@ -0,0 +1,168 @@
+package miscutil.gregtech.common.tools;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.damagesources.GT_DamageSources;
+
+import java.util.List;
+
+import miscutil.gregtech.api.interfaces.internal.Interface_ToolStats;
+import miscutil.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.stats.AchievementList;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EntityDamageSource;
+import net.minecraft.util.IChatComponent;
+import net.minecraftforge.event.world.BlockEvent;
+
+public abstract class TOOL_Gregtech_Base
+implements Interface_ToolStats {
+ public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune};
+ public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting};
+ public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0];
+ public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0];
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 800;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 200;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) {
+ return aOriginalHurtResistance;
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return null;
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return null;
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isRangedWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isMiningTool() {
+ return true;
+ }
+
+ @Override
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity) {
+ return GT_DamageSources.getCombatDamage((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, (aEntity instanceof EntityLivingBase) ? getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null);
+ }
+
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity);
+ }
+
+ @Override
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Enchantment[] getEnchantments(ItemStack aStack) {
+ return ZERO_ENCHANTMENTS;
+ }
+
+ @Override
+ public int[] getEnchantmentLevels(ItemStack aStack) {
+ return ZERO_ENCHANTMENT_LEVELS;
+ }
+
+ @Override
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) {
+ aPlayer.triggerAchievement(AchievementList.openInventory);
+ aPlayer.triggerAchievement(AchievementList.mineWood);
+ aPlayer.triggerAchievement(AchievementList.buildWorkBench);
+ }
+
+ @Override
+ public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) {
+ }
+
+ @Override
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
+
+ @Override
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
+}
diff --git a/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java b/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java
new file mode 100644
index 0000000000..b1225ffcc5
--- /dev/null
+++ b/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java
@@ -0,0 +1,49 @@
+package miscutil.gregtech.common.tools;
+
+import gregtech.api.interfaces.IIconContainer;
+import miscutil.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
+
+public abstract class TOOL_Gregtech_BaseMultiblockItem extends TOOL_Gregtech_Base {
+ @Override
+ public abstract float getBaseDamage();
+
+ @Override
+ public boolean isMinableBlock(Block aBlock, byte aMetaData) {
+ return false;
+ }
+
+ @Override
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? getTurbineIcon() : null;
+ }
+
+ @Override
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? Gregtech_MetaTool.getPrimaryMaterial(aStack).mRGBa : null;
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED +
+ aEntity.getCommandSenderName() + "s" + EnumChatFormatting.WHITE + " head into a turbine");
+ }
+
+ public abstract IIconContainer getTurbineIcon();
+
+ @Override
+ public abstract float getSpeedMultiplier();
+
+ @Override
+ public abstract float getMaxDurabilityMultiplier();
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+}
diff --git a/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java b/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java
new file mode 100644
index 0000000000..15cf1599b6
--- /dev/null
+++ b/src/Java/miscutil/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java
@@ -0,0 +1,27 @@
+package miscutil.gregtech.common.tools;
+
+import gregtech.api.interfaces.IIconContainer;
+import miscutil.gregtech.api.enums.GregtechTextures;
+
+public class TOOL_Gregtech_MaxEfficiencyMultiBlockItem extends TOOL_Gregtech_BaseMultiblockItem {
+ @Override
+ public float getSpeedMultiplier() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 3.0F;
+ }
+
+ @Override
+ public IIconContainer getTurbineIcon() {
+ return GregtechTextures.ItemIcons.TURBINE_HUGE;
+ }
+
+}