aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java78
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java32
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java31
-rw-r--r--src/Java/gtPlusPlus/core/util/item/ItemUtils.java13
4 files changed, 112 insertions, 42 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
index 7812b14e1d..732c59c9a9 100644
--- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
@@ -6,6 +6,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
@@ -43,33 +44,22 @@ public class BaseOreComponent 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));
+ GT_OreDictUnificator.registerOre(componentType.getComponent()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
}
public String getCorrectTextures(){
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";
- }*/
-
return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME;
}
@Override
public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- if (this.componentMaterial != null) {
- return (this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME);
- }
- return this.materialName+" Cell";
+ return (this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME);
}
public final String getMaterialName() {
@@ -88,21 +78,13 @@ public class BaseOreComponent extends Item{
}
if (this.componentMaterial.isRadioactive){
- list.add(CORE.GT_Tooltip_Radioactive);
+ list.add(CORE.GT_Tooltip_Radioactive+" | Level: "+this.componentMaterial.vRadiationLevel);
}
}
-
}
-
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){
@@ -135,9 +117,11 @@ public class BaseOreComponent extends Item{
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister par1IconRegister){
if (CORE.ConfigSwitches.useGregtechTextures){
- this.base = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell");
+ Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"' as the layer 0 texture path.");
+ this.base = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME);
if (this.componentType.hasOverlay()){
- this.overlay = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell_OVERLAY");
+ Logger.MATERIALS(this.componentType.getPrefix()+this.componentMaterial.getLocalizedName()+this.componentType.DISPLAY_NAME+" is using `"+"gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"_OVERLAY"+"' as the layer 1 texture path.");
+ this.overlay = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME+"_OVERLAY");
}
}
else {
@@ -148,28 +132,45 @@ public class BaseOreComponent extends Item{
}
}
+ @Override
+ public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){
+ return this.componentColour;
+ }
+ if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){
+ return Utils.rgbtoHexValue(230, 230, 230);
+ }
+ return this.componentColour;
+ }
+
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+ if(pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
+ }
public static enum ComponentTypes {
- DUST("dust", "", " Dust", "dust", true),
- DUSTIMPURE("dustImpure", "Impure ", " Dust", "dustImpure", true),
- DUSTPURE("dustPure", "Purified ", " Dust", "dustPure", true),
- CRUSHED("crushed", "Crushed ", " Ore", "crushed", true),
- CRUSHEDCENTRIFUGED("crushedCentrifuged", "Centrifuged "," Ore", "crushedCentrifuged", true),
- CRUSHEDPURIFIED("crushedPurified", "Purified", " Ore", "crushedPurified", true);
+ DUST("dust", "", " Dust", true),
+ DUSTIMPURE("dustImpure", "Impure ", " Dust", true),
+ DUSTPURE("dustPure", "Purified ", " Dust", true),
+ CRUSHED("crushed", "Crushed ", " Ore", true),
+ CRUSHEDCENTRIFUGED("crushedCentrifuged", "Centrifuged Crushed "," Ore", true),
+ CRUSHEDPURIFIED("crushedPurified", "Purified Crushed ", " Ore", true);
private String COMPONENT_NAME;
private String PREFIX;
private String DISPLAY_NAME;
- private String OREDICT_NAME;
private boolean HAS_OVERLAY;
- private ComponentTypes (final String LocalName, final String prefix, final String DisplayName, final String OreDictName, final boolean overlay){
+ private ComponentTypes (final String LocalName, final String prefix, final String DisplayName, final boolean overlay){
this.COMPONENT_NAME = LocalName;
this.PREFIX = prefix;
this.DISPLAY_NAME = DisplayName;
- this.OREDICT_NAME = OreDictName;
this.HAS_OVERLAY = overlay;
// dust + Dirty, Impure, Pure, Refined
// crushed + centrifuged, purified
@@ -183,14 +184,13 @@ public class BaseOreComponent extends Item{
return this.DISPLAY_NAME;
}
- public String getOreDictName(){
- return this.OREDICT_NAME;
- }
-
public boolean hasOverlay(){
return this.HAS_OVERLAY;
}
-
+
+ public String getPrefix(){
+ return this.PREFIX;
+ }
}
}
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index 1ebd335031..796d48b967 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -68,7 +68,7 @@ public class Material {
this (materialName, defaultState, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks);
}
- public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, int j, int k, int l, int m, MaterialStack[] materialStacks){
+ public Material(String materialName, MaterialState defaultState, short[] rgba, int j, int k, int l, int m, int radiationLevel, MaterialStack[] materialStacks){
this (materialName, defaultState, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks);
}
@@ -219,13 +219,15 @@ public class Material {
}
//Sets the Rad level
- if (radiationLevel != 0){
+ if (radiationLevel > 0){
+ Logger.MATERIALS(this.getLocalizedName()+" is radioactive. Level: "+radiationLevel+".");
this.isRadioactive = true;
this.vRadiationLevel = (byte) radiationLevel;
}
else {
+ Logger.MATERIALS(this.getLocalizedName()+" is not radioactive.");
this.isRadioactive = false;
- this.vRadiationLevel = (byte) radiationLevel;
+ this.vRadiationLevel = 0;
}
//Sets the materials 'tier'. Will probably replace this logic.
@@ -457,6 +459,30 @@ public class Material {
public final ItemStack getNugget(final int stacksize){
return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+this.unlocalizedName, stacksize);
}
+
+ /**
+ * Ore Components
+ * @return
+ */
+
+ public final ItemStack getOre(final int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("block"+this.unlocalizedName+"Ore", stacksize);
+ }
+ public final ItemStack getCrushed(final int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("crushed"+this.unlocalizedName, stacksize);
+ }
+ public final ItemStack getCrushedPurified(final int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("crushedPurified"+this.unlocalizedName, stacksize);
+ }
+ public final ItemStack getCrushedCentrifuged(final int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("crushedCentrifuged"+this.unlocalizedName, stacksize);
+ }
+ public final ItemStack getDustPurified(final int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustPure"+this.unlocalizedName, stacksize);
+ }
+ public final ItemStack getDustImpure(final int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustImpure"+this.unlocalizedName, stacksize);
+ }
final public ItemStack[] getMaterialComposites(){
if (this.vMaterialInput != null){
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
index e421fd2601..e8d37a34d2 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
@@ -114,6 +114,37 @@ public class RECIPES_Old_Circuits implements IOreRecipeRegistrator {
ItemList.Circuit_Elite.set(GregtechItemList.Old_Circuit_Elite.get(1));
ItemList.Circuit_Master.set(GregtechItemList.Old_Circuit_Master.get(1));
ItemList.Circuit_Ultimate.set(GregtechItemList.Old_Circuit_Ultimate.get(1));
+
+ /**
+ * Try Set New circuits to have old replacements
+ */
+
+ //Basic
+ ItemList.Circuit_Microprocessor.set(GregtechItemList.Old_Circuit_Basic.get(1));
+ //Good
+ ItemList.Circuit_Integrated.set(GregtechItemList.Old_Circuit_Good.get(1));
+ //Advanced
+ ItemList.Circuit_Nanoprocessor.set(GregtechItemList.Old_Circuit_Advanced.get(1));
+ //Data
+ ItemList.Circuit_Quantumprocessor.set(GregtechItemList.Old_Circuit_Data.get(1));
+ ItemList.Circuit_Nanocomputer.set(GregtechItemList.Old_Circuit_Data.get(1));
+ //Elite
+ ItemList.Circuit_Crystalprocessor.set(GregtechItemList.Old_Circuit_Elite.get(1));
+ ItemList.Circuit_Quantumcomputer.set(GregtechItemList.Old_Circuit_Elite.get(1));
+ ItemList.Circuit_Elitenanocomputer.set(GregtechItemList.Old_Circuit_Elite.get(1));
+ //Master
+ ItemList.Circuit_Neuroprocessor.set(GregtechItemList.Old_Circuit_Master.get(1));
+ ItemList.Circuit_Masterquantumcomputer.set(GregtechItemList.Old_Circuit_Master.get(1));
+ //Ultimate
+ ItemList.Circuit_Wetwarecomputer.set(GregtechItemList.Old_Circuit_Ultimate.get(1));
+ ItemList.Circuit_Ultimatecrystalcomputer.set(GregtechItemList.Old_Circuit_Ultimate.get(1));
+ ItemList.Circuit_Quantummainframe.set(GregtechItemList.Old_Circuit_Ultimate.get(1));
+ //Superconductor
+ ItemList.Circuit_Wetwaresupercomputer.set(GregtechItemList.Circuit_IV.get(1));
+ ItemList.Circuit_Crystalmainframe.set(GregtechItemList.Circuit_IV.get(1));
+ //Infinite
+ ItemList.Circuit_Wetwaremainframe.set(GregtechItemList.Circuit_LuV.get(1));
+
//set data orbs and sticks to their new replacements
ItemList.Tool_DataStick.set(GregtechItemList.Old_Tool_DataStick.get(1));
diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
index 098cb3e953..be75de893a 100644
--- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
@@ -690,6 +690,19 @@ public class ItemUtils {
//Utils.LOG_INFO("[Component Maker] Found "+mItemName+".");
return (gregstack);
}
+
+
+ public static ItemStack getOrePrefixStack(OrePrefixes mPrefix, Material mMat, int mAmount) {
+
+ String mName = Utils.sanitizeString(mMat.getLocalizedName());
+
+ String mItemName = mPrefix.name()+mName;
+ ItemStack gregstack = ItemUtils.getItemStackOfAmountFromOreDict(mItemName, mAmount);
+ if (gregstack == null){
+ return null;
+ }
+ return (gregstack);
+ }
public static ItemStack[] getStackOfAllOreDictGroup(String oredictname){
final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictname);