aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java237
-rw-r--r--src/Java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java44
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/IonParticles.java49
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java77
5 files changed, 389 insertions, 28 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 04470b3554..2fd23ec88d 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -37,8 +37,10 @@ import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble;
import gtPlusPlus.core.item.bauble.HealthBoostBauble;
import gtPlusPlus.core.item.bauble.ModularBauble;
import gtPlusPlus.core.item.chemistry.CoalTar;
+import gtPlusPlus.core.item.chemistry.IonParticles;
import gtPlusPlus.core.item.chemistry.NuclearChem;
import gtPlusPlus.core.item.chemistry.RocketFuels;
+import gtPlusPlus.core.item.chemistry.StandardBaseParticles;
import gtPlusPlus.core.item.effects.RarityUncommon;
import gtPlusPlus.core.item.general.*;
import gtPlusPlus.core.item.general.books.ItemBaseBook;
@@ -536,6 +538,7 @@ public final class ModItems {
MaterialGenerator.generate(ALLOY.MARAGING250);
MaterialGenerator.generate(ALLOY.MARAGING300);
MaterialGenerator.generate(ALLOY.MARAGING350);
+ MaterialGenerator.generate(ALLOY.AQUATIC_STEEL);
MaterialGenerator.generate(ALLOY.NITINOL_60);
@@ -811,11 +814,8 @@ public final class ModItems {
dustTechnetium99M = new DustDecayable("dustTechnetium99M", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 8570, new String[] {""+StringUtils.superscript("99ᵐTc"), "Result: Technicium 99 ("+StringUtils.superscript("99Tc")+")"}, dustTechnetium99, 4);
dustMolybdenum99 = new DustDecayable("dustMolybdenum99", ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(), 16450, new String[] {""+StringUtils.superscript("99Mo"), "Result: Technicium 99ᵐ ("+StringUtils.superscript("99ᵐTc")+")"}, dustTechnetium99M, 4);
- new BaseItemParticle(ELEMENT.getInstance().HYDROGEN, "Ion");
- new BaseItemParticle(ELEMENT.getInstance().HELIUM, "Ion");
- new BaseItemParticle(ELEMENT.getInstance().LITHIUM, "Ion");
- new BaseItemParticle(ELEMENT.getInstance().BERYLLIUM, "Ion");
-
+ new IonParticles();
+ new StandardBaseParticles();
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index ec0b490f63..4dbb5851f2 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -7,15 +7,6 @@ import java.util.Map;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-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;
@@ -32,15 +23,23 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.thaumcraft.aspect.GTPP_Aspects;
import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
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;
@@ -62,9 +61,9 @@ public class BaseItemComponent extends Item{
//this.setTextureName(this.getCorrectTextures());
this.componentColour = material.getRgbAsHex();
GameRegistry.registerItem(this, this.unlocalName);
-
+
//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);
@@ -91,7 +90,7 @@ public class BaseItemComponent extends Item{
GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+unlocalName, ItemUtils.getSimpleStack(this));
registerComponent();
}
-
+
public boolean registerComponent() {
if (this.componentMaterial == null) {
return false;
@@ -197,6 +196,7 @@ public class BaseItemComponent extends Item{
super.addInformation(stack, aPlayer, list, bool);
}
+ @SuppressWarnings("unchecked")
@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.componentMaterial != null){
@@ -206,6 +206,19 @@ public class BaseItemComponent extends Item{
}
}
}
+
+ if (extraData != null) {
+ if (componentMaterial != null && componentMaterial.getRGBA()[3] > 1) {
+ if (((Map<Integer, Short[]>) extraData).get(9999) == null) {
+ ((Map<Integer, Short[]>) extraData).put(9999, new Short[] {0});
+ }
+ Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get(9999)[0];
+ short fC = (short) (aCurrentFrame >= Short.MAX_VALUE ? 0 : aCurrentFrame+1);
+ ((Map<Integer, Short[]>) extraData).put((int) 9999, new Short[] {(short) (fC), 0});
+ ((Map<Integer, Short[]>) extraData).put((int) 9998, new Short[] {aCurrentFrame, 0});
+
+ }
+ }
}
@@ -221,15 +234,209 @@ public class BaseItemComponent extends Item{
return (CORE.ConfigSwitches.useGregtechTextures ? true : false);
}
+ @SuppressWarnings("unchecked")
@Override
public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+
+
if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){
return Utils.rgbtoHexValue(255, 255, 255);
}
if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){
return Utils.rgbtoHexValue(255, 255, 255);
}
+
+
+
+ try {
+ if (this.componentMaterial == null) {
+ if (extraData != null) {
+ if (short.class.isInstance(extraData)){
+ short[] abc = (short[]) extraData;
+ return Utils.rgbtoHexValue(abc[0], abc[1], abc[2]);
+ }
+ }
+ return this.componentColour;
+ }
+
+ if (this.componentMaterial.getRGBA()[3] <= 1) {
+ return this.componentColour;
+ }
+ else {
+
+ //Mild Glow Effect
+ if (this.componentMaterial.getRGBA()[3] == 2) {
+ if (extraData == null) {
+ extraData = new HashMap<Integer, Short[]>();
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0});
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-1, new Short[] {0});
+ short[] er = this.componentMaterial.getRGBA();
+ short value = 1;
+ Short[] ht = new Short[] {er[0], er[1], er[2]};
+ for (int y = 0; y < 40; y++) {
+ if (y < 20) {
+ value = 1;
+ }
+ else {
+ value = -1;
+ }
+ short r = (short) (ht[0] + value);
+ short g = (short) (ht[1] + value);
+ short b = (short) (ht[2] + value);
+ Short[] qq = new Short[] {(short) Math.min(255, r), (short) Math.min(255, g), (short) Math.min(255, b)};
+ ht = qq;
+ ((Map<Integer, Short[]>) extraData).put(y, qq);
+ }
+ }
+ if (extraData != null) {
+
+ Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
+ Short aSize = 40;
+ short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame+1) : 0);
+ Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0);
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
+ return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);
+
+
+ /*Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
+ Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get((int) aCurrentFrame);
+ short nextFrame = aCurrentFrame < 40 ? aCurrentFrame++ : 0;
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
+ return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);*/
+ }
+ }
+
+ //Rainbow Hue Cycle
+ else if (this.componentMaterial.getRGBA()[3] == 3) {
+ if (extraData == null) {
+ extraData = new HashMap<Integer, Short[]>();
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0});
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-1, new Short[] {0});
+ int aSlot = 0;
+
+ //Let's say you're starting with green:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0});
+ //Slowly start adding in some red to get to yellow:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0});
+ //Then, take out the green to get to red:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0});
+ //Now, add blue to get to purple:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255});
+ //Then, remove red to get to blue:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255});
+ //Add the green back in to get to cyan:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255});
+ //And finally remove the blue to get back to green:
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51});
+ ((Map<Integer, Short[]>) extraData).put((int) Byte.MAX_VALUE, new Short[] {(short) (((Map<Integer, Short[]>) extraData).size()-1)});
+
+
+ }
+ if (extraData != null) {
+ Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0];
+ Short aSize = (short) (((Map<Integer, Short[]>) extraData).size() - 3);
+ short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame+1) : 0);
+ Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0);
+ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame});
+ return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);
+ }
+ }
+ }
+
+
+ }
+ catch (Throwable t) {
+
+ }
return this.componentColour;
+
+
+
+
+
}
@Override
@@ -307,7 +514,7 @@ public class BaseItemComponent extends Item{
public OrePrefixes getGtOrePrefix() {
return this.a_GT_EQUAL;
}
-
+
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java
index 363b9ad00d..89cd1e55ae 100644
--- a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java
+++ b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemParticle.java
@@ -1,26 +1,54 @@
package gtPlusPlus.core.item.base.misc;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-public class BaseItemParticle extends CoreItem {
-
- private final Material mParticleMaterial;
+public abstract class BaseItemParticle extends CoreItem {
+
+ protected static final Map<Integer, Integer> aColourMap = new LinkedHashMap<Integer, Integer> ();
+ private final int aMaxCount;
- public BaseItemParticle(Material aMat, String aType) {
- super("particle"+aMat.getLocalizedName()+aType, aMat.getLocalizedName()+" "+aType, AddToCreativeTab.tabOther, 64, 0, new String[] {}, EnumRarity.rare, EnumChatFormatting.DARK_AQUA, false, null);
+ public BaseItemParticle(String aType, int aCount, EnumRarity aRarity) {
+ super("particle"+aType, aType, AddToCreativeTab.tabOther, 64, 0, new String[] {}, aRarity, EnumChatFormatting.DARK_AQUA, false, null);
this.setTextureName(CORE.MODID + ":" + "science/Atom");
- mParticleMaterial = aMat;
+ aMaxCount = aCount;
+ this.setHasSubtypes(true);
+
}
@Override
public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.mParticleMaterial.getRgbAsHex();
+ return aColourMap.get(stack.getItemDamage());
+ }
+
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < aMaxCount; i ++) {
+ list.add(new ItemStack(item, 1, i));
+ }
}
+
+ @Override
+ public final String getItemStackDisplayName(final ItemStack tItem) {
+ String aReturnValue = super.getItemStackDisplayName(tItem);
+ String[] a2 = getAffixes();
+ aReturnValue = (a2[0] + aReturnValue + a2[1]);
+ return aReturnValue;
+ }
+
+ public abstract String[] getAffixes();
+
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/IonParticles.java b/src/Java/gtPlusPlus/core/item/chemistry/IonParticles.java
new file mode 100644
index 0000000000..ff5f67d2da
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/chemistry/IonParticles.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.core.item.chemistry;
+
+import gregtech.api.enums.Materials;
+import gtPlusPlus.core.item.base.misc.BaseItemParticle;
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemStack;
+
+public class IonParticles extends BaseItemParticle {
+
+ public IonParticles() {
+ super("Ion", aElements.length, EnumRarity.rare);
+ }
+
+ private static final String[] aElements = new String[]{"Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminum", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Cesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson"};
+
+ static {
+ //Generate Ions
+ int key = 0;
+ for (String s : aElements) {
+ Materials m = Materials.get(s);
+ int aColour = 0;
+ if (m == null) {
+ aColour = Utils.rgbtoHexValue(128, 128, 128);
+ }
+ else {
+ aColour = Utils.rgbtoHexValue(m.mRGBa[0], m.mRGBa[1], m.mRGBa[2]);
+ }
+ aColourMap.put(key++, aColour);
+ }
+
+ }
+
+ @Override
+ public String[] getAffixes() {
+ return new String[] {"", ""};
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return "";
+ }
+
+ @Override
+ public String getUnlocalizedName(final ItemStack itemStack) {
+ return "item.particle.ion" + "." + aElements[itemStack.getItemDamage()];
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java b/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
new file mode 100644
index 0000000000..dd07d41b3d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java
@@ -0,0 +1,77 @@
+package gtPlusPlus.core.item.chemistry;
+
+import gregtech.api.enums.Materials;
+import gtPlusPlus.core.item.base.misc.BaseItemParticle;
+import gtPlusPlus.core.material.Particle;
+import gtPlusPlus.core.material.Particle.ElementaryGroup;
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemStack;
+
+public class StandardBaseParticles extends BaseItemParticle {
+
+ public StandardBaseParticles() {
+ super("Base", aTypes.length, EnumRarity.rare);
+ }
+
+ private static final String[] aTypes = new String[] { "Graviton", "Up", "Down", "Charm", "Strange", "Top",
+ "Bottom", "Electron", "Electron Neutrino", "Muon", "Muon Neutrino", "Tau", "Tau Neutrino", "Gluon",
+ "Photon", "Z Boson", "W Boson", "Higgs Boson", "Proton", "Neutron", "Lambda", "Omega", "Pion",
+ "ETA Meson", };
+
+ static {
+ //Generate Ions
+ int key = 0;
+ for (String s : aTypes) {
+ Particle p;
+ for (Particle o : Particle.aMap) {
+ int aColour = 0;
+ if (o.mParticleName.toLowerCase().equals(s.toLowerCase())) {
+ if (o.mParticleType == ElementaryGroup.BARYON) {
+ aColour = Utils.rgbtoHexValue(174, 226, 156);
+ aColourMap.put(key++, aColour);
+ }
+ else if (o.mParticleType == ElementaryGroup.BOSON) {
+ if (o == Particle.HIGGS_BOSON) {
+ aColour = Utils.rgbtoHexValue(226, 196, 104);
+ aColourMap.put(key++, aColour);
+ }
+ else {
+ aColour = Utils.rgbtoHexValue(226, 52, 66);
+ aColourMap.put(key++, aColour);
+ }
+ }
+ else if (o.mParticleType == ElementaryGroup.LEPTON) {
+ aColour = Utils.rgbtoHexValue(126, 226, 95);
+ aColourMap.put(key++, aColour);
+ }
+ else if (o.mParticleType == ElementaryGroup.MESON) {
+ aColour = Utils.rgbtoHexValue(90, 154, 226);
+ aColourMap.put(key++, aColour);
+ }
+ else {
+ aColour = Utils.rgbtoHexValue(188, 61, 226);
+ aColourMap.put(key++, aColour);
+ }
+ }
+ }
+ }
+
+ }
+
+ @Override
+ public String[] getAffixes() {
+ return new String[] {"", ""};
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return "";
+ }
+
+ @Override
+ public String getUnlocalizedName(final ItemStack itemStack) {
+ return "item.particle.base" + "." + aTypes[itemStack.getItemDamage()];
+ }
+
+}