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.java5
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java73
6 files changed, 104 insertions, 14 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index b9b204cc3b..54236365f2 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -6,6 +6,7 @@ import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.GTplusplus_Secondary;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.common.compat.COMPAT_Baubles;
import gtPlusPlus.core.creative.AddToCreativeTab;
@@ -500,6 +501,10 @@ public final class ModItems {
//Must be the final Alloy to Generate
MaterialGenerator.generate(ALLOY.QUANTUM);
+
+
+ //Ores
+ GTplusplus_Secondary.GenerateOreMaterials();
} catch (final Throwable r){
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java
new file mode 100644
index 0000000000..73a13f568d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemCentrifugedCrushedOre.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.core.item.base.ore;
+
+import gtPlusPlus.core.material.Material;
+
+public class BaseItemCentrifugedCrushedOre extends BaseOreComponent{
+
+ public BaseItemCentrifugedCrushedOre(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.CRUSHEDCENTRIFUGED);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java
new file mode 100644
index 0000000000..45dc4f4402
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemImpureDust.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.core.item.base.ore;
+
+import gtPlusPlus.core.material.Material;
+
+public class BaseItemImpureDust extends BaseOreComponent{
+
+ public BaseItemImpureDust(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.DUSTIMPURE);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java
new file mode 100644
index 0000000000..3f2a1c23e6
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedCrushedOre.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.core.item.base.ore;
+
+import gtPlusPlus.core.material.Material;
+
+public class BaseItemPurifiedCrushedOre extends BaseOreComponent{
+
+ public BaseItemPurifiedCrushedOre(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.CRUSHEDPURIFIED);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java
new file mode 100644
index 0000000000..0c9816fb56
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseItemPurifiedDust.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.core.item.base.ore;
+
+import gtPlusPlus.core.material.Material;
+
+public class BaseItemPurifiedDust extends BaseOreComponent{
+
+ public BaseItemPurifiedDust(final Material material) {
+ super(material, BaseOreComponent.ComponentTypes.DUSTPURE);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
index d06f1c912a..7812b14e1d 100644
--- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java
@@ -3,6 +3,8 @@ package gtPlusPlus.core.item.base.ore;
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.util.GT_OreDictUnificator;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
@@ -11,14 +13,21 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.item.ItemUtils;
+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.IIcon;
import net.minecraft.world.World;
public class BaseOreComponent extends Item{
+ @SideOnly(Side.CLIENT)
+ private IIcon base;
+ @SideOnly(Side.CLIENT)
+ private IIcon overlay;
+
public final Material componentMaterial;
public final String materialName;
public final String unlocalName;
@@ -28,7 +37,7 @@ public class BaseOreComponent extends Item{
public BaseOreComponent(final Material material, final ComponentTypes componentType) {
this.componentMaterial = material;
- this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName();
+ this.unlocalName = componentType.COMPONENT_NAME+material.getUnlocalizedName();
this.materialName = material.getLocalizedName();
this.componentType = componentType;
this.setCreativeTab(AddToCreativeTab.tabMisc);
@@ -44,15 +53,15 @@ public class BaseOreComponent 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";
}*/
-
- return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME.toLowerCase();
+
+ return "gregtech" + ":" + "materialicons/METALLIC/" + this.componentType.COMPONENT_NAME;
}
@Override
@@ -107,29 +116,61 @@ public class BaseOreComponent extends Item{
+ /**
+ * Rendering Related
+ * @author Alkalus
+ *
+ */
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses(){
+ if (this.componentType.hasOverlay()){
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(final IIconRegister par1IconRegister){
+ if (CORE.ConfigSwitches.useGregtechTextures){
+ this.base = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell");
+ if (this.componentType.hasOverlay()){
+ this.overlay = par1IconRegister.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell_OVERLAY");
+ }
+ }
+ else {
+ this.base = par1IconRegister.registerIcon(CORE.MODID + ":" + "item"+this.componentType.getComponent());
+ if (this.componentType.hasOverlay()){
+ this.overlay = par1IconRegister.registerIcon(CORE.MODID + ":" + "item"+this.componentType.getComponent()+"_Overlay");
+ }
+ }
+ }
-
public static enum ComponentTypes {
- DUST("Dust", " Dust", "dust"),
- DUSTDIRTY("Ingot", " Ingot", "ingot"),
- DUSTIMPURE("Ingot", " Ingot", "ingot"),
- DUSTPURE("Ingot", " Ingot", "ingot"),
- DUSTREFINED("Ingot", " Ingot", "ingot"),
- CRUSHED("Ingot", " Ingot", "ingot"),
- CRUSHEDCENTRIFUGED("Ingot", " Ingot", "ingot"),
- CRUSHEDPURIFIED("Ingot", " Ingot", "ingot");
+ 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);
private String COMPONENT_NAME;
+ private String PREFIX;
private String DISPLAY_NAME;
private String OREDICT_NAME;
- private ComponentTypes (final String LocalName, final String DisplayName, final String OreDictName){
+ private boolean HAS_OVERLAY;
+ private ComponentTypes (final String LocalName, final String prefix, final String DisplayName, final String OreDictName, 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
}
@@ -146,6 +187,10 @@ public class BaseOreComponent extends Item{
return this.OREDICT_NAME;
}
+ public boolean hasOverlay(){
+ return this.HAS_OVERLAY;
+ }
+
}
}