aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-10-29 05:09:01 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-10-29 05:09:01 +0000
commit6205a2088bbbc31a09d0a2a3d460add1a7622801 (patch)
tree497380cea05b2a394fe303e8fcc2d688bed6f6d1 /src/Java
parent7f2c38ccc6fb2734ac6655b9dd7003c4b6dee4a3 (diff)
downloadGT5-Unofficial-6205a2088bbbc31a09d0a2a3d460add1a7622801.tar.gz
GT5-Unofficial-6205a2088bbbc31a09d0a2a3d460add1a7622801.tar.bz2
GT5-Unofficial-6205a2088bbbc31a09d0a2a3d460add1a7622801.zip
+ Added recipe for heating Titanium Ingots, required for Krypton processing.
+ Added custom GT TextureSets. $ Lots of small fixes to Material, Material Generation & Recipe Generation. $ Lots of small fixes to Fluids, Fluid Generation and Fluid Cell Generation. $ Fixed Creative Tabs. $ Possibly fixed issue where tickable items would instantly tick to 0. $ Fixed display names of Throwable Potions. $ Fixed NPE in removeCrudeTurbineRotors(). % Adjusted lots of textures. % Adjusted handling of Thermal Foundation Fluids. % Moved Furnace/EBF and Maceration recipes out of BaseItemDust.java. % Made Tooltips of GT++ Material Blocks, Frames and ores more informational. % Made Bromine a Fluid Material, this will remove all Bromine solid material items from the world. (Ingots, Blocks, etc.) % Increased cost of GT++ Ores in processing. - Broke lots of recipes. > EBF/ABS & All Table Crafting. TBA~
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/TypeCounter.java178
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java39
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java2
-rw-r--r--src/Java/gtPlusPlus/core/client/CustomTextureSet.java27
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java10
-rw-r--r--src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java15
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java12
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java3
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java3
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java3
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java45
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java89
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java15
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java258
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java70
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java57
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemCreativeTab.java59
-rw-r--r--src/Java/gtPlusPlus/core/item/materials/DustDecayable.java13
-rw-r--r--src/Java/gtPlusPlus/core/material/ELEMENT.java77
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java341
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java60
-rw-r--r--src/Java/gtPlusPlus/core/material/NONMATERIAL.java22
-rw-r--r--src/Java/gtPlusPlus/core/material/ORES.java28
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java293
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java10
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java41
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java12
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java30
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java88
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java26
31 files changed, 1386 insertions, 543 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/data/TypeCounter.java b/src/Java/gtPlusPlus/api/objects/data/TypeCounter.java
new file mode 100644
index 0000000000..3d562bf76e
--- /dev/null
+++ b/src/Java/gtPlusPlus/api/objects/data/TypeCounter.java
@@ -0,0 +1,178 @@
+package gtPlusPlus.api.objects.data;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import gtPlusPlus.api.objects.Logger;
+
+
+public class TypeCounter<V> implements Set<V> {
+
+ private Map<String, InternalTypeCounterObject<V>> mInternalMap = new LinkedHashMap<String, InternalTypeCounterObject<V>>();
+ private String mHighestValueKey;
+ private int mHighestValue = 0;
+ private final Class mClass;
+
+ public TypeCounter(Class o) {
+ Logger.INFO("Created new TypeCounter for "+o.getName());
+ mClass = o;
+ }
+
+ public static class InternalTypeCounterObject<Z> {
+ private final Z mObject;
+ private int mCounter = 0;
+
+ public InternalTypeCounterObject(Z o) {
+ mObject = o;
+ }
+
+ public String hash() {
+ return String.valueOf(mObject.hashCode());
+ }
+
+ public Z get() {
+ return mObject;
+ }
+
+ public void add() {
+ mCounter++;
+ }
+
+ public int count() {
+ return mCounter;
+ }
+
+ }
+
+ public boolean add(V arg0) {
+ return add(arg0, null);
+ }
+
+ public boolean add(V arg0, String aKeyName) {
+ String aKey = aKeyName != null ? aKeyName : arg0.toString();
+ InternalTypeCounterObject<V> aValue = mInternalMap.get(aKey);
+ if (aValue == null) {
+ aValue = new InternalTypeCounterObject<V>((V) arg0);
+ Logger.INFO("Adding new key to map: "+aKey);
+ }
+ aValue.add();
+ int a = aValue.count();
+ if (a > mHighestValue) {
+ mHighestValue = a;
+ mHighestValueKey = aKey;
+ Logger.INFO("New Highest Count - "+aKey+":"+a);
+ }
+ mInternalMap.put(aKey, aValue);
+ Logger.INFO(aKey+":"+a);
+ return true;
+ }
+
+ @Override
+ public boolean addAll(Collection arg0) {
+ boolean aReturn = true;
+ for (Object o : arg0) {
+ if (mClass.isInstance(o)) {
+ V j = (V) o;
+ boolean b = add(j);
+ if (!b) {
+ aReturn = false;
+ }
+ }
+ }
+ return aReturn;
+ }
+
+ @Override
+ public void clear() {
+ mInternalMap.clear();
+ }
+
+ @Override
+ public boolean contains(Object arg0) {
+ return mInternalMap.containsKey(arg0.toString());
+ }
+
+ @Override
+ public boolean containsAll(Collection arg0) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return mInternalMap.isEmpty();
+ }
+
+ @Override
+ public Iterator iterator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean remove(Object arg0) {
+ InternalTypeCounterObject<V> aValue = mInternalMap.remove(arg0.toString());
+ if (aValue != null) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean removeAll(Collection arg0) {
+ boolean aReturn = true;
+ for (Object o : arg0) {
+ boolean a = remove(o);
+ if (!a) {
+ aReturn = false;
+ }
+ }
+ return aReturn;
+ }
+
+ @Override
+ public boolean retainAll(Collection arg0) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int size() {
+ return this.mInternalMap.size();
+ }
+
+ @Override
+ public Object[] toArray() {
+ Object[] aArray = new Object[this.mInternalMap.size()];
+ int aPos = 0;
+ for (String k : this.mInternalMap.keySet()) {
+ if (k != null) {
+ InternalTypeCounterObject<V> aVal = this.mInternalMap.get(k);
+ aArray[aPos++] = new Pair<String, InternalTypeCounterObject<V>>(k, aVal);
+ }
+ }
+ return aArray;
+ }
+
+ @Override
+ public V[] toArray(Object[] a) {
+ Object[] aArray = new Object[a.length];
+ int aPos = 0;
+ for (Object k : a) {
+ if (k != null) {
+ aArray[aPos++] = k;
+ }
+ }
+ return (V[]) aArray;
+ }
+
+ public V getResults() {
+ InternalTypeCounterObject<V> x = mInternalMap.get(mHighestValueKey);
+ return x.get();
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index 101e568188..634dc4c022 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -6,7 +6,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.IBlockAccess;
-
+import gregtech.api.enums.TextureSet;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock;
@@ -26,17 +26,17 @@ public class BlockBaseModular extends BasicBlock {
protected String thisBlockMaterial;
protected final String thisBlockType;
+ public BlockBaseModular(final Material material, final BlockTypes blockType) {
+ this(material, blockType, material.getRgbAsHex());
+ }
+
public BlockBaseModular(final Material material, final BlockTypes blockType, final int colour) {
this(material.getUnlocalizedName(), material.getLocalizedName(), net.minecraft.block.material.Material.iron,
- blockType, colour, 2);
- }
-
- public BlockBaseModular(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType,
- final int colour) {
- this(unlocalizedName, blockMaterial, net.minecraft.block.material.Material.iron, blockType, colour, 2);
+ blockType, colour, Math.min(Math.max(material.vTier, 1), 5));
+ blockMaterial = material;
}
- public BlockBaseModular(final String unlocalizedName, final String blockMaterial,
+ protected BlockBaseModular(final String unlocalizedName, final String blockMaterial,
final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour,
final int miningLevel) {
super(unlocalizedName, vanillaMaterial);
@@ -57,7 +57,7 @@ public class BlockBaseModular extends BasicBlock {
ItemUtils.getSimpleStack(this));
}
else if (this.thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())) {
- GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class,
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
GT_OreDictUnificator.registerOre(
"frameGt" + getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "")
@@ -111,12 +111,27 @@ public class BlockBaseModular extends BasicBlock {
return false;
}
+ public Material getMaterialEx(){
+ return this.blockMaterial;
+ }
+
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister iIcon) {
- if (this.thisBlock != BlockTypes.ORE) {
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
- }
+ if (!CORE.ConfigSwitches.useGregtechTextures || this.blockMaterial == null || this.thisBlock == BlockTypes.ORE){
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
+ }
+ String metType = "9j4852jyo3rjmh3owlhw9oe";
+ if (this.blockMaterial != null) {
+ TextureSet u = this.blockMaterial.getTextureSet();
+ if (u != null) {
+ metType = u.mSetName;
+ }
+ }
+ metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
+ int tier = this.blockMaterial.vTier;
+ String aType = (this.thisBlock == BlockTypes.FRAME) ? "frameGt" : (tier < 3 ? "block1" : tier < 6 ? "block6" : "block5");
+ this.blockIcon = iIcon.registerIcon("gregtech" + ":" + "materialicons/"+ "METALLIC" +"/" + aType);
}
@Override
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java
index ab1fd5e08a..526f2b245c 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java
@@ -35,7 +35,7 @@ public class BlockBaseOre extends BasicBlock implements ITexturedBlock {
this.setHardness(2.0f);
this.setResistance(6.0F);
this.setLightLevel(0.0F);
- this.setHarvestLevel("pickaxe", 3);
+ this.setHarvestLevel("pickaxe", Math.min(Math.max(material.vTier, 1), 5));
this.setStepSound(soundTypeStone);
this.setBlockName("Ore"+Utils.sanitizeString(Utils.sanitizeString(material.getUnlocalizedName())));
this.setBlockTextureName("stone");
diff --git a/src/Java/gtPlusPlus/core/client/CustomTextureSet.java b/src/Java/gtPlusPlus/core/client/CustomTextureSet.java
new file mode 100644
index 0000000000..d7bbecd6c7
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/client/CustomTextureSet.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.core.client;
+
+import gregtech.api.enums.TextureSet;
+
+public class CustomTextureSet extends TextureSet {
+
+ public static enum TextureSets {
+
+ REFINED(),
+ GEM_A(),
+ ENRICHED();
+
+ private final CustomTextureSet A;
+
+ private TextureSets (){
+ A = new CustomTextureSet(this.name().toUpperCase());
+ }
+ public CustomTextureSet get() {
+ return A;
+ }
+ }
+
+ public CustomTextureSet(String aSetName) {
+ super(aSetName);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index c9ea0f3e5b..9e75cd4a16 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -45,12 +45,13 @@ public class CommonProxy {
//Should Register Gregtech Materials I've Made
Utils.registerEvent(this);
if (LoadedMods.Gregtech){
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
- Logger.INFO("We're using Gregtech 5.09 Experimental.");
+ if (!CORE.GTNH) {
+ Logger.INFO("We're using Gregtech "+Utils.getGregtechVersionAsString());
}
else {
- Logger.INFO("We're using Gregtech 5.08 or an earlier fork.");
+ Logger.INFO("We're using GTNH's Gregtech "+Utils.getGregtechVersionAsString());
}
+
Logger.INFO("Setting up our own GT_Proxy.");
GtProxy = new Meta_GT_Proxy();
}
@@ -74,6 +75,8 @@ public class CommonProxy {
else {
Logger.WARNING("Development mode not set.");
}
+
+ AddToCreativeTab.initialiseTabs();
//Moved from Init after Debug Loading.
//29/01/18 - Alkalus
@@ -83,7 +86,6 @@ public class CommonProxy {
ModBlocks.init();
CI.preInit();
- AddToCreativeTab.initialiseTabs();
COMPAT_IntermodStaging.preInit();
diff --git a/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java b/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
index 8e6d38f301..218bef46bd 100644
--- a/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
+++ b/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
@@ -1,7 +1,7 @@
package gtPlusPlus.core.creative;
import net.minecraft.creativetab.CreativeTabs;
-
+import gregtech.api.util.GT_CreativeTab;
import gtPlusPlus.core.creative.tabs.*;
import gtPlusPlus.xmod.bop.creative.MiscUtilsBOPTab;
@@ -16,11 +16,20 @@ public class AddToCreativeTab {
public static CreativeTabs tabBOP;
public static void initialiseTabs() {
- tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
+ //GT_CreativeTab
+ /*tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab");
tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab");
tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab");
tabOther = new MiscUtilCreativeTabOther("MiscUtilOtherTab");
- tabBOP = new MiscUtilsBOPTab("MiscUtilBOP");
+ tabBOP = new MiscUtilsBOPTab("MiscUtilBOP");*/
+
+ tabBlock = new GT_CreativeTab("GTPP_BLOCKS", "GT++ Blocks");
+ tabMisc = new GT_CreativeTab("GTPP_MISC", "GT++ Misc");
+ tabTools = new GT_CreativeTab("GTPP_TOOLS", "GT++ Tools");
+ tabMachines = new GT_CreativeTab("GTPP_MACHINES", "GT++ Machines");
+ tabOther = new GT_CreativeTab("GTPP_OTHER", "GT++ Other");
+ tabBOP = new GT_CreativeTab("GTPP_OTHER_2", "GT++ Other II");
+
}
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
index 3af79c7305..2851a514d0 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
@@ -1,8 +1,10 @@
package gtPlusPlus.core.creative.tabs;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
-
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.block.ModBlocks;
public class MiscUtilCreativeTabBlock extends CreativeTabs {
@@ -13,7 +15,13 @@ public class MiscUtilCreativeTabBlock extends CreativeTabs {
@Override
public Item getTabIconItem() {
- return Item.getItemFromBlock(ModBlocks.blockCompressedObsidian);
+ return Item.getItemFromBlock(Blocks.bedrock);
}
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public int func_151243_f(){
+ return 0;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
index 9f145cf581..96c809c4da 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.creative.tabs;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import gtPlusPlus.core.item.ModItems;
@@ -14,7 +15,7 @@ public class MiscUtilCreativeTabMachines extends CreativeTabs {
@Override
public Item getTabIconItem() {
- return ModItems.itemAlkalusDisk;
+ return Items.netherbrick;
}
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
index 17c56f68af..a67668bbf0 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.creative.tabs;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import gtPlusPlus.core.item.ModItems;
@@ -13,7 +14,7 @@ public class MiscUtilCreativeTabMisc extends CreativeTabs {
@Override
public Item getTabIconItem() {
- return ModItems.AAA_Broken;
+ return Items.painting;
}
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
index 156086081e..afd89346c0 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.creative.tabs;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import gtPlusPlus.core.item.ModItems;
@@ -13,7 +14,7 @@ public class MiscUtilCreativeTabOther extends CreativeTabs {
@Override
public Item getTabIconItem() {
- return ModItems.backpack_Green;
+ return Items.repeater;
}
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
index b68eccd0e4..ab1ab069de 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.creative.tabs;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import gtPlusPlus.core.item.ModItems;
@@ -13,7 +14,7 @@ public class MiscUtilCreativeTabTools extends CreativeTabs {
@Override
public Item getTabIconItem() {
- return ModItems.itemStaballoyPickaxe;
+ return Items.diamond_pickaxe;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 5b8e8ab2a1..0e21e9b154 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -22,10 +22,12 @@ import gtPlusPlus.core.common.compat.COMPAT_Baubles;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.handler.OldCircuitHandler;
import gtPlusPlus.core.item.base.*;
+import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
import gtPlusPlus.core.item.base.foil.BaseItemFoil;
import gtPlusPlus.core.item.base.foods.BaseItemFood;
import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
import gtPlusPlus.core.item.base.gears.BaseItemSmallGear;
+import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
import gtPlusPlus.core.item.base.ingots.BaseItemIngot_OLD;
import gtPlusPlus.core.item.base.misc.BaseItemMisc;
import gtPlusPlus.core.item.base.misc.BaseItemMisc.MiscTypes;
@@ -56,6 +58,7 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.*;
import gtPlusPlus.core.material.nuclear.FLUORIDES;
import gtPlusPlus.core.material.nuclear.NUCLIDE;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
@@ -275,6 +278,8 @@ public final class ModItems {
public static Item itemControlCore;
+ public static ItemStack itemHotTitaniumIngot;
+
static {
Logger.INFO("Items!");
//Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is called upon.
@@ -347,7 +352,7 @@ public final class ModItems {
itemGemShards = new ItemGemShards("itemGemShards", "Gem Shards", AddToCreativeTab.tabMisc, 32, 0, "They glitter in the light", EnumRarity.rare, EnumChatFormatting.GRAY, false, Utils.rgbtoHexValue(182, 114, 18)).setTextureName(CORE.MODID + ":itemHeliumBlob");
itemHalfCompleteCasings = new ItemHalfCompleteCasings("itemHalfCompleteCasings", AddToCreativeTab.tabMisc, 32, 0, "This isn't quite finished yet.", EnumRarity.common, EnumChatFormatting.GRAY, false, Utils.rgbtoHexValue(255, 255, 255)).setTextureName("gregtech" + ":" + "gt.metaitem.01/" + "761");
itemSulfuricPotion = new ItemSulfuricAcidPotion("itemSulfuricPotion", "Throwable Vial of Sulfuric Acid", "Burn your foes alive!").setTextureName(CORE.MODID + ":itemSulfuricAcidPotion");
- itemHydrofluoricPotion = new ItemHydrofluoricAcidPotion("itemHydrofluoricPotion", "Thowable Vial of Hydrofluoric Acid", "They won't see this coming, nor anything after!").setTextureName(CORE.MODID + ":itemPotion");
+ itemHydrofluoricPotion = new ItemHydrofluoricAcidPotion("itemHydrofluoricPotion", "Throwable Vial of Hydrofluoric Acid", "They won't see this coming, nor anything after!").setTextureName(CORE.MODID + ":itemPotion");
//Start meta Item Generation
ItemsFoods.load();
@@ -599,7 +604,8 @@ public final class ModItems {
//FLiBe Fuel Compounds
dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe
- fluidFLiBeSalt = FluidUtils.generateFluid("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100});
+ //fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0);
+ fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Li2BeF4", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
//LFTR Control Circuit
itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null);
@@ -637,10 +643,10 @@ public final class ModItems {
temp2 = ItemUtils.getCorrectStacktype("Forestry:fertilizerCompound", 1);
}
if (temp1 != null){
- FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, temp2);
+ FluidUtils.generateFluidNonMolten("Fertiliser", "Fertiliser", 32, new short[]{45, 170, 45, 100}, temp1, temp2, true);
}
- FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null);
- FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null);
+ FluidUtils.generateFluidNonMolten("UN32Fertiliser", "UN-32 Fertiliser", 24, new short[]{55, 190, 55, 100}, null, null, true);
+ FluidUtils.generateFluidNonMolten("UN18Fertiliser", "UN-18 Fertiliser", 22, new short[]{60, 155, 60, 100}, null, null, true);
/*GT_Values.RA.addMixerRecipe(
arg0, //Item In
@@ -657,7 +663,7 @@ public final class ModItems {
}
//Juice
- FluidUtils.generateFluidNonMolten("RaisinJuice", "Raisin Juice", 2, new short[]{51, 0, 51, 100}, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("fruitRaisins", 1), 50);
+ FluidUtils.generateFluidNonMolten("RaisinJuice", "Raisin Juice", 2, new short[]{51, 0, 51, 100}, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("fruitRaisins", 1), 50, true);
//Test items
@@ -688,10 +694,10 @@ public final class ModItems {
//Just an unusual plate needed for some black magic.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateClay", 1) == null){
- itemPlateClay = new BaseItemPlate(MaterialUtils.generateMaterialFromGtENUM(Materials.Clay));
+ itemPlateClay = new BaseItemPlate(NONMATERIAL.CLAY);
}
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleClay", 1) == null){
- itemDoublePlateClay = new BaseItemPlateDouble(MaterialUtils.generateMaterialFromGtENUM(Materials.Clay));
+ itemDoublePlateClay = new BaseItemPlateDouble(NONMATERIAL.CLAY);
}
//Need this for Mutagenic Frames
@@ -701,18 +707,25 @@ public final class ModItems {
//A small gear needed for wizardry.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGtSmallWroughtIron", 1) == null){
- itemSmallWroughtIronGear = new BaseItemSmallGear(MaterialUtils.generateMaterialFromGtENUM(Materials.WroughtIron));
+ itemSmallWroughtIronGear = new BaseItemSmallGear(NONMATERIAL.WROUGHT_IRON);
+ }
+ //Krypton Processing
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1) == null){
+ itemHotTitaniumIngot = ItemUtils.getSimpleStack(new BaseItemIngot(ELEMENT.getInstance().TITANIUM, ComponentTypes.HOTINGOT));
+ }
+ else {
+ itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1);
}
+ GT_Values.RA.addBlastRecipe(ELEMENT.getInstance().TITANIUM.getIngot(1), null, itemHotTitaniumIngot, null, 10 * 20, 512, Materials.Titanium.mBlastFurnaceTemp);
//Special Sillyness
if (true) {
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null){
- new BaseItemPlate(MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium));
+ new BaseItemPlate(ELEMENT.getInstance().SODIUM);
}
- Material meatRaw = MaterialUtils.generateMaterialFromGtENUM(Materials.MeatRaw);
- meatRaw.setTextureSet(TextureSet.SET_ROUGH);
+ Material meatRaw = NONMATERIAL.MEAT;
// A plate of Meat.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null){
itemPlateRawMeat = new BaseItemPlate(meatRaw);
@@ -721,7 +734,7 @@ public final class ModItems {
}
// A Block of Meat.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null){
- blockRawMeat = new BlockBaseModular(meatRaw.getUnlocalizedName(), meatRaw.getLocalizedName(), BlockTypes.STANDARD, meatRaw.getRgbAsHex());
+ blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD);
ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900);
}
}
@@ -734,15 +747,15 @@ public final class ModItems {
//A plate of Lithium.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) == null){
- itemPlateLithium = new BaseItemPlate(MaterialUtils.generateMaterialFromGtENUM(Materials.Lithium));
+ itemPlateLithium = new BaseItemPlate(ELEMENT.getInstance().LITHIUM);
}
//A plate of Europium.
if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){
- itemPlateEuropium = new BaseItemPlate(MaterialUtils.generateMaterialFromGtENUM(Materials.Europium));
+ itemPlateEuropium = new BaseItemPlate(ELEMENT.getInstance().EUROPIUM);
}
if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){
- itemDoublePlateEuropium = new BaseItemPlateDouble(MaterialUtils.generateMaterialFromGtENUM(Materials.Europium));
+ itemDoublePlateEuropium = new BaseItemPlateDouble(ELEMENT.getInstance().EUROPIUM);
}
dustNeptunium238 = new DustDecayable("dustNeptunium238", Utils.rgbtoHexValue(175, 240, 75), 50640, new String[] {""+StringUtils.superscript("238Np"), "Result: Plutonium 238 ("+StringUtils.superscript("238Pu")+")"}, ELEMENT.getInstance().PLUTONIUM238.getDust(1).getItem(), 5);
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 558a0605fe..ea0a2bb5eb 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -1,6 +1,8 @@
package gtPlusPlus.core.item.base;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -14,10 +16,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TextureSet;
import gregtech.api.util.GT_OreDictUnificator;
-
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
@@ -33,6 +35,12 @@ import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils;
public class BaseItemComponent extends Item{
+ private final static Class<TextureSet> mTextureSetPreload;
+
+ static {
+ mTextureSetPreload = TextureSet.class;
+ }
+
public final Material componentMaterial;
public final String materialName;
public final String unlocalName;
@@ -54,7 +62,9 @@ public class BaseItemComponent extends Item{
//this.setTextureName(this.getCorrectTextures());
this.componentColour = material.getRgbAsHex();
GameRegistry.registerItem(this, this.unlocalName);
- if (componentType != ComponentTypes.DUST)
+
+ //if (componentType != ComponentTypes.DUST)
+
GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
if (LoadedMods.Thaumcraft) {
ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.METALLUM, 1);
@@ -62,6 +72,7 @@ public class BaseItemComponent extends Item{
ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.RADIO, 2);
}
}
+ registerComponent();
}
//For Cell Generation
@@ -78,6 +89,30 @@ public class BaseItemComponent extends Item{
this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME);
GameRegistry.registerItem(this, unlocalName);
GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+unlocalName, ItemUtils.getSimpleStack(this));
+ registerComponent();
+ }
+
+ public boolean registerComponent() {
+ if (this.componentMaterial == null) {
+ return false;
+ }
+ //Register Component
+ Map<String, BaseItemComponent> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName());
+ if (aMap == null) {
+ aMap = new HashMap<String, BaseItemComponent>();
+ }
+ String aKey = componentType.getGtOrePrefix().name();
+ BaseItemComponent x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, this);
+ Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap);
+ return true;
+ }
+ else {
+ //Bad
+ Logger.MATERIALS("Tried to double register a material component. ");
+ return false;
+ }
}
public String getCorrectTextures(){
@@ -224,34 +259,36 @@ public class BaseItemComponent extends Item{
public static enum ComponentTypes {
- DUST("Dust", " Dust", "dust"),
- DUSTSMALL("DustSmall", " Dust", "dustSmall"),
- DUSTTINY("DustTiny", " Dust", "dustTiny"),
- INGOT("Ingot", " Ingot", "ingot"),
- HOTINGOT("HotIngot", " Hot Ingot", "ingotHot"),
- PLATE("Plate", " Plate", "plate"),
- PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble"),
- ROD("Rod", " Rod", "stick"),
- RODLONG("RodLong", " Long Rod", "stickLong"),
- GEAR("Gear", " Gear", "gearGt"),
- SMALLGEAR("SmallGear", " Gear", "gearGtSmall"), //TODO
- SCREW("Screw", " Screw", "screw"),
- BOLT("Bolt", " Bolt", "bolt"),
- ROTOR("Rotor", " Rotor", "rotor"),
- RING("Ring", " Ring", "ring"),
- FOIL("Foil", " Foil", "foil"),
- PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma"),
- CELL("Cell", " Cell", "cell"),
- NUGGET("Nugget", " Nugget", "nugget"),
- PLATEHEAVY("HeavyPlate", " Heavy Plate", "plateHeavy");
+ DUST("Dust", " Dust", "dust", OrePrefixes.dust),
+ DUSTSMALL("DustSmall", " Dust", "dustSmall", OrePrefixes.dustSmall),
+ DUSTTINY("DustTiny", " Dust", "dustTiny", OrePrefixes.dustTiny),
+ INGOT("Ingot", " Ingot", "ingot", OrePrefixes.ingot),
+ HOTINGOT("HotIngot", " Hot Ingot", "ingotHot", OrePrefixes.ingotHot),
+ PLATE("Plate", " Plate", "plate", OrePrefixes.plate),
+ PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble", OrePrefixes.plateDouble),
+ ROD("Rod", " Rod", "stick", OrePrefixes.stick),
+ RODLONG("RodLong", " Long Rod", "stickLong", OrePrefixes.stickLong),
+ GEAR("Gear", " Gear", "gearGt", OrePrefixes.gearGt),
+ SMALLGEAR("SmallGear", " Gear", "gearGtSmall", OrePrefixes.gearGtSmall), //TODO
+ SCREW("Screw", " Screw", "screw", OrePrefixes.screw),
+ BOLT("Bolt", " Bolt", "bolt", OrePrefixes.bolt),
+ ROTOR("Rotor", " Rotor", "rotor", OrePrefixes.rotor),
+ RING("Ring", " Ring", "ring", OrePrefixes.ring),
+ FOIL("Foil", " Foil", "foil", OrePrefixes.foil),
+ PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma", OrePrefixes.cellPlasma),
+ CELL("Cell", " Cell", "cell", OrePrefixes.cell),
+ NUGGET("Nugget", " Nugget", "nugget", OrePrefixes.nugget),
+ PLATEHEAVY("HeavyPlate", " Heavy Plate", "plateHeavy", OrePrefixes.plateDense);
private String COMPONENT_NAME;
private String DISPLAY_NAME;
private String OREDICT_NAME;
- private ComponentTypes (final String LocalName, final String DisplayName, final String OreDictName){
+ private OrePrefixes a_GT_EQUAL;
+ private ComponentTypes (final String LocalName, final String DisplayName, final String OreDictName, final OrePrefixes aPrefix){
this.COMPONENT_NAME = LocalName;
this.DISPLAY_NAME = DisplayName;
this.OREDICT_NAME = OreDictName;
+ this.a_GT_EQUAL = aPrefix;
}
public String getComponent(){
@@ -266,6 +303,10 @@ public class BaseItemComponent extends Item{
return this.OREDICT_NAME;
}
+ public OrePrefixes getGtOrePrefix() {
+ return this.a_GT_EQUAL;
+ }
+
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java b/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java
index d5b44db9f5..78c2724ea8 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java
@@ -52,7 +52,13 @@ public class BaseItemTickable extends CoreItem {
if (world == null || iStack == null) {
return;
}
- tickItemTag(world, iStack);
+
+
+ boolean active = getIsActive(world, iStack);
+ if (active) {
+ tickItemTag(world, iStack);
+ }
+
}
/*private final boolean setGregtechItemList() {
@@ -160,7 +166,7 @@ public class BaseItemTickable extends CoreItem {
}
}
else {
- createNBT(world, aStack);
+ return createNBT(world, aStack);
}
return true;
}
@@ -266,10 +272,7 @@ public class BaseItemTickable extends CoreItem {
}
}
}
- else {
- createNBT(world, aStack);
- }
- return false;
+ return createNBT(world, aStack);
}
@Override
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index 909d87fe57..afc4b17354 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -1,44 +1,46 @@
package gtPlusPlus.core.item.base.dusts;
-import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
+import gtPlusPlus.core.item.base.BaseItemComponent;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
-import java.util.List;
+public class BaseItemDust extends BaseItemComponent {
-import cpw.mods.fml.common.registry.GameRegistry;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
+ private Material dustInfo;
+ private BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
+ public BaseItemDust(Material aMat) {
+ this(aMat, true);
+ }
-public class BaseItemDust extends Item{
+ public BaseItemDust(Material aMat, boolean generateSmallDusts) {
+ super(aMat, ComponentTypes.DUST);
+ if (generateSmallDusts) {
+ mSizedDusts[0] = new BaseItemComponent(aMat, ComponentTypes.DUSTSMALL);
+ mSizedDusts[1] = new BaseItemComponent(aMat, ComponentTypes.DUSTTINY);
+ }
+ }
- protected int colour;
- protected String materialName;
- protected String pileType;
- String name = "";
- private int mTier;
- private Material dustInfo;
+ public BaseItemDust(DustState aState, Material aMat) {
+ super(aMat, ComponentTypes.DUST);
+ if (aState.generatesSmallDust()) {
+ mSizedDusts[0] = new BaseItemComponent(aMat, ComponentTypes.DUSTSMALL);
+ }
+ if (aState.generatesTinyDust()) {
+ mSizedDusts[1] = new BaseItemComponent(aMat, ComponentTypes.DUSTTINY);
+ }
+ }
- public BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo, final int colour, final String pileSize, final int tier){
+ private BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo, final int colour, final String pileSize, final int tier){
this(unlocalizedName, materialName, matInfo, colour, pileSize, tier, true);
}
- public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, boolean addRecipes) {
- try {
+ private BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, boolean addRecipes) {
+ super(matInfo, ComponentTypes.DUST);
+
+ try {/*
this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(64);
@@ -78,14 +80,15 @@ public class BaseItemDust extends Item{
this.addFurnaceRecipe();
this.addMacerationRecipe();
}
- }
+ */}
catch (Throwable t) {
t.printStackTrace();
}
}
private String getCorrectTexture(final String pileSize){
- if (!CORE.ConfigSwitches.useGregtechTextures){
+
+ if (!CORE.ConfigSwitches.useGregtechTextures || this.dustInfo.getTextureSet() == null){
if ((pileSize == "dust") || (pileSize == "Dust")){
this.setTextureName(CORE.MODID + ":" + "dust");}
else{
@@ -103,7 +106,7 @@ public class BaseItemDust extends Item{
return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dust";
}
- @Override
+ /* @Override
public String getItemStackDisplayName(final ItemStack iStack) {
String unlocal = super.getItemStackDisplayName(iStack);
@@ -114,11 +117,10 @@ public class BaseItemDust extends Item{
return unlocal;
}
- }
+ }*/
- @Override
+ /* @Override
public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
-
try {
if (this.dustInfo != null){
if (entityHolding instanceof EntityPlayer){
@@ -131,10 +133,9 @@ public class BaseItemDust extends Item{
catch (Throwable t) {
t.printStackTrace();
}
+ }*/
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
+ /*@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
@@ -151,101 +152,116 @@ public class BaseItemDust extends Item{
//}
super.addInformation(stack, aPlayer, list, bool);
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0){
- return MathUtils.generateSingularRandomHexValue();
+ }*/
+
+ public static class DustState {
+ static final int NORMAL = (1);
+ static final int SMALL = (10);
+ static final int TINY = (100);
+ final int MIXTURE;
+ final boolean[] doesThings = new boolean[3];
+
+ public DustState (boolean genDust, boolean genSmallDust, boolean genDustTiny){
+ int aTotal = 0;
+ if (genDust) {
+ aTotal += NORMAL;
+ doesThings[0] = true;
+ }
+ else {
+ doesThings[0] = false;
+ }
+ if (genSmallDust) {
+ aTotal += SMALL;
+ doesThings[1] = true;
+ }
+ else {
+ doesThings[1] = false;
+ }
+ if (genDustTiny) {
+ aTotal += TINY;
+ doesThings[2] = true;
+ }
+ else {
+ doesThings[2] = false;
+ }
+ MIXTURE = aTotal;
}
- return this.colour;
-
- }
- private void addMacerationRecipe(){
-
- try {
- Logger.MATERIALS("Adding Maceration recipe for "+this.materialName+" Ingot -> Dusts");
- final int chance = (this.mTier*10)/MathUtils.randInt(10, 20);
- GT_ModHandler.addPulverisationRecipe(dustInfo.getIngot(1), dustInfo.getDust(1), null, chance);
+ public boolean generatesDust() {
+ return doesThings[0];
}
- catch (Throwable t) {
- t.printStackTrace();
+ public boolean generatesSmallDust() {
+ return doesThings[1];
+ }
+ public boolean generatesTinyDust() {
+ return doesThings[2];
}
- }
-
- private void addFurnaceRecipe(){
-
- ItemStack aDust = dustInfo.getDust(1);
- ItemStack aOutput;
- try {
- if (this.dustInfo.requiresBlastFurnace()) {
- aOutput = dustInfo.getHotIngot(1);
- if (aOutput != null) {
- if (addBlastFurnaceRecipe(aDust, null, aOutput, null, dustInfo.getMeltingPointK())){
- Logger.MATERIALS("Successfully added a blast furnace recipe for "+this.materialName);
- }
- else {
- Logger.MATERIALS("Failed to add a blast furnace recipe for "+this.materialName);
- }
- }
- else {
- Logger.MATERIALS("Failed to add a blast furnace recipe for "+this.materialName);
- }
+ private DustState(int amount) {
+
+ if (amount == 1) {
+ doesThings[0] = true;
+ doesThings[1] = false;
+ doesThings[2] = false;
+
+ }
+ else if (amount == 10) {
+ doesThings[0] = false;
+ doesThings[1] = true;
+ doesThings[2] = false;
+
+ }
+ else if (amount == 100) {
+ doesThings[0] = false;
+ doesThings[1] = false;
+ doesThings[2] = true;
+
+ }
+ else if (amount == 11) {
+ doesThings[0] = true;
+ doesThings[1] = true;
+ doesThings[2] = false;
+
+ }
+ else if (amount == 101) {
+ doesThings[0] = true;
+ doesThings[1] = false;
+ doesThings[2] = true;
+
+ }
+ else if (amount == 110) {
+ doesThings[0] = false;
+ doesThings[1] = true;
+ doesThings[2] = true;
+
+ }
+ else if (amount == 111) {
+ doesThings[0] = true;
+ doesThings[1] = true;
+ doesThings[2] = true;
}
else {
- aOutput = dustInfo.getIngot(1);
- if (aOutput != null) {
- if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)){
- Logger.MATERIALS("Successfully added a furnace recipe for "+this.materialName);
- }
- else {
- Logger.MATERIALS("Failed to add a furnace recipe for "+this.materialName);
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
+ doesThings[0] = false;
+ doesThings[1] = false;
+ doesThings[2] = false;
+ }
+ MIXTURE = amount;
}
- }
-
- private boolean addBlastFurnaceRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){
-
- try {
- int timeTaken = 125*this.mTier*10;
-
- if (this.mTier <= 4){
- timeTaken = 25*this.mTier*10;
+ public DustState get(int a) {
+ if (a == 1) {
+ return new DustState(NORMAL);
}
- int aSlot = mTier - 2;
- if (aSlot < 2) {
- aSlot = 2;
+ else if (a == 10) {
+ return new DustState(SMALL);
+ }
+ else if (a == 100) {
+ return new DustState(TINY);
+ }
+ else {
+ return new DustState(MIXTURE);
}
- long aVoltage = GT_Values.V[aSlot >= 2 ? aSlot : 2];
-
- return GT_Values.RA.addBlastRecipe(
- input1,
- input2,
- GT_Values.NF, GT_Values.NF,
- output1,
- output2,
- timeTaken,
- (int) aVoltage,
- tempRequired);
- }
- catch (Throwable t) {
- t.printStackTrace();
- return false;
}
-
-
-
}
+
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
index f9594822ab..56d2aabdba 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -7,20 +7,27 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.block.base.BlockBaseOre;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
public class ItemBlockGtBlock extends ItemBlock{
protected final int blockColour;
protected final int sRadiation;
+ private final Material mMaterial;
+
private final Block thisBlock;
private boolean isOre = false;
+ private boolean isModular = false;
public ItemBlockGtBlock(final Block block) {
super(block);
@@ -28,14 +35,42 @@ public class ItemBlockGtBlock extends ItemBlock{
if (block instanceof BlockBaseOre){
this.isOre = true;
}
+ else if (block instanceof BlockBaseModular) {
+ this.isModular = true;
+ }
+ else {
+
+ }
+ if (!isModular && !isOre) {
+ mMaterial = null;
+ }
+ else {
+ if (isOre) {
+ mMaterial = ((BlockBaseOre) block).getMaterialEx();
+ }
+ else {
+ mMaterial = ((BlockBaseModular) block).getMaterialEx();
+ }
+ }
+
final BlockBaseModular baseBlock = (BlockBaseModular) block;
- this.blockColour = baseBlock.getRenderColor(0);
- if (block.getLocalizedName().toLowerCase().contains("uranium") || block.getLocalizedName().toLowerCase().contains("plutonium") || block.getLocalizedName().toLowerCase().contains("thorium")){
- this.sRadiation = 2;
+ if (isModular) {
+ this.blockColour = baseBlock.getRenderColor(0);
+ }
+ else if (isOre) {
+ this.blockColour = block.getBlockColor();
+ }
+ else {
+ this.blockColour = block.getBlockColor();
+ }
+ if (this.mMaterial != null) {
+ this.sRadiation = mMaterial.vRadiationLevel;
}
else {
this.sRadiation = 0;
}
+
+
//GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), ItemUtils.getSimpleStack(this));
}
@@ -45,17 +80,38 @@ public class ItemBlockGtBlock extends ItemBlock{
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+
+ if (this.mMaterial != null){
+ list.add(this.mMaterial.vChemicalFormula);
+ }
+
if (this.sRadiation > 0){
list.add(CORE.GT_Tooltip_Radioactive);
}
- if (this.isOre){
- if (this.thisBlock != null){
- if (this.thisBlock.getLocalizedName().equalsIgnoreCase("fluorite ore")){
- list.add("Mined from Sandstone and Limestone.");
+
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ list.add("Mining Level: "+Math.min(Math.max(aMiningLevel1, 0), 5));
+
+ if (this.mMaterial != null) {
+ list.add("Ore contains: ");
+ if (mMaterial.getComposites().isEmpty()) {
+ list.add("- "+mMaterial.getLocalizedName());
+ }
+ else {
+ for (MaterialStack m : mMaterial.getComposites()) {
+ list.add("- "+m.getStackMaterial().getLocalizedName()+" x"+m.getPartsPerOneHundred());
+ }
+ }
}
}
}
else {
+ list.add(EnumChatFormatting.DARK_GRAY+"Hold Ctrl to show additional info.");
}
super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java
index 91dcf97f5b..03f3e50338 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java
@@ -7,14 +7,17 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import gtPlusPlus.core.block.base.BlockBaseOre;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.nuclear.FLUORIDES;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
public class ItemBlockOre extends ItemBlock{
@@ -60,23 +63,55 @@ public class ItemBlockOre extends ItemBlock{
if (this.mThisMaterial == FLUORIDES.FLUORITE){
list.add("Mined from Sandstone with a 1/"+(CORE.ConfigSwitches.chanceToDropFluoriteOre*20)+" chance, or Limestone with a 1/"+(CORE.ConfigSwitches.chanceToDropFluoriteOre)+" chance.");
}
- else if (this.mThisMaterial != FLUORIDES.FLUORITE){
+/* else if (this.mThisMaterial != FLUORIDES.FLUORITE){
list.add("Mined from the Toxic Everglades.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ }*/
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- if (this.mThisMaterial != null){
- if (this.mThisRadiation > 0){
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.mThisMaterial.vRadiationLevel, world, entityHolding);
+ if (KeyboardUtils.isCtrlKeyDown()) {
+
+ if (this.mThisMaterial != null) {
+ Block b = Block.getBlockFromItem(stack.getItem());
+ if (b != null) {
+ String aTool = b.getHarvestTool(stack.getItemDamage());
+ int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage());
+ if (aMiningLevel1 != 0) {
+ list.add("Mining Level: "+Math.min(Math.max(aMiningLevel1, 0), 5));
+ }
+ list.add("Ore contains: ");
+ if (mThisMaterial.getComposites().isEmpty()) {
+ list.add("- "+mThisMaterial.getLocalizedName());
+ }
+ else {
+ for (MaterialStack m : mThisMaterial.getComposites()) {
+ list.add("- "+m.getStackMaterial().getLocalizedName()+" x"+m.getPartsPerOneHundred());
}
}
}
+ }
+ }
+ else {
+ list.add(EnumChatFormatting.DARK_GRAY+"Hold Ctrl to show additional info.");
+ }
+
+
+
+
+
+
+ super.addInformation(stack, aPlayer, list, bool);
+}
+
+@Override
+public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
+ if (this.mThisMaterial != null){
+ if (this.mThisRadiation > 0){
+ if (entityHolding instanceof EntityPlayer){
+ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
+ EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.mThisMaterial.vRadiationLevel, world, entityHolding);
+ }
+ }
}
}
+}
}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemCreativeTab.java b/src/Java/gtPlusPlus/core/item/general/ItemCreativeTab.java
new file mode 100644
index 0000000000..c1a2655a03
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/ItemCreativeTab.java
@@ -0,0 +1,59 @@
+package gtPlusPlus.core.item.general;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+public class ItemCreativeTab extends Item {
+
+ public IIcon[] icons = new IIcon[10];
+
+ public ItemCreativeTab() {
+ super();
+ this.setHasSubtypes(true);
+ String unlocalizedName = "itemCreativeTabs";
+ this.setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(GregTech_API.TAB_GREGTECH);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_0");
+ this.icons[1] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_1");
+ this.icons[2] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_2");
+ this.icons[3] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_3");
+ this.icons[4] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_4");
+ this.icons[5] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_5");
+ this.icons[6] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_6");
+ this.icons[7] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_7");
+ this.icons[8] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_8");
+ this.icons[9] = reg.registerIcon(CORE.MODID + ":" + "controlcore/Core_9");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return this.icons[meta];
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 10; i ++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return this.getUnlocalizedName() + "_" + stack.getItemDamage();
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java b/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java
index 8e19896b92..aa3b044802 100644
--- a/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java
+++ b/src/Java/gtPlusPlus/core/item/materials/DustDecayable.java
@@ -30,9 +30,9 @@ public class DustDecayable extends BaseItemTickable {
@Override
public void registerIcons(IIconRegister reg) {
- String gt = "gregtech" + ":" + "materialicons/"+"METALLIC"+"/" + "dust";
+ String gt = "gregtech" + ":" + "materialicons/"+"SHINY"+"/" + "dust";
this.mIcon[0] = reg.registerIcon(gt);
- String gt2 = "gregtech" + ":" + "materialicons/"+"METALLIC"+"/" + "dust" + "_OVERLAY";
+ String gt2 = "gregtech" + ":" + "materialicons/"+"SHINY"+"/" + "dust" + "_OVERLAY";
this.mIcon[1] = reg.registerIcon(gt2);
}
@@ -57,15 +57,16 @@ public class DustDecayable extends BaseItemTickable {
}
}
- if (!tickItemTag(world, iStack)) {
+ if (!tickItemTag(world, iStack) && !this.getIsActive(world, iStack)) {
if (entityHolding instanceof EntityPlayer){
ItemStack replacement = ItemUtils.getSimpleStack(turnsIntoItem);
//Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+replacement.getDisplayName()+".");
final ItemStack tempTransform = replacement;
- if (iStack.stackSize == 64){
- tempTransform.stackSize=64;
+ if (iStack.stackSize > 1){
+ int u = iStack.stackSize;
+ tempTransform.stackSize = u;
((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- for (int l=0;l<64;l++){
+ for (int l=0;l<u;l++){
((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
}
diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java
index 9f37164aa0..5ff593da3f 100644
--- a/src/Java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java
@@ -1,7 +1,7 @@
package gtPlusPlus.core.material;
import gregtech.api.enums.Materials;
-
+import gregtech.api.enums.TextureSet;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.state.MaterialState;
@@ -20,7 +20,7 @@ public final class ELEMENT {
public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen);
public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen);
public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine);
- public final Material NEON = new Material("Neon", MaterialState.GAS, 12800, new short[]{255, 255, 255}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material
+ public final Material NEON = new Material("Neon", MaterialState.GAS, new short[]{255, 255, 255}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material
public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium);
public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium);
public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium);
@@ -42,29 +42,29 @@ public final class ELEMENT {
public final Material COPPER = MaterialUtils.generateMaterialFromGtENUM(Materials.Copper);
public final Material ZINC = MaterialUtils.generateMaterialFromGtENUM(Materials.Zinc);
public final Material GALLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gallium);
- public final Material GERMANIUM = new Material("Germanium", MaterialState.SOLID, 51200, new short[]{200, 200, 200}, 937, 2830, 32, 41, false, "Ge", 0);//Not a GT Inherited Material
+ public final Material GERMANIUM = new Material("Germanium", MaterialState.SOLID, new short[]{200, 200, 200}, 937, 2830, 32, 41, false, "Ge", 0);//Not a GT Inherited Material
public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic);
- public final Material SELENIUM = new Material("Selenium", MaterialState.SOLID, 51200, new short[]{190, 190, 190}, 217, 685, 34, 45, false, "Se", 0);//Not a GT Inherited Material
- public final Material BROMINE = new Material("Bromine", MaterialState.LIQUID, 51200, new short[]{200, 25, 25}, -7, 58, 35, 45, false, "Br", 0);//Not a GT Inherited Material
- public final Material KRYPTON = new Material("Krypton", MaterialState.GAS, 12800, new short[]{255, 255, 255}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material
+ public final Material SELENIUM = new Material("Selenium", MaterialState.SOLID, new short[]{190, 190, 190}, 217, 685, 34, 45, false, "Se", 0);//Not a GT Inherited Material
+ public final Material BROMINE = new Material("Bromine", MaterialState.PURE_LIQUID, new short[]{200, 25, 25}, -7, 58, 35, 45, false, "Br", 0);//Not a GT Inherited Material
+ public final Material KRYPTON = new Material("Krypton", MaterialState.GAS, new short[]{255, 255, 255}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material
public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium);
public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium);
public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium);
- public final Material ZIRCONIUM = new Material("Zirconium", MaterialState.SOLID, 51200, new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material
+ public final Material ZIRCONIUM = new Material("Zirconium", MaterialState.SOLID, new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material
public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium);
public final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum);
- public final Material TECHNETIUM = new Material("Technetium", MaterialState.SOLID, 25600, new short[]{220, 220, 220}, 2200, 4877, 43, 55, false, "Tc", 2);//Not a GT Inherited Material
- public final Material RUTHENIUM = new Material("Ruthenium", MaterialState.SOLID, 25600, new short[]{220, 220, 220}, 2250, 3900, 44, 57, false, "Ru", 0);//Not a GT Inherited Material
- public final Material RHODIUM = new Material("Rhodium", MaterialState.SOLID, 25600, new short[]{220, 220, 220}, 1966, 3727, 45, 58, false, "Rh", 0);//Not a GT Inherited Material
+ public final Material TECHNETIUM = new Material("Technetium", MaterialState.SOLID, new short[]{220, 220, 220}, 2200, 4877, 43, 55, false, "Tc", 2);//Not a GT Inherited Material
+ public final Material RUTHENIUM = new Material("Ruthenium", MaterialState.SOLID, new short[]{220, 220, 220}, 2250, 3900, 44, 57, false, "Ru", 0);//Not a GT Inherited Material
+ public final Material RHODIUM = new Material("Rhodium", MaterialState.SOLID, new short[]{220, 220, 220}, 1966, 3727, 45, 58, false, "Rh", 0);//Not a GT Inherited Material
public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium);
public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver);
public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium);
public final Material INDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Indium);
public final Material TIN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tin);
public final Material ANTIMONY = MaterialUtils.generateMaterialFromGtENUM(Materials.Antimony);
- public final Material TELLURIUM = new Material("Tellurium", MaterialState.SOLID, 25600, new short[]{210, 210, 210}, 449, 989, 52, 76, false, "Te", 0);//Not a GT Inherited Material
- public final Material IODINE = new Material("Iodine", MaterialState.SOLID, 25600, new short[]{96, 96, 96}, 114, 184, 53, 74, false, "I", 0);//Not a GT Inherited Material
- public final Material XENON = new Material("Xenon", MaterialState.GAS, 12800, new short[]{255, 255, 255}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material
+ public final Material TELLURIUM = new Material("Tellurium", MaterialState.SOLID, new short[]{210, 210, 210}, 449, 989, 52, 76, false, "Te", 0);//Not a GT Inherited Material
+ public final Material IODINE = new Material("Iodine", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{96, 96, 96}, 114, 184, 53, 74, false, "I", 0);//Not a GT Inherited Material
+ public final Material XENON = new Material("Xenon", MaterialState.GAS, new short[]{255, 255, 255}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material
public final Material CESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Caesium);
public final Material BARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Barium);
public final Material LANTHANUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lanthanum);
@@ -76,45 +76,45 @@ public final class ELEMENT {
public final Material EUROPIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Europium);
public final Material GADOLINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gadolinium);
public final Material TERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Terbium);
- public final Material DYSPROSIUM = new Material("Dysprosium", MaterialState.SOLID, 25600, new short[]{180, 180, 180}, 1412, 2562, 66, 97, false, "Dy", 0);//Not a GT Inherited Material
+ public final Material DYSPROSIUM = new Material("Dysprosium", MaterialState.SOLID, new short[]{180, 180, 180}, 1412, 2562, 66, 97, false, "Dy", 0);//Not a GT Inherited Material
public final Material HOLMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Holmium);
public final Material ERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Erbium);
public final Material THULIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thulium);
public final Material YTTERBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Ytterbium);
public final Material LUTETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lutetium);
- public final Material HAFNIUM = new Material("Hafnium", MaterialState.SOLID, 25600, new short[]{128, 128, 128}, 2150, 5400, 72, 106, false, "Hf", 0);//Not a GT Inherited Material
+ public final Material HAFNIUM = new Material("Hafnium", MaterialState.SOLID, new short[]{128, 128, 128}, 2150, 5400, 72, 106, false, "Hf", 0);//Not a GT Inherited Material
//Second 50 elements
public final Material TANTALUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Tantalum);
public final Material TUNGSTEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tungsten);
- public final Material RHENIUM = new Material("Rhenium", MaterialState.SOLID, 25600, new short[]{150, 150, 150}, 3180, 3627, 75, 111, false, "Re", 0);//Not a GT Inherited Material
+ public final Material RHENIUM = new Material("Rhenium", MaterialState.SOLID, new short[]{150, 150, 150}, 3180, 3627, 75, 111, false, "Re", 0);//Not a GT Inherited Material
public final Material OSMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmium);
public final Material IRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Iridium);
public final Material PLATINUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Platinum);
public final Material GOLD = MaterialUtils.generateMaterialFromGtENUM(Materials.Gold);
public final Material MERCURY = MaterialUtils.generateMaterialFromGtENUM(Materials.Mercury); //Mercury
- public final Material THALLIUM = new Material("Thallium", MaterialState.SOLID, 25600, new short[]{175, 175, 175}, 304, 1457, 81, 123, false, "Tl", 0);//Not a GT Inherited Material
+ public final Material THALLIUM = new Material("Thallium", MaterialState.SOLID, new short[]{175, 175, 175}, 304, 1457, 81, 123, false, "Tl", 0);//Not a GT Inherited Material
public final Material LEAD = MaterialUtils.generateMaterialFromGtENUM(Materials.Lead);
public final Material BISMUTH = MaterialUtils.generateMaterialFromGtENUM(Materials.Bismuth);
- public final Material POLONIUM = new Material("Polonium", MaterialState.SOLID, 25600, new short[]{180, 170, 180}, 254, 962, 84, 125, false, "Po", 1);//Not a GT Inherited Material
- public final Material ASTATINE = new Material("Astatine", MaterialState.SOLID, 25600, new short[]{170, 180, 170}, 302, 337, 85, 125, false, "At", 1);//Not a GT Inherited Material
+ public final Material POLONIUM = new Material("Polonium", MaterialState.SOLID, new short[]{180, 170, 180}, 254, 962, 84, 125, false, "Po", 1);//Not a GT Inherited Material
+ public final Material ASTATINE = new Material("Astatine", MaterialState.SOLID, new short[]{170, 180, 170}, 302, 337, 85, 125, false, "At", 1);//Not a GT Inherited Material
public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon);
- public final Material FRANCIUM = new Material("Francium", MaterialState.SOLID, 25600, new short[]{170, 160, 170}, 27, 677, 87, 136, false, "Fr", 1);//Not a GT Inherited Material
- public final Material RADIUM = new Material("Radium", MaterialState.SOLID, 25600, new short[]{165, 165, 165}, 700, 1737, 88, 138, false, "Ra", 1);//Not a GT Inherited Material
- public final Material ACTINIUM = new Material("Actinium", MaterialState.SOLID, 25600, new short[]{150, 165, 165}, 1050, 3200, 89, 138, false, "Ac", 1);//Not a GT Inherited Material
- public final Material THORIUM = new Material("Thorium", MaterialState.SOLID, 51200, Materials.Thorium.mRGBa, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("Th"), 1);
- public final Material PROTACTINIUM = new Material("Protactinium", MaterialState.SOLID, 25600, new short[]{190, 150, 170}, 1568, 4027, 91, 140, false, "Pa", 1);//Not a GT Inherited Material
+ public final Material FRANCIUM = new Material("Francium", MaterialState.SOLID, new short[]{170, 160, 170}, 27, 677, 87, 136, false, "Fr", 1);//Not a GT Inherited Material
+ public final Material RADIUM = new Material("Radium", MaterialState.SOLID, new short[]{165, 165, 165}, 700, 1737, 88, 138, false, "Ra", 1);//Not a GT Inherited Material
+ public final Material ACTINIUM = new Material("Actinium", MaterialState.SOLID, new short[]{150, 165, 165}, 1050, 3200, 89, 138, false, "Ac", 1);//Not a GT Inherited Material
+ public final Material THORIUM = new Material("Thorium", MaterialState.SOLID, Materials.Thorium.mRGBa, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("Th"), 1);
+ public final Material PROTACTINIUM = new Material("Protactinium", MaterialState.SOLID, new short[]{190, 150, 170}, 1568, 4027, 91, 140, false, "Pa", 1);//Not a GT Inherited Material
public final Material URANIUM238 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium);
public final Material URANIUM235 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium235);
- public final Material NEPTUNIUM = new Material("Neptunium", MaterialState.SOLID, 25600, new short[]{200, 220, 205}, 640, 3902, 93, 144, false, "Np", 2);//Not a GT Inherited Material
+ public final Material NEPTUNIUM = new Material("Neptunium", MaterialState.SOLID, new short[]{200, 220, 205}, 640, 3902, 93, 144, false, "Np", 2);//Not a GT Inherited Material
public final Material PLUTONIUM244 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium);
public final Material PLUTONIUM241 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium241);
public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium); //Americium
- public final Material CURIUM = new Material("Curium", MaterialState.SOLID, 25600, new short[]{175, 85, 110}, 1340, 3110, 96, 151, false, "Cm", 3);//Not a GT Inherited Material
- public final Material BERKELIUM = new Material("Berkelium", MaterialState.SOLID, 25600, new short[]{110, 250, 85}, 985, 710, 97, 150, false, "Bk", 4);//Not a GT Inherited Material
- public final Material CALIFORNIUM = new Material("Californium", MaterialState.SOLID, 25600, new short[]{85, 110, 205}, 899, 1472, 98, 153, false, "Cf", 4);//Not a GT Inherited Material
- public final Material EINSTEINIUM = new Material("Einsteinium", MaterialState.SOLID, 25600, new short[]{255, 85, 110}, 860, 3500, 99, 153, false, "Es", 5);//Not a GT Inherited Material //Boiling Point is made up
- public final Material FERMIUM = new Material("Fermium", MaterialState.LIQUID, 25600, new short[]{75, 90, 25}, 1527, 3850, 100, 157, false, "Fm", 5);//Not a GT Inherited Material //Boiling Point is made up
+ public final Material CURIUM = new Material("Curium", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{175, 85, 110}, 1340, 3110, 96, 151, false, "Cm", 3);//Not a GT Inherited Material
+ public final Material BERKELIUM = new Material("Berkelium", MaterialState.SOLID, new short[]{110, 250, 85}, 985, 710, 97, 150, false, "Bk", 4);//Not a GT Inherited Material
+ public final Material CALIFORNIUM = new Material("Californium", MaterialState.SOLID, new short[]{85, 110, 205}, 899, 1472, 98, 153, false, "Cf", 4);//Not a GT Inherited Material
+ public final Material EINSTEINIUM = new Material("Einsteinium", MaterialState.SOLID, new short[]{255, 85, 110}, 860, 3500, 99, 153, false, "Es", 5);//Not a GT Inherited Material //Boiling Point is made up
+ public final Material FERMIUM = new Material("Fermium", MaterialState.LIQUID, new short[]{75, 90, 25}, 1527, 3850, 100, 157, false, "Fm", 5);//Not a GT Inherited Material //Boiling Point is made up
//Misc
public final Material AER = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedAir);
@@ -133,10 +133,10 @@ public final class ELEMENT {
//Custom Isotopes
- public final Material LITHIUM7 = new Material("Lithium 7", MaterialState.LIQUID, Materials.Lithium.mRGBa, Materials.Lithium.mMeltingPoint, Materials.Lithium.mBlastFurnaceTemp, Materials.Lithium.getProtons(), Materials.Lithium.getNeutrons(), Materials.Lithium.mBlastFurnaceRequired, StringUtils.superscript("7Li"), 0, false);//Not a GT Inherited Material
- public final Material URANIUM232 = new Material("Uranium 232", MaterialState.SOLID, new short[]{88, 220, 103, 0}, 1132, 4131, 92, 140, false, StringUtils.superscript("232U"), 4);//Not a GT Inherited Material
- public final Material URANIUM233 = new Material("Uranium 233", MaterialState.SOLID, new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, StringUtils.superscript("233U"), 2);//Not a GT Inherited Material
- public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1, false);//Not a GT Inherited Material
+ public final Material LITHIUM7 = new Material("Lithium 7", MaterialState.LIQUID, TextureSet.SET_SHINY, Materials.Lithium.mRGBa, Materials.Lithium.mMeltingPoint, Materials.Lithium.mBlastFurnaceTemp, Materials.Lithium.getProtons(), Materials.Lithium.getNeutrons(), Materials.Lithium.mBlastFurnaceRequired, StringUtils.superscript("7Li"), 0, false);//Not a GT Inherited Material
+ public final Material URANIUM232 = new Material("Uranium 232", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{88, 220, 103, 0}, 1132, 4131, 92, 140, false, StringUtils.superscript("232U"), 4);//Not a GT Inherited Material
+ public final Material URANIUM233 = new Material("Uranium 233", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, StringUtils.superscript("233U"), 2);//Not a GT Inherited Material
+ public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1, false);//Not a GT Inherited Material
public final Material PLUTONIUM239 = new Material("Plutonium-239", MaterialState.SOLID, Materials.Plutonium.mIconSet, Materials.Plutonium.mDurability, Materials.Plutonium.mRGBa, Materials.Plutonium.mMeltingPoint, Materials.Plutonium.mBlastFurnaceTemp, 94, 145, false, StringUtils.superscript("239Pu"), 4, true);//Not a GT Inherited Material
//RTG Fuels
public final Material PLUTONIUM238 = new Material("Plutonium-238", MaterialState.SOLID, Materials.Plutonium241.mIconSet, Materials.Plutonium241.mDurability, Materials.Plutonium241.mRGBa, Materials.Plutonium241.mMeltingPoint, Materials.Plutonium241.mBlastFurnaceTemp, 94, 144, false, StringUtils.superscript("238Pu"), 2, false);//Not a GT Inherited Material
@@ -192,11 +192,10 @@ public final class ELEMENT {
TRINIUM_REFINED = TRINIUM;
}
- else {
- TRINIUM = new Material("Trinium", MaterialState.SOLID, new short[]{70, 110, 30}, 604, 4057, 181, 133, false, "Ke", 0, false);//Not a GT Inherited Material
- TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material
-
- }
+ else {
+ TRINIUM = new Material("Trinium", MaterialState.SOLID, TextureSet.SET_FINE, new short[]{70, 110, 30}, 604, 4057, 181, 133, false, "Ke", 0, false);//Not a GT Inherited Material
+ TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material
+ }
}
public static ELEMENT getInstance(){
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index 4dd88030bd..e5cacfdce7 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -3,7 +3,9 @@ package gtPlusPlus.core.material;
import static gregtech.api.enums.GT_Values.M;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import net.minecraft.block.Block;
@@ -15,6 +17,8 @@ import gregtech.api.enums.*;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.item.base.cell.BaseItemCell;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
@@ -30,6 +34,8 @@ import net.minecraftforge.fluids.FluidStack;
public class Material {
public static final Set<Material> mMaterialMap = new HashSet<Material>();
+
+ public static final Map<String, Map<String, BaseItemComponent>> mComponentMap = new HashMap<String, Map<String, BaseItemComponent>>();
private String unlocalizedName;
private String localizedName;
@@ -111,21 +117,31 @@ public class Material {
public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) {
this (materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs);
}
+
+ public Material(final String materialName, final MaterialState defaultState, TextureSet textureSet,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
+ this (materialName, defaultState, textureSet, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
+ }
+
+ public Material(final String materialName, final MaterialState defaultState, TextureSet textureSet,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) {
+ this (materialName, defaultState, textureSet, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs);
+ }
- public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
+ private Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
}
public Material(final String materialName, final MaterialState defaultState, final TextureSet set, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, final MaterialStack... inputs){
- this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
- }
+ this (materialName, defaultState, set, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs);
+ }
public Material(final String materialName, final MaterialState defaultState, final TextureSet set, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, boolean generateFluid, final MaterialStack... inputs){
if (mMaterialMap.add(this)) {
- //Placeholder
+
}
+ mComponentMap.put(unlocalizedName, new HashMap<String, BaseItemComponent>());
+
try {
this.unlocalizedName = Utils.sanitizeString(materialName);
this.localizedName = materialName;
@@ -150,7 +166,6 @@ public class Material {
}
}
}
- this.textureSet = setTextureSet(set);
//Set Melting/Boiling point, if value is -1 calculate it from compound inputs.
@@ -283,8 +298,37 @@ public class Material {
}
}
+ if (vMaterialInput.size() > 0) {
+ AutoMap<Integer> aDataSet = new AutoMap<Integer>();
+
+ int bonus = 0;
+ bonus += this.vMaterialInput.size();
+ bonus += MathUtils.roundToClosestInt(meltingPointC/1000);
+
+
+
+ aDataSet.put(bonus);
+
+ for (MaterialStack m : this.vMaterialInput) {
+ aDataSet.put(m.getStackMaterial().vTier);
+ }
+ int aAverage = MathUtils.getIntAverage(aDataSet);
+ if (aAverage > Integer.MAX_VALUE || aAverage < Integer.MIN_VALUE) {
+ aAverage = 0;
+ }
+ if (aAverage > 0) {
+ this.vTier = Math.min(aAverage, 10);
+ }
+ else {
+ this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
+ }
+ }
+ else {
+ this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
+ }
+
+
//Sets the materials 'tier'. Will probably replace this logic.
- this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
this.usesBlastFurnace = blastFurnace;
this.vVoltageMultiplier = MaterialUtils.getVoltageForTier(vTier);
@@ -315,6 +359,7 @@ public class Material {
}
else{
Logger.MATERIALS("MaterialInput == null && chemicalSymbol probably equals nothing");
+ this.vChemicalSymbol = "??";
this.vChemicalFormula = "??";
}
@@ -355,7 +400,9 @@ public class Material {
ratio = ratio + ":" +this.vSmallestRatio[hu];
}
}
- }
+ }
+
+ this.textureSet = setTextureSet(set, vTier);
Logger.MATERIALS("Creating a Material instance for "+materialName);
Logger.MATERIALS("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio);
@@ -370,19 +417,149 @@ public class Material {
}
}
+ public Material(String string, MaterialState solid, TextureSet setShiny, int i, short[] s, int j, int k, int l,
+ int m, boolean b, String string2, int n) {
+ // TODO Auto-generated constructor stub
+ }
+
public final TextureSet getTextureSet() {
synchronized(this) {
return textureSet;
}
}
+
public TextureSet setTextureSet(TextureSet set) {
+ return setTextureSet(set, vTier);
+ }
+
+ public TextureSet setTextureSet(TextureSet set, int aTier) {
if (set != null) {
+ Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+set.mSetName+". This textureSet was supplied.");
return set;
}
+
+ int aGem = 0;
+ int aShiny = 0;
+ TextureSet aSet = null;
+
+ //Check Mixture Contents
+ for (MaterialStack m : this.getComposites()) {
+
+ //Gems
+ if (m.getStackMaterial() == ELEMENT.getInstance().AER) {
+ aGem++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().AQUA) {
+ aGem++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().IGNIS) {
+ aGem++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().TERRA) {
+ aGem++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().MAGIC) {
+ aGem++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().FLUORINE) {
+ aGem++;
+ }
+ //Shiny Materials
+ if (m.getStackMaterial() == ELEMENT.getInstance().GOLD) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().SILVER) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().PLATINUM) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().AMERICIUM) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().TITANIUM) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().GERMANIUM) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().GALLIUM) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().MERCURY) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().MAGIC) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().SAMARIUM) {
+ aShiny++;
+ }
+ else if (m.getStackMaterial() == ELEMENT.getInstance().TANTALUM) {
+ aShiny++;
+ }
+ }
+
+ if (aSet == null) {
+ if (aGem >= this.getComposites().size()/2) {
+ if (MathUtils.isNumberEven(aGem)) {
+ Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+TextureSet.SET_GEM_HORIZONTAL.mSetName+".");
+ return TextureSet.SET_GEM_HORIZONTAL;
+ }
+ else {
+ Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+TextureSet.SET_GEM_VERTICAL.mSetName+".");
+ return TextureSet.SET_GEM_VERTICAL;
+ }
+ }
+ }
+
+ if (aSet == null) {
+ if (aShiny >= this.getComposites().size()/3) {
+ Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+TextureSet.SET_SHINY.mSetName+".");
+ return TextureSet.SET_SHINY;
+ }
+ }
+/*
+ if (aTier <= 2) {
+ aSet = TextureSet.SET_DULL;
+ }
+ else if (aTier <= 4) {
+ aSet = TextureSet.SET_ROUGH;
+ }
+ else if (aTier <= 7) {
+ aSet = TextureSet.SET_METALLIC;
+ }
+ else if (aTier <= 10) {
+ aSet = TextureSet.SET_FINE;
+ }
+ else {
+ aSet = TextureSet.SET_METALLIC;
+ }*/
+
+
+ /*int aPoint = this.getMeltingPointC();
+ if (aPoint <= 300 && !this.requiresBlastFurnace()) {
+ aSet = TextureSet.SET_DULL;
+ }
+ else if (aPoint <= 1500) {
+ aSet = TextureSet.SET_ROUGH;
+ }
+ else if (aPoint <= 4000) {
+ aSet = TextureSet.SET_METALLIC;
+ }
else {
- // build hash table with count
- AutoMap<Material> sets = new AutoMap<Material>();
+ aSet = TextureSet.SET_FINE;
+ }
+ if (aSet == null) {
+ aSet = TextureSet.SET_METALLIC;
+ }*/
+
+
+
+
+ // build hash table with count
+ AutoMap<Material> sets = new AutoMap<Material>();
if (this.vMaterialInput != null) {
for (MaterialStack r : this.vMaterialInput) {
if (r.getStackMaterial().getTextureSet().mSetName.toLowerCase().contains("fluid")) {
@@ -392,15 +569,17 @@ public class Material {
sets.put(r.getStackMaterial());
}
}
- TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values()));
+ TextureSet mostUsedTypeTextureSet = MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values()));
if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) {
Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+mostUsedTypeTextureSet.mSetName+".");
return mostUsedTypeTextureSet;
}
- }
- }
+ }
Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+Materials.Iron.mIconSet.mSetName+". [Fallback]");
- return Materials.Iron.mIconSet;
+ return Materials.Gold.mIconSet;
+
+
+
}
public final String getLocalizedName(){
@@ -480,6 +659,28 @@ public class Material {
public final boolean requiresBlastFurnace(){
return this.usesBlastFurnace;
}
+
+ public final ItemStack getComponentByPrefix(OrePrefixes aPrefix, int stacksize) {
+ Map<String, BaseItemComponent> g = mComponentMap.get(this.unlocalizedName);
+ if (g == null) {
+ Map<String, BaseItemComponent> aMap = new HashMap<String, BaseItemComponent>();
+ mComponentMap.put(unlocalizedName, aMap);
+ g = aMap;
+ }
+ Item i = g.get(aPrefix.name());
+ if (i != null) {
+ return ItemUtils.getSimpleStack(i, stacksize);
+ }
+ else {
+ ItemStack u = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(aPrefix.name()+this.unlocalizedName, stacksize);
+ if (u != null) {
+ return u;
+ }
+ else {
+ return ItemUtils.getSimpleStack(ModItems.AAA_Broken);
+ }
+ }
+ }
final public Block getBlock(){
return Block.getBlockFromItem(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("block"+this.unlocalizedName, 1).getItem());
@@ -490,79 +691,76 @@ public class Material {
}
public final ItemStack getDust(final int stacksize){
- return ItemUtils.getGregtechDust("dust"+this.unlocalizedName, stacksize);
+ ItemStack i = getComponentByPrefix(OrePrefixes.dust, stacksize);
+ return i != null ? i : ItemUtils.getGregtechDust("dust"+this.unlocalizedName, stacksize);
}
public final ItemStack getSmallDust(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.dustSmall, stacksize);
}
public final ItemStack getTinyDust(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+this.unlocalizedName, stacksize);
- }
-
- public final ItemStack[] getValidInputStacks(){
- return ItemUtils.validItemsForOreDict(this.unlocalizedName);
+ return getComponentByPrefix(OrePrefixes.dustTiny, stacksize);
}
public final ItemStack getIngot(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.ingot, stacksize);
}
public final ItemStack getHotIngot(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHot"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.ingotHot, stacksize);
}
public final ItemStack getPlate(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.plate, stacksize);
}
public final ItemStack getPlateDouble(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.plateDouble, stacksize);
}
public final ItemStack getGear(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGt"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.gearGt, stacksize);
}
public final ItemStack getRod(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stick"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.stick, stacksize);
}
public final ItemStack getLongRod(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stickLong"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.stickLong, stacksize);
}
public final ItemStack getBolt(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("bolt"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.bolt, stacksize);
}
public final ItemStack getScrew(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("screw"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.screw, stacksize);
}
public final ItemStack getRing(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ring"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.ring, stacksize);
}
public final ItemStack getRotor(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("rotor"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.rotor, stacksize);
}
public final ItemStack getFrameBox(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("frameGt"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.frameGt, stacksize);
}
public final ItemStack getCell(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.cell, stacksize);
}
public final ItemStack getPlasmaCell(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellPlasma"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.cellPlasma, stacksize);
}
public final ItemStack getNugget(final int stacksize){
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+this.unlocalizedName, stacksize);
+ return getComponentByPrefix(OrePrefixes.nugget, stacksize);
}
/**
@@ -737,31 +935,46 @@ public class Material {
if (dummyFormulaArray != null){
if (dummyFormulaArray.length >= 1){
for (int e=0;e<tempInput.size();e++){
- if (tempInput.get(e) != null){
- if (tempInput.get(e).getStackMaterial() != null){
- if (!tempInput.get(e).getStackMaterial().vChemicalSymbol.equals("??")){
+ MaterialStack g = tempInput.get(e);
+ if (g != null){
+ if (g.getStackMaterial() != null){
+
+ String aChemSymbol = g.getStackMaterial().vChemicalSymbol;
+ String aChemFormula = g.getStackMaterial().vChemicalFormula;
+
+ if (aChemSymbol == null) {
+ aChemSymbol = "??";
+ }
+ if (aChemFormula == null) {
+ aChemFormula = "??";
+ }
+
+ if (!aChemSymbol.equals("??")){
if (dummyFormulaArray[e] > 1){
- if (tempInput.get(e).getStackMaterial().vChemicalFormula.length() > 3){
- dummyFormula = dummyFormula + "(" + tempInput.get(e).getStackMaterial().vChemicalFormula + ")" + dummyFormulaArray[e];
+ if (aChemFormula.length() > 3){
+ dummyFormula = dummyFormula + "(" + aChemFormula + ")" + dummyFormulaArray[e];
}
else {
- dummyFormula = dummyFormula + tempInput.get(e).getStackMaterial().vChemicalFormula + dummyFormulaArray[e];
+ dummyFormula = dummyFormula + aChemFormula + dummyFormulaArray[e];
}
}
else if (dummyFormulaArray[e] == 1){
- if (tempInput.get(e).getStackMaterial().vChemicalFormula.length() > 3){
- dummyFormula = dummyFormula + "(" +tempInput.get(e).getStackMaterial().vChemicalFormula + ")";
+ if (aChemFormula.length() > 3){
+ dummyFormula = dummyFormula + "(" +aChemFormula + ")";
}
else {
- dummyFormula = dummyFormula +tempInput.get(e).getStackMaterial().vChemicalFormula;
+ dummyFormula = dummyFormula +aChemFormula;
}
}
+ else {
+ dummyFormula = dummyFormula + "??";
+ }
} else {
dummyFormula = dummyFormula + "??";
}
} else {
- dummyFormula = dummyFormula + "â–“â–“";
+ dummyFormula = dummyFormula + "??";
}
}
}
@@ -884,12 +1097,13 @@ public class Material {
return aTest3.getFluid();
}
-
+ ItemStack aFullCell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1);
Logger.MATERIALS("Generating our own fluid.");
//Generate a Cell if we need to
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){
+ if (aFullCell == null){
if (this.vGenerateCells){
- new BaseItemCell(this);
+ Item g = new BaseItemCell(this);
+ aFullCell = ItemUtils.getSimpleStack(g);
Logger.MATERIALS("Generated a cell for "+this.getUnlocalizedName());
}
else {
@@ -902,33 +1116,36 @@ public class Material {
this.getUnlocalizedName(),
"Molten "+this.getLocalizedName(),
this.RGBA,
- this.materialState.ID(),
+ 4,
this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
+ aFullCell,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ this.vGenerateCells);
}
- else if (this.materialState == MaterialState.LIQUID){
+ else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){
return FluidUtils.addGTFluid(
this.getUnlocalizedName(),
this.getLocalizedName(),
this.RGBA,
- this.materialState.ID(),
+ 0,
this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
+ aFullCell,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ this.vGenerateCells);
}
else if (this.materialState == MaterialState.GAS){
return FluidUtils.addGTFluid(
this.getUnlocalizedName(),
this.getLocalizedName()+" Gas",
this.RGBA,
- this.materialState.ID(),
+ 2,
this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1),
+ aFullCell,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ this.vGenerateCells);
}
else { //Plasma
return this.generatePlasma();
@@ -971,7 +1188,7 @@ public class Material {
final public int calculateMeltingPoint(){
try {
-
+
AutoMap<Integer> aDataSet = new AutoMap<Integer>();
for (MaterialStack m : this.vMaterialInput) {
aDataSet.put(m.getStackMaterial().getMeltingPointC());
@@ -986,7 +1203,7 @@ public class Material {
final public int calculateBoilingPoint(){
try {
-
+
AutoMap<Integer> aDataSet = new AutoMap<Integer>();
for (MaterialStack m : this.vMaterialInput) {
aDataSet.put(m.getStackMaterial().getBoilingPointC());
@@ -1001,7 +1218,7 @@ public class Material {
final public long calculateProtons(){
try {
-
+
AutoMap<Long> aDataSet = new AutoMap<Long>();
for (MaterialStack m : this.vMaterialInput) {
aDataSet.put(m.getStackMaterial().getProtons());
@@ -1016,7 +1233,7 @@ public class Material {
final public long calculateNeutrons(){
try {
-
+
AutoMap<Long> aDataSet = new AutoMap<Long>();
for (MaterialStack m : this.vMaterialInput) {
aDataSet.put(m.getStackMaterial().getNeutrons());
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 01353a71d9..4ed8f4ceb3 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -15,8 +15,11 @@ import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.block.base.BlockBaseOre;
+import gtPlusPlus.core.item.base.BaseItemComponent;
+import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
import gtPlusPlus.core.item.base.bolts.BaseItemBolt;
import gtPlusPlus.core.item.base.dusts.BaseItemDust;
+import gtPlusPlus.core.item.base.dusts.BaseItemDust.DustState;
import gtPlusPlus.core.item.base.gears.BaseItemGear;
import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot;
@@ -105,12 +108,10 @@ public class MaterialGenerator {
if (matInfo.getState() == MaterialState.SOLID){
if (generateEverything == true){
if (sRadiation >= 1){
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier);
+ temp = new BaseItemDust(matInfo);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemRod(matInfo);
@@ -118,15 +119,13 @@ public class MaterialGenerator {
}
else {
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour);
+ tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
+ tempBlock = new BlockBaseModular(matInfo,BlockTypes.FRAME);
temp = new BaseItemIngot(matInfo);
if (hotIngot){
temp = new BaseItemIngotHot(matInfo);
}
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier);
+ temp = new BaseItemDust(matInfo);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
@@ -139,12 +138,10 @@ public class MaterialGenerator {
temp = new BaseItemGear(matInfo);
}
} else {
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier);
+ temp = new BaseItemDust(matInfo);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
@@ -152,16 +149,18 @@ public class MaterialGenerator {
}
else if (matInfo.getState() == MaterialState.LIQUID){
if (generateEverything == true){
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
}
temp = new BaseItemIngot(matInfo);
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier);
+ temp = new BaseItemDust(matInfo);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
}
+ else if (matInfo.getState() == MaterialState.GAS){
+ temp = new BaseItemDust(matInfo);
+ FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true);
+ }
else if (matInfo.getState() == MaterialState.PURE_LIQUID){
FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C);
return true;
@@ -211,9 +210,7 @@ public class MaterialGenerator {
}
if (matInfo.getState() == MaterialState.SOLID){
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, false);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, false);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, false);
+ temp = new BaseItemDust(matInfo);
}
//Add A jillion Recipes - old code
@@ -246,11 +243,8 @@ public class MaterialGenerator {
sRadiation = matInfo.vRadiationLevel;
}
- tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", 3);
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", 2);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", 1);
-
+ tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD);
+ temp = new BaseItemDust(matInfo);
temp = new BaseItemIngot(matInfo);
temp = new BaseItemNugget(matInfo);
@@ -307,12 +301,18 @@ public class MaterialGenerator {
tempBlock = new BlockBaseOre(matInfo, BlockTypes.ORE, Colour.intValue());
}
- if (generateDust) {
- temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", matInfo.vTier, false);
+ DustState aState = new DustState(generateDust, generateSmallTinyDusts, generateSmallTinyDusts);
+
+ if (!aState.generatesDust()) {
+ if (aState.generatesSmallDust()) {
+ temp = new BaseItemComponent(matInfo, ComponentTypes.DUSTSMALL);
+ }
+ if (aState.generatesTinyDust()) {
+ temp = new BaseItemComponent(matInfo, ComponentTypes.DUSTTINY);
+ }
}
- if (generateSmallTinyDusts) {
- temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", matInfo.vTier, false);
- temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", matInfo.vTier, false);
+ else {
+ temp = new BaseItemDust(aState, matInfo);
}
temp = new BaseItemCrushedOre(matInfo);
diff --git a/src/Java/gtPlusPlus/core/material/NONMATERIAL.java b/src/Java/gtPlusPlus/core/material/NONMATERIAL.java
index f0a7716199..4da34ae16c 100644
--- a/src/Java/gtPlusPlus/core/material/NONMATERIAL.java
+++ b/src/Java/gtPlusPlus/core/material/NONMATERIAL.java
@@ -1,7 +1,7 @@
package gtPlusPlus.core.material;
import gregtech.api.enums.Materials;
-
+import gregtech.api.enums.TextureSet;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
public class NONMATERIAL {
@@ -14,9 +14,27 @@ public class NONMATERIAL {
//Glowstone Dust
public static final Material GLOWSTONE = MaterialUtils.generateMaterialFromGtENUM(Materials.Glowstone);
-
+
//Enderpearl
public static final Material ENDERPEARL = MaterialUtils.generateMaterialFromGtENUM(Materials.EnderPearl);
+
+ //Raw Flesh
+ public static final Material MEAT = MaterialUtils.generateMaterialFromGtENUM(Materials.MeatRaw);
+
+ //Clay
+ public static final Material CLAY = MaterialUtils.generateMaterialFromGtENUM(Materials.Clay);
+
+ //Wrought Iron
+ public static final Material WROUGHT_IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.WroughtIron);
+
+
+
+
+ static {
+ MEAT.setTextureSet(TextureSet.SET_ROUGH);
+ CLAY.setTextureSet(TextureSet.SET_ROUGH);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java
index 75d6da07fe..a99cdc476d 100644
--- a/src/Java/gtPlusPlus/core/material/ORES.java
+++ b/src/Java/gtPlusPlus/core/material/ORES.java
@@ -1,7 +1,7 @@
package gtPlusPlus.core.material;
import gregtech.api.enums.TextureSet;
-
+import gtPlusPlus.core.client.CustomTextureSet.TextureSets;
import gtPlusPlus.core.material.state.MaterialState;
public final class ORES {
@@ -9,7 +9,7 @@ public final class ORES {
public static final Material GEIKIELITE = new Material(
"Geikielite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_GEM_HORIZONTAL, //Texture Set
+ TextureSets.GEM_A.get(), //Texture Set
new short[]{187, 193, 204, 0}, //Material Colour
500,
1500,
@@ -133,7 +133,7 @@ public final class ORES {
public static final Material SAMARSKITE_Y = new Material(
"Samarskite (Y)", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
+ TextureSets.ENRICHED.get(), //Texture Set
new short[]{65, 163, 164, 0}, //Material Colour
500,
1500,
@@ -153,7 +153,7 @@ public final class ORES {
public static final Material SAMARSKITE_YB = new Material(
"Samarskite (Yb)", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
+ TextureSets.ENRICHED.get(), //Texture Set
new short[]{95, 193, 194, 0}, //Material Colour
500,
1500,
@@ -172,7 +172,7 @@ public final class ORES {
public static final Material ZIRCON = new Material(
"Zircon", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_GEM_VERTICAL, //Texture Set
+ TextureSets.GEM_A.get(), //Texture Set
new short[]{195, 19, 19, 0}, //Material Colour
500,
1500,
@@ -189,7 +189,7 @@ public final class ORES {
public static final Material GADOLINITE_CE = new Material(
"Gadolinite (Ce)", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{15, 159, 59, 0}, //Material Colour
500,
1500,
@@ -211,7 +211,7 @@ public final class ORES {
public static final Material GADOLINITE_Y = new Material(
"Gadolinite (Y)", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{35, 189, 99, 0}, //Material Colour
500,
1500,
@@ -323,7 +323,7 @@ public final class ORES {
public static final Material ZIRCOPHYLLITE = new Material(
"Zircophyllite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FIERY, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{30, 0, 6, 0}, //Material Colour
500,
1500,
@@ -346,7 +346,7 @@ public final class ORES {
public static final Material ZIRKELITE = new Material(
"Zirkelite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_GEM_HORIZONTAL, //Texture Set
+ TextureSets.GEM_A.get(), //Texture Set
new short[]{229, 208, 48, 0}, //Material Colour
500,
1500,
@@ -366,7 +366,7 @@ public final class ORES {
public static final Material LANTHANITE_LA = new Material(
"Lanthanite (La)", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{219, 160, 214, 0}, //Material Colour
500,
1500,
@@ -439,7 +439,7 @@ public final class ORES {
public static final Material CERITE = new Material(
"Cerite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{68, 13, 0, 0}, //Material Colour
500,
1500,
@@ -608,7 +608,7 @@ public final class ORES {
public static final Material LAFOSSAITE = new Material(
"Lafossaite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_METALLIC, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{165, 105, 205, 0}, //Material Colour
500,
1500,
@@ -644,7 +644,7 @@ public final class ORES {
public static final Material COMANCHEITE = new Material(
"Comancheite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FINE, //Texture Set
+ TextureSets.REFINED.get(), //Texture Set
new short[]{65, 205, 105, 0}, //Material Colour
500,
1500,
@@ -759,7 +759,7 @@ public final class ORES {
public static final Material IRARSITE = new Material(
"Irarsite", //Material Name
MaterialState.ORE, //State
- TextureSet.SET_FIERY, //Texture Set
+ TextureSets.ENRICHED.get(), //Texture Set
new short[]{125, 105, 105, 0}, //Material Colour
500,
1500,
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index 5bdd42b02d..8e25b4e485 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -5,7 +5,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import gregtech.api.enums.Dyes;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_LanguageManager;
@@ -166,92 +165,53 @@ public class FluidUtils {
}
- public static Fluid addAutogeneratedMoltenFluid(final String materialNameFormatted, final short[] rgba, final int MeltingPoint) {
- return addFluid("molten." + materialNameFormatted.toLowerCase(), "molten.autogenerated", "Molten " + materialNameFormatted, null, rgba, 1, (MeltingPoint <= 0L) ? 1000L : MeltingPoint, null, null, 0);
- }
- public static Fluid addAutogeneratedMoltenFluid(final GT_Materials aMaterial) {
- return addFluid("molten." + aMaterial.name().toLowerCase(), "molten.autogenerated", "Molten " + aMaterial.name(), aMaterial, aMaterial.mMoltenRGBa, 1, (aMaterial.mMeltingPoint <= 0L) ? 1000L : aMaterial.mMeltingPoint, null, null, 0);
- }
- public static Fluid addFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK) {
- return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
- }
- public static Fluid addFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- return addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+
+ public static Fluid addGtFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
+ return addGtFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, true);
}
- public static Fluid addFluid(String aName, final String aTexture, final String aLocalized, final GT_Materials aMaterial, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- aName = Utils.sanitizeString(aName.toLowerCase());
- Fluid rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
- GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), (aLocalized == null) ? aName : aLocalized);
- if (FluidRegistry.registerFluid(rFluid)) {
- switch (aState) {
- case 0: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(10000);
- break;
- }
- case 1:
- case 4: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(1000);
- break;
- }
- case 2: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-100);
- rFluid.setViscosity(200);
- break;
- }
- case 3: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-10000);
- rFluid.setViscosity(10);
- rFluid.setLuminosity(15);
- break;
- }
- }
- }
- else {
- rFluid = FluidRegistry.getFluid(aName);
- }
- if ((rFluid.getTemperature() == new Fluid("test").getTemperature()) || (rFluid.getTemperature() <= 0)) {
- rFluid.setTemperature((int) (aTemperatureK));
- }
- if (aMaterial != null) {
- switch (aState) {
- case 1: {
- aMaterial.mFluid = (rFluid);
- break;
- }
- case 2: {
- aMaterial.mGas = (rFluid);
- break;
- }
- case 3: {
- aMaterial.mPlasma = (rFluid);
- break;
+
+ public static Fluid addGtFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
+ Fluid g = addGTFluid(aName, "fluid.autogenerated", aLocalized, aMaterial.mRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
+ if (g != null) {
+ if (aMaterial != null) {
+ switch (aState) {
+ case 1: {
+ aMaterial.mFluid = (g);
+ break;
+ }
+ case 2: {
+ aMaterial.mGas = (g);
+ break;
+ }
+ case 3: {
+ aMaterial.mPlasma = (g);
+ break;
+ }
}
}
+ return g;
}
- if ((aFullContainer != null) && (aEmptyContainer != null) && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
- MaterialGenerator.addFluidCannerRecipe(aFullContainer, container(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
- }
- return rFluid;
+ return null;
}
- public static Fluid addGTFluid(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- return addGTFluid("molten."+aName, "molten.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+ public static Fluid addGTFluid(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
+ return addGTFluid("molten."+aName, "molten.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
}
- public static Fluid addGTFluidNonMolten(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- return addGTFluid("fluid."+aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+ public static Fluid addGTFluidNonMolten(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
+ return addGTFluid("fluid."+aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
}
- public static Fluid addGTFluidNoPrefix(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- return addGTFluid(aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+ public static Fluid addGTFluidNoPrefix(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
+ return addGTFluid(aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
+ }
+ //Gass
+ public static Fluid addGtGas(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
+ return addGTFluid(aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
}
public static Fluid addGTPlasma(final Material aMaterial) {
@@ -287,46 +247,91 @@ public class FluidUtils {
10000,
temp,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ false);
}
return null;
}
- public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
+ public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateFilledCell) {
+
+ String aNameOriginal = aName;
+
aName = Utils.sanitizeString(aName.toLowerCase());
- Fluid rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
- GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), (aLocalized == null) ? aName : aLocalized);
- if (FluidRegistry.registerFluid(rFluid)) {
- switch (aState) {
- case 0: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(10000);
- break;
- }
- case 1:
- case 4: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(1000);
- break;
- }
- case 2: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-100);
- rFluid.setViscosity(200);
- break;
- }
- case 3: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-10000);
- rFluid.setViscosity(10);
- rFluid.setLuminosity(15);
- break;
- }
- }
+
+ String aLocalName = (aLocalized == null) ? aName : aLocalized;
+
+ Fluid rFluid;
+ Fluid gFluid = FluidRegistry.getFluid(aName);
+ FluidStack aCheck = FluidUtils.getWildcardFluidStack(aName.toLowerCase(), 1000);
+ boolean register = false;
+ if (aCheck != null) {
+ rFluid = aCheck.getFluid();
+ }
+ else if (gFluid != null) {
+ rFluid = gFluid;
}
else {
- rFluid = FluidRegistry.getFluid(aName);
+ rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
+ register = true;
+
+ }
+
+ if (register) {
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalName);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
+ case 0: {
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
+ break;
+ }
+ case 1:
+ case 4: {
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
+ break;
+ }
+ case 2: {
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
+ break;
+ }
+ case 3: {
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-10000);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
+ break;
+ }
+ }
+ }
}
+
+
+
+ if (aFullContainer == null) {
+ ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName, 1);
+ aFullContainer = oreStack;
+ }
+
+ Item tempCell = null;
+ //Generate a Cell if we need to
+ if (aGenerateFilledCell && aFullContainer == null) {
+ String aMatName = aNameOriginal;
+ if (aMatName.contains("molten.")) {
+ aMatName = aMatName.replace("molten.", "");
+ aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1);
+ }
+ if (aMatName.contains("fluid.")) {
+ aMatName = aMatName.replace("fluid.", "");
+ aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1);
+ }
+ tempCell = new BaseItemComponent(aMatName, aLocalized, aRGBa);
+ aFullContainer = ItemUtils.getSimpleStack(tempCell);
+ }
+
if ((rFluid.getTemperature() == new Fluid("test").getTemperature()) || (rFluid.getTemperature() <= 0)) {
rFluid.setTemperature((int) (aTemperatureK));
}
@@ -422,24 +427,25 @@ public class FluidUtils {
return amount(aStacksize, container(aStack, aCheckIFluidContainerItems));
}
- public final static Fluid generateFluid(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA){
+ public final static Fluid generateFluid(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, boolean aGenerateCell){
FluidStack aFStack = (FluidUtils.getFluidStack("molten"+"."+unlocalizedName.toLowerCase(), 1));
if (aFStack == null){
Logger.WARNING("Generating our own fluid.");
- ItemStack cell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1);
+/* ItemStack cell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1);
if (cell == null){
final Item temp = new BaseItemComponent(unlocalizedName, localizedName, RGBA);
cell = ItemUtils.getSimpleStack(temp);
- }
+ }*/
final Fluid gtFluid = FluidUtils.addGTFluid(
unlocalizedName,
"Molten "+localizedName,
RGBA,
4,
MeltingPoint,
- cell,
+ null,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ aGenerateCell);
return gtFluid;
}
@@ -449,15 +455,20 @@ public class FluidUtils {
}
}
- public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA){
- return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, null, null, 0);
+ public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final boolean aGenerateCell){
+ return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, null, null, 0, aGenerateCell);
}
+
public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final ItemStack dustStack, final ItemStack dustStack2){
- return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144);
+ return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144, true);
+ }
+
+ public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final ItemStack dustStack, final ItemStack dustStack2, final boolean aGenerateCell){
+ return generateFluidNonMolten(unlocalizedName, localizedName, MeltingPoint, RGBA, dustStack, dustStack2, 144, aGenerateCell);
}
- public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, ItemStack dustStack, final ItemStack dustStack2, final int amountPerItem){
+ public final static Fluid generateFluidNonMolten(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, ItemStack dustStack, final ItemStack dustStack2, final int amountPerItem, final boolean aGenerateCell){
if (dustStack == null){
dustStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+Utils.sanitizeString(localizedName), 1);
}
@@ -465,22 +476,16 @@ public class FluidUtils {
if (aFStack == null){
Logger.WARNING("Generating our own fluid.");
- //Generate a Cell if we need to
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
- @SuppressWarnings("unused")
- final
- Item temp = new BaseItemComponent(unlocalizedName, localizedName, RGBA);
- }
-
final Fluid gtFluid = FluidUtils.addGTFluidNonMolten(
unlocalizedName,
localizedName,
RGBA,
4,
MeltingPoint,
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1),
+ null,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ aGenerateCell);
if (dustStack != null){
MaterialGenerator.addFluidExtractionRecipe(
@@ -510,8 +515,12 @@ public class FluidUtils {
return aFStack.getFluid();
}
}
-
+
public final static Fluid generateFluidNoPrefix(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA){
+ return generateFluidNoPrefix(unlocalizedName, localizedName, MeltingPoint, RGBA, true);
+ }
+
+ public final static Fluid generateFluidNoPrefix(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final boolean aGenerateCell){
Fluid gtFluid;
if (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1) == null){
Logger.WARNING("Generating our own fluid.");
@@ -521,19 +530,47 @@ public class FluidUtils {
RGBA,
4,
MeltingPoint,
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1),
+ null,
ItemUtils.getEmptyCell(),
- 1000);
+ 1000,
+ aGenerateCell);
}
else {
gtFluid = FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1).getFluid();
}
//Generate a Cell if we need to
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
- new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
+// if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
+// new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
+// }
+ return gtFluid;
+ }
+
+ public final static Fluid generateGas(final String unlocalizedName, final String localizedName, final int MeltingPoint, final short[] RGBA, final boolean aGenerateCell){
+ Fluid gtFluid;
+ if (FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1) == null){
+ Logger.WARNING("Generating our own gas.");
+ gtFluid = FluidUtils.addGtGas(
+ unlocalizedName,
+ localizedName,
+ RGBA,
+ 3,
+ MeltingPoint,
+ null,
+ ItemUtils.getEmptyCell(),
+ 1000,
+ aGenerateCell);
+ }
+ else {
+ gtFluid = FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), 1).getFluid();
}
+ //Generate a Cell if we need to
+/* if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+unlocalizedName, 1) == null){
+ new BaseItemCell(unlocalizedName, localizedName, RGBA, gtFluid);
+ }*/
return gtFluid;
}
+
+
public static FluidStack getMobEssence(final int amount){
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 27ba5c2733..165a7931cb 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -22,7 +22,6 @@ import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.base.BasicSpawnEgg;
-import gtPlusPlus.core.item.base.dusts.BaseItemDust;
import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique;
import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust;
import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust;
@@ -330,15 +329,6 @@ public class ItemUtils {
return null;
}
- public static Item[] generateDusts(final String unlocalizedName, final String materialName, final int materialTier, final Material matInfo, final int Colour){
- final int radioactive = getRadioactivityLevel(materialName);
- final Item[] output = {
- new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier),
- new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier),
- new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier)};
- return output;
- }
-
//NullFormula
public static Item[] generateSpecialUseDusts(final String unlocalizedName, final String materialName, final int Colour){
return generateSpecialUseDusts(unlocalizedName, materialName, "NullFormula", Colour);
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 9d1dbff23a..0eb888209a 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack;
import gregtech.api.enums.*;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.TypeCounter;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.state.MaterialState;
@@ -129,7 +130,6 @@ public class MaterialUtils {
final Material temp = new Material(
materialName,
defaultState,
- 0, //Durability
colour,
1000, //melting
3000, //boiling
@@ -148,35 +148,35 @@ public class MaterialUtils {
return true;
}
- public static int getTierOfMaterial(final int M){
- if ((M >= 0) && (M <= 1000)){
+ public static int getTierOfMaterial(final int aMeltingPoint){
+ if ((aMeltingPoint >= 0) && (aMeltingPoint <= 1000)){
return 1;
}
- else if((M >= 1001) && (M <= 2000)){
+ else if((aMeltingPoint >= 1001) && (aMeltingPoint <= 2000)){
return 2;
}
- else if((M >= 2001) && (M <= 3000)){
+ else if((aMeltingPoint >= 2001) && (aMeltingPoint <= 3000)){
return 3;
}
- else if((M >= 3001) && (M <= 4000)){
+ else if((aMeltingPoint >= 3001) && (aMeltingPoint <= 4000)){
return 4;
}
- else if((M >= 4001) && (M <= 5000)){
+ else if((aMeltingPoint >= 4001) && (aMeltingPoint <= 5000)){
return 5;
}
- else if((M >= 5001) && (M <= 6000)){
+ else if((aMeltingPoint >= 5001) && (aMeltingPoint <= 6000)){
return 6;
}
- else if((M >= 6001) && (M <= 7000)){
+ else if((aMeltingPoint >= 6001) && (aMeltingPoint <= 7000)){
return 7;
}
- else if((M >= 7001) && (M <= 8000)){
+ else if((aMeltingPoint >= 7001) && (aMeltingPoint <= 8000)){
return 8;
}
- else if((M >= 8001) && (M <= 9000)){
+ else if((aMeltingPoint >= 8001) && (aMeltingPoint <= 9000)){
return 9;
}
- else if((M >= 9001) && (M <= 9999)){
+ else if((aMeltingPoint >= 9001) && (aMeltingPoint <= 9999)){
return 10;
}
else {
@@ -256,10 +256,21 @@ public class MaterialUtils {
return mName;
}
- public static TextureSet getMostCommonTextureSet(List<Material> list) {
- Optional<TextureSet> r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
+ public static TextureSet getMostCommonTextureSet(List<Material> list) {
+ TypeCounter<TextureSet> aCounter = new TypeCounter<TextureSet>(TextureSet.class);
+ for (Material m : list) {
+ TextureSet t = m.getTextureSet();
+ if (t == null) {
+ t = Materials.Gold.mIconSet;
+ }
+ if (t != null) {
+ aCounter.add(t, t.mSetName);
+ }
+ }
+ return aCounter.getResults();
+ /*Optional<TextureSet> r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
TextureSet o = (r != null && r.isPresent() && r.get() != null) ? r.get() : null;
- return o;
+ return o;*/
}
public static Materials getMaterial(String aMaterialName) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 182d30e5c5..abf8fd9714 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -29,6 +29,7 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import gtPlusPlus.xmod.gregtech.loaders.*;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNitroDieselFix;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class HANDLER_GT {
@@ -102,14 +103,21 @@ public class HANDLER_GT {
private static int removeCrudeTurbineRotors() {
int aRemoved = 0;
-
+ Item aU;
Collection<GT_Recipe> aAssRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList;
//170, 172, 174, 176
if (aAssRecipes.size() > 0 && (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH)) {
recipe: for (GT_Recipe aG : aAssRecipes) {
if (aG.mOutputs != null && aG.mOutputs.length > 0) {
outputs: for (ItemStack aI : aG.mOutputs) {
- if (aI.getItem() instanceof GT_MetaGenerated_Tool_01) {
+ if (aI == null) {
+ continue;
+ }
+ aU = aI.getItem();
+ if (aU == null) {
+ continue;
+ }
+ if (aU instanceof GT_MetaGenerated_Tool_01) {
int aMeta = aI.getItemDamage();
//Logger.INFO("Found assembler recipe outputting a GT Tool with a meta value of "+aMeta);
if (aMeta >= 170 && aMeta <= 176) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
index b4aa2080f9..3e4b9a3fee 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
@@ -1,8 +1,7 @@
package gtPlusPlus.xmod.gregtech.common.blocks.fluid;
import net.minecraft.item.ItemStack;
-
-import gregtech.api.enums.ItemList;
+import net.minecraftforge.fluids.FluidRegistry;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
@@ -40,24 +39,31 @@ public class GregtechFluidHandler {
if (!LoadedMods.ThermalFoundation){
- Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids");
- FluidUtils.addFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemUtils.getEmptyCell(), 1000);
- FluidUtils.addFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemUtils.getEmptyCell(), 1000);
- FluidUtils.addFluid("ender", "Resonant Ender", GT_Materials.Ender, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), ItemUtils.getEmptyCell(), 1000);
+ Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids if they do not already exist.");
+ if (!FluidRegistry.isFluidRegistered("cryotheum")) {
+ FluidUtils.addGtFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemUtils.getEmptyCell(), 1000);
+ }
+ if (!FluidRegistry.isFluidRegistered("pyrotheum")) {
+ FluidUtils.addGtFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemUtils.getEmptyCell(), 1000);
+ }
+ if (!FluidRegistry.isFluidRegistered("ender")) {
+ FluidUtils.addGtFluid("ender", "Resonant Ender", GT_Materials.Ender, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), ItemUtils.getEmptyCell(), 1000);
+ }
+
}
if (LoadedMods.IndustrialCraft2){
Logger.INFO("Adding in GT Fluids for various nuclear related content.");
- FluidUtils.addFluid("hydrofluoricAcid", "Industrial Strength Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), ItemUtils.getEmptyCell(), 1000);
+ FluidUtils.addGtFluid("hydrofluoricAcid", "Industrial Strength Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), ItemUtils.getEmptyCell(), 1000, false);
generateIC2FluidCell("HydrofluoricAcid");
FluidUtils.generateFluidNoPrefix("SulfurDioxide", "High Quality Sulfur Dioxide", 263, GT_Materials.SulfurDioxide.mRGBa);
- FluidUtils.addFluid("sulfurousAcid", "Sulfurous Acid", GT_Materials.SulfurousAcid, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), ItemUtils.getEmptyCell(), 1000);
+ FluidUtils.addGtFluid("sulfurousAcid", "Sulfurous Acid", GT_Materials.SulfurousAcid, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), ItemUtils.getEmptyCell(), 1000, false);
generateIC2FluidCell("SulfurousAcid");
- FluidUtils.addFluid("sulfuricApatite", "Sulfuric Apatite Mix", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemUtils.getEmptyCell(), 1000);
+ FluidUtils.addGtFluid("sulfuricApatite", "Sulfuric Apatite Mix", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemUtils.getEmptyCell(), 1000, false);
generateIC2FluidCell("SulfuricApatite");
@@ -70,16 +76,16 @@ public class GregtechFluidHandler {
else {
Logger.INFO("No Suitable versions of Hydrogen Chloride available, adding our own.");
}
- FluidUtils.addFluid("hydrogenChloride", "Industrial Strength Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemUtils.getEmptyCell(), 1000);
+ FluidUtils.addGtFluid("hydrogenChloride", "Industrial Strength Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemUtils.getEmptyCell(), 1000, false);
generateIC2FluidCell("HydrogenChloride");
}
}
- FluidUtils.addFluid("sulfuricLithium", "Sulfuric Lithium Mix", GT_Materials.SulfuricLithium, 4, 280, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), ItemUtils.getEmptyCell(), 1000);
+ FluidUtils.addGtFluid("sulfuricLithium", "Sulfuric Lithium Mix", GT_Materials.SulfuricLithium, 4, 280, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), ItemUtils.getEmptyCell(), 1000, false);
generateIC2FluidCell("SulfuricLithium");
- FluidUtils.addFluid("lithiumHydroxide", "Lithium Hydroxide", GT_Materials.LithiumHydroxide, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), ItemUtils.getEmptyCell(), 1000);
+ FluidUtils.addGtFluid("lithiumHydroxide", "Lithium Hydroxide", GT_Materials.LithiumHydroxide, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), ItemUtils.getEmptyCell(), 1000, false);
generateIC2FluidCell("LithiumHydroxide");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index 1bef648bd2..b588613224 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -14,11 +14,13 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import net.minecraftforge.fluids.FluidStack;
@@ -118,7 +120,13 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base {
if (smallDust != null && tinyDust != null) {
generatePackagerRecipes(material);
}
-
+
+ ItemStack ingot = material.getIngot(1);
+ if (normalDust != null && ingot != null) {
+ addFurnaceRecipe(material);
+ addMacerationRecipe(material);
+ }
+
//Is this a composite?
if ((inputStacks != null) && !disableOptional){
//Is this a composite?
@@ -352,5 +360,83 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base {
return true;
}
+ private void addMacerationRecipe(Material aMatInfo){
+ try {
+ Logger.MATERIALS("Adding Maceration recipe for "+aMatInfo.getLocalizedName()+" Ingot -> Dusts");
+ final int chance = (aMatInfo.vTier*10)/MathUtils.randInt(10, 20);
+ GT_ModHandler.addPulverisationRecipe(aMatInfo.getIngot(1), aMatInfo.getDust(1), null, chance);
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ private void addFurnaceRecipe(Material aMatInfo){
+
+ ItemStack aDust = aMatInfo.getDust(1);
+ ItemStack aOutput;
+ try {
+ if (aMatInfo.requiresBlastFurnace()) {
+ aOutput = aMatInfo.getHotIngot(1);
+ if (aOutput != null) {
+ if (addBlastFurnaceRecipe(aMatInfo, aDust, null, aOutput, null, aMatInfo.getMeltingPointK())){
+ Logger.MATERIALS("Successfully added a blast furnace recipe for "+aMatInfo.getLocalizedName());
+ }
+ else {
+ Logger.MATERIALS("Failed to add a blast furnace recipe for "+aMatInfo.getLocalizedName());
+ }
+ }
+ else {
+ Logger.MATERIALS("Failed to add a blast furnace recipe for "+aMatInfo.getLocalizedName());
+ }
+ }
+ else {
+ aOutput = aMatInfo.getIngot(1);
+ if (aOutput != null) {
+ if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)){
+ Logger.MATERIALS("Successfully added a furnace recipe for "+aMatInfo.getLocalizedName());
+ }
+ else {
+ Logger.MATERIALS("Failed to add a furnace recipe for "+aMatInfo.getLocalizedName());
+ }
+ }
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ }
+
+ private boolean addBlastFurnaceRecipe(Material aMatInfo, final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){
+
+ try {
+ int timeTaken = 125*aMatInfo.vTier*10;
+
+ if (aMatInfo.vTier <= 4){
+ timeTaken = 25*aMatInfo.vTier*10;
+ }
+ int aSlot = aMatInfo.vTier - 1;
+ if (aSlot < 2) {
+ aSlot = 2;
+ }
+ long aVoltage = GT_Values.V[aSlot >= 2 ? aSlot : 2];
+
+ return GT_Values.RA.addBlastRecipe(
+ input1,
+ input2,
+ GT_Values.NF, GT_Values.NF,
+ output1,
+ output2,
+ timeTaken,
+ (int) aVoltage,
+ tempRequired);
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ return false;
+ }
+ }
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
index 771a48c809..99984d98bf 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
@@ -44,7 +44,11 @@ public class RecipeGen_Ore implements Runnable{
//if (material.getMaterialComposites().length > 1){
Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]");
- final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 120 : 30;
+ int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
+ if (tVoltageMultiplier < 120) {
+ tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 480 : 120;
+ }
+
final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
Material bonusA = null; //Ni
Material bonusB = null; //Tin
@@ -101,19 +105,19 @@ public class RecipeGen_Ore implements Runnable{
* Macerate
*/
//Macerate ore to Crushed
- if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, 2)){
+ if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, tVoltageMultiplier/2)){
Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'");
}
//Macerate Crushed to Impure Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushed(1), new ItemStack[]{material.getDustImpure(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, 2)){
+ if (GT_Values.RA.addPulveriserRecipe(material.getCrushed(1), new ItemStack[]{material.getDustImpure(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'");
}
//Macerate Washed to Purified Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushedPurified(1), new ItemStack[]{material.getDustPurified(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, 2)){
+ if (GT_Values.RA.addPulveriserRecipe(material.getCrushedPurified(1), new ItemStack[]{material.getDustPurified(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'");
}
//Macerate Centrifuged to Pure Dust
- if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{material.getDust(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, 2)){
+ if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{material.getDust(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'");
}
@@ -168,13 +172,13 @@ public class RecipeGen_Ore implements Runnable{
/**
* Forge Hammer
*/
- if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), material.getDust(1), 10, 16)){
+ if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), material.getDust(1), 10, tVoltageMultiplier/4)){
Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'");
}
- if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedPurified(1), material.getDustPurified(1), 10, 16)){
+ if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedPurified(1), material.getDustPurified(1), 10, tVoltageMultiplier/4)){
Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'");
}
- if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, 16)){
+ if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, tVoltageMultiplier/4)){
Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Ore to Crushed'");
}
@@ -190,7 +194,7 @@ public class RecipeGen_Ore implements Runnable{
null, null,null,
new int[]{10000, 10000}, //Chances
5*20, //Eu
- 5)){ //Time
+ tVoltageMultiplier/2)){ //Time
Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
}
@@ -203,7 +207,7 @@ public class RecipeGen_Ore implements Runnable{
null, null,null,
new int[]{10000, 10000}, //Chances
5*20, //Eu
- 5)){ //Time
+ tVoltageMultiplier/2)){ //Time
Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
}
@@ -287,7 +291,7 @@ public class RecipeGen_Ore implements Runnable{
mInternalOutputs[4],
mInternalOutputs[5],
mChances,
- 20*90,
+ 20*1*(tVoltageMultiplier/10),
tVoltageMultiplier)){
Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for "+material.getDust(1).getDisplayName());
}