aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/item
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-01-29 18:45:40 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-01-29 18:45:40 +1000
commit0828168a736692402bd621b984c2d35590ed9730 (patch)
treefb9da5ea4836544b6278364db449ed5cebf52696 /src/Java/gtPlusPlus/core/item
parent33a1703896cbc37b9986c71038e20c659edb7814 (diff)
downloadGT5-Unofficial-0828168a736692402bd621b984c2d35590ed9730.tar.gz
GT5-Unofficial-0828168a736692402bd621b984c2d35590ed9730.tar.bz2
GT5-Unofficial-0828168a736692402bd621b984c2d35590ed9730.zip
+ Added Trinium Titanium Cable/wires.
+ Redid material components to better use GT texture assets. % Gave all 32 ore types new TextureSets. % Doubled capacity of all fluid pipes. % Moved Item/Block creation from init() to preInit(). $ Fixed Sludge fluid texture. $ Moved Darkworld from being a child mod into it's own mod, Renamed to Toxic Everglades. $ Bundled SegmentHelper.java, for future development ease.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java26
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java172
-rw-r--r--src/Java/gtPlusPlus/core/item/base/CoreItem.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java17
4 files changed, 103 insertions, 114 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 97cf3310ea..98043d9775 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -274,7 +274,7 @@ public final class ModItems {
public static Item itemRope;
public static Item itemFiber;
-
+
public static Item itemDragonJar;
public static final void init(){
@@ -346,27 +346,27 @@ public final class ModItems {
try{
-
+
/**
* Try generate dusts for missing rare earth materials if they don't exist
*/
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1) == null){
- ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9));
+ ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9));
}
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1) == null){
- ItemUtils.generateSpecialUseDusts("Ytterbium", "Ytterbium", Materials.Ytterbium.mElement.name(), Utils.rgbtoHexValue(Materials.Yttrium.mRGBa[0]-60, Materials.Yttrium.mRGBa[1]-60, Materials.Yttrium.mRGBa[2]-60));
+ ItemUtils.generateSpecialUseDusts("Ytterbium", "Ytterbium", Materials.Ytterbium.mElement.name(), Utils.rgbtoHexValue(Materials.Yttrium.mRGBa[0]-60, Materials.Yttrium.mRGBa[1]-60, Materials.Yttrium.mRGBa[2]-60));
}
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1) == null){
- ItemUtils.generateSpecialUseDusts("Samarium", "Samarium", Materials.Samarium.mElement.name(), Utils.rgbtoHexValue(161, 168, 114));
+ ItemUtils.generateSpecialUseDusts("Samarium", "Samarium", Materials.Samarium.mElement.name(), Utils.rgbtoHexValue(161, 168, 114));
}
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLanthanum", 1) == null){
- ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163));
+ ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163));
}
/*if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1) == null){
ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", "", Utils.rgbtoHexValue(Materials.Gadolinium.mRGBa[0], Materials.Gadolinium.mRGBa[1], Materials.Gadolinium.mRGBa[2]));
}*/
-
+
//Elements generate first so they can be used in compounds.
//Missing Elements
@@ -513,16 +513,18 @@ public final class ModItems {
MaterialGenerator.generate(ALLOY.HG1223, false, false);
//Generate Fictional Materials
- MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM, false);
- MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM_REFINED, false);
+ if (!CORE.GTNH) {
+ MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM, false);
+ MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM_REFINED, false);
+ }
MaterialGenerator.generate(ALLOY.TRINIUM_TITANIUM);
MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH, false);
MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON);
//Must be the final Alloy to Generate
MaterialGenerator.generate(ALLOY.QUANTUM);
-
-
+
+
//Ores
MaterialGenerator.generateOreMaterial(FLUORIDES.FLUORITE);
GTplusplus_Secondary.GenerateOreMaterials();
@@ -692,7 +694,7 @@ public final class ModItems {
itemLavaFilter = new ItemLavaFilter();
itemGrindleTablet = new BaseItemGrindle();
-
+
itemDragonJar = new ItemEntityCatcher();
//Chemistry
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 235d50ae36..4e22fb959b 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -3,6 +3,9 @@ package gtPlusPlus.core.item.base;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.TextureSet;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
@@ -10,13 +13,16 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.entity.EntityUtils;
+import gtPlusPlus.core.util.input.KeyboardUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
+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{
@@ -28,6 +34,9 @@ public class BaseItemComponent extends Item{
public final int componentColour;
public Object extraData;
+ protected IIcon base;
+ protected IIcon overlay;
+
public BaseItemComponent(final Material material, final ComponentTypes componentType) {
this.componentMaterial = material;
this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName();
@@ -36,7 +45,7 @@ public class BaseItemComponent extends Item{
this.setCreativeTab(AddToCreativeTab.tabMisc);
this.setUnlocalizedName(this.unlocalName);
this.setMaxStackSize(64);
- this.setTextureName(this.getCorrectTextures());
+ //this.setTextureName(this.getCorrectTextures());
this.componentColour = material.getRgbAsHex();
GameRegistry.registerItem(this, this.unlocalName);
GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
@@ -62,46 +71,19 @@ public class BaseItemComponent extends Item{
if (!CORE.ConfigSwitches.useGregtechTextures){
return CORE.MODID + ":" + "item"+this.componentType.COMPONENT_NAME;
}
- if (this.componentType == ComponentTypes.GEAR){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "gearGt";
- }
- else if (this.componentType == ComponentTypes.SMALLGEAR){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "gearGtSmall";
- }
- else if (this.componentType == ComponentTypes.ROD){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "stick";
- }
- else if (this.componentType == ComponentTypes.RODLONG){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "stickLong";
- }
- else if (this.componentType == ComponentTypes.PLATEDOUBLE){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "plateDouble";
- }
- else if (this.componentType == ComponentTypes.CELL){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "cell";
- }
- else if (this.componentType == ComponentTypes.PLASMACELL){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "cellPlasma";
- }
- else if (this.componentType == ComponentTypes.BOLT){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "bolt";
- }
- else if (this.componentType == ComponentTypes.RING){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "ring";
- }
- else if (this.componentType == ComponentTypes.ROTOR){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "rotor";
- }
- else if (this.componentType == ComponentTypes.SCREW){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "screw";
- }
- else if (this.componentType == ComponentTypes.INGOT){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "ingot";
- }
- else if (this.componentType == ComponentTypes.HOTINGOT){
- return "gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot";
- }
- return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME.toLowerCase();
+ String metType = "9j4852jyo3rjmh3owlhw9oe";
+ if (this.componentMaterial != null) {
+ TextureSet u = this.componentMaterial.getTextureSet();
+ if (u != null) {
+ metType = u.mSetName;
+ }
+ }
+ metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
+ return "gregtech" + ":" + "materialicons/"+metType+"/" + this.componentType.getOreDictName();
+
+
+
+ //return "gregtech" + ":" + "materialicons/"+metType+"/" + this.componentType.COMPONENT_NAME.toLowerCase();
}
@Override
@@ -128,42 +110,6 @@ public class BaseItemComponent extends Item{
if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && (this.componentMaterial != null)){
- if (this.componentType == ComponentTypes.DUST){
- //list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust.");
- }
- if (this.componentType == ComponentTypes.INGOT){
- //list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + ".");
- if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && this.unlocalName.toLowerCase().contains("ingothot")){
- list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
- }
- }
- if (this.componentType == ComponentTypes.PLATE){
- //list.add(EnumChatFormatting.GRAY+"A flat plate of " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.PLATEDOUBLE){
- //list.add(EnumChatFormatting.GRAY+"A double plate of " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.ROD){
- //list.add(EnumChatFormatting.GRAY+"A 40cm Rod of " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.RODLONG){
- //list.add(EnumChatFormatting.GRAY+"A 80cm Rod of " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.ROTOR){
- //list.add(EnumChatFormatting.GRAY+"A Rotor made out of " + materialName + ". ");
- }
- if (this.componentType == ComponentTypes.BOLT){
- //list.add(EnumChatFormatting.GRAY+"A small Bolt, constructed from " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.SCREW){
- //list.add(EnumChatFormatting.GRAY+"A 8mm Screw, fabricated out of some " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.GEAR){
- //list.add(EnumChatFormatting.GRAY+"A large Gear, constructed from " + materialName + ".");
- }
- if (this.componentType == ComponentTypes.RING){
- //list.add(EnumChatFormatting.GRAY+"A " + materialName + " Ring.");
- }
if (this.componentMaterial != null){
if (!this.componentMaterial.vChemicalFormula.equals("??") && !this.componentMaterial.vChemicalFormula.equals("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) {
list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula));
@@ -172,19 +118,33 @@ public class BaseItemComponent extends Item{
if (this.componentMaterial.isRadioactive){
list.add(CORE.GT_Tooltip_Radioactive);
}
+
+ if (this.componentType == ComponentTypes.INGOT){
+ if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && this.unlocalName.toLowerCase().contains("ingothot")){
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
+ }
+ }
+ }
+
+ //Hidden Tooltip
+ if (KeyboardUtils.isCtrlKeyDown()) {
+ if (this.componentMaterial != null) {
+ String type = this.componentMaterial.getTextureSet().mSetName;
+ String output = type.substring(0, 1).toUpperCase() + type.substring(1);
+ list.add(EnumChatFormatting.GRAY+"Material Type: "+output+".");
+ list.add(EnumChatFormatting.GRAY+"Material State: "+this.componentMaterial.getState().name()+".");
+ list.add(EnumChatFormatting.GRAY+"Radioactivity Level: "+this.componentMaterial.vRadiationLevel+".");
+ }
}
+ else {
+ list.add(EnumChatFormatting.DARK_GRAY+"Hold Ctrl to show additional info.");
+ }
}
super.addInformation(stack, aPlayer, list, bool);
}
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.componentColour;
- }
-
@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){
@@ -197,8 +157,52 @@ public class BaseItemComponent extends Item{
}
+ /**
+ *
+ * Handle Custom Rendering
+ *
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses(){
+ return (CORE.ConfigSwitches.useGregtechTextures ? true : false);
+ }
+ @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);
+ }
+ return this.componentColour;
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if (CORE.ConfigSwitches.useGregtechTextures) {
+ if(pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
+ return this.base;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+
+ if (CORE.ConfigSwitches.useGregtechTextures){
+ this.base = i.registerIcon(getCorrectTextures());
+ this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
+ }
+ else {
+ this.base = i.registerIcon(getCorrectTextures());
+ //this.overlay = i.registerIcon(getCorrectTextures() + "_OVERLAY");
+ }
+ }
@@ -211,7 +215,7 @@ public class BaseItemComponent extends Item{
PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble"),
ROD("Rod", " Rod", "stick"),
RODLONG("RodLong", " Long Rod", "stickLong"),
- GEAR("Gear", " Gear", "gear"),
+ GEAR("Gear", " Gear", "gearGt"),
SMALLGEAR("SmallGear", " Gear", "gearGtSmall"), //TODO
SCREW("Screw", " Screw", "screw"),
BOLT("Bolt", " Bolt", "bolt"),
diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
index 8baf909af7..3b0fa7b621 100644
--- a/src/Java/gtPlusPlus/core/item/base/CoreItem.java
+++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
@@ -155,7 +155,7 @@ public class CoreItem extends Item
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(this.descColour+this.itemDescription);
+ //list.add(this.descColour+this.itemDescription);
//super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
index f2228afb78..275e7bbb3a 100644
--- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
+++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
@@ -17,8 +17,6 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
public class BaseItemCell extends BaseItemComponent{
- private IIcon base;
- private IIcon overlay;
ComponentTypes Cell = ComponentTypes.CELL;
public BaseItemCell(final Material material) {
@@ -40,12 +38,6 @@ public class BaseItemCell extends BaseItemComponent{
}
@Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses(){
- return true;
- }
-
- @Override
public void registerIcons(final IIconRegister i) {
if (CORE.ConfigSwitches.useGregtechTextures){
@@ -73,13 +65,4 @@ public class BaseItemCell extends BaseItemComponent{
return this.componentColour;
}
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if(pass == 0) {
- return this.base;
- }
- return this.overlay;
- }
-
}