aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDream-Master <dream-master@gmx.net>2016-09-28 23:31:49 +0200
committerDream-Master <dream-master@gmx.net>2016-09-28 23:31:49 +0200
commitd61b120ce40be4601168084216ef641934c3ca01 (patch)
treec7b4579317f0628b4ee5f5b7060b3ee9a9627f37 /src
parentaad7dba1e59db2d9e4e55585d51d2013162d71ba (diff)
downloadGT5-Unofficial-d61b120ce40be4601168084216ef641934c3ca01.tar.gz
GT5-Unofficial-d61b120ce40be4601168084216ef641934c3ca01.tar.bz2
GT5-Unofficial-d61b120ce40be4601168084216ef641934c3ca01.zip
Adding UBC Support from Blood asps code
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores.java7
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java62
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java4
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java4
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java6
5 files changed, 27 insertions, 56 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
index b7585f17b7..530a67ddac 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
@@ -13,7 +13,7 @@ import net.minecraft.init.Blocks;
public class GT_Block_Ores extends GT_Block_Ores_Abstract {
public GT_Block_Ores() {
- super("gt.blockores", false, Material.rock);
+ super("gt.blockores", 7, false, Material.rock);
}
@Override
@@ -37,11 +37,6 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
}
@Override
- public int getHarvestLevel(int aMeta) {
- return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8;
- }
-
- @Override
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)};
}
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java
index e69404f217..d0eaaae08d 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java
@@ -36,64 +36,34 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
public static boolean FUCKING_LOCK = false;
public static boolean tHideOres;
+ public static int tOreMetaCount;
private final String aTextName = ".name";
private final String aTextSmall = "Small ";
- private final String aTextDot = ".";
- private final String aTextNothing = "";
- protected GT_Block_Ores_Abstract(String aUnlocalizedName, boolean aHideFirstMeta, Material aMaterial) {
+ protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) {
super(GT_Item_Ores.class, aUnlocalizedName, aMaterial);
this.isBlockContainer = true;
setStepSound(soundTypeStone);
setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres;
+ tOreMetaCount = aOreMetaCount;
+ if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;
+
for (int i = 0; i < 16; i++) {
GT_ModHandler.addValuableOre(this, i, 1);
}
for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) {
if (GregTech_API.sGeneratedMaterials[i] != null) {
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + i + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 1000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 2000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 3000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 4000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 5000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 6000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 7000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 16000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 17000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 18000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 19000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 20000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 21000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 22000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 23000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[0] != null ? this.getProcessingPrefix()[0].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[1] != null ? this.getProcessingPrefix()[1].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 1000));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[2] != null ? this.getProcessingPrefix()[2].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 2000));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[3] != null ? this.getProcessingPrefix()[3].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 3000));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[4] != null ? this.getProcessingPrefix()[4].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 4000));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[5] != null ? this.getProcessingPrefix()[5].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 5000));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[6] != null ? this.getProcessingPrefix()[6].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 6000));
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[7] != null ? this.getProcessingPrefix()[7].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 7000));
- if (tHideOres) {
- if (aHideFirstMeta) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000));
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000));
+ for (int j = 0; j < aOreMetaCount; j++) {
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
+ if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
+ GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000)));
+ if (tHideOres) {
+ if(!(j == 0 && !aHideFirstMeta)){
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000)));}
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000)));
+ }
}
}
}
@@ -166,7 +136,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
}
public int getHarvestLevel(int aMeta) {
- return 2;
+ return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8;
}
public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java
index f1b00558a4..ac17e65b93 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java
@@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.init.Blocks;
public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "igneousStone");
public GT_Block_Ores_UB1() {
- super("gt.blockores.ub1", true, Material.rock);
+ super("gt.blockores.ub1", 8, true, Material.rock);
+ if (aUBBlock == null) aUBBlock = Blocks.stone;
}
@Override
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java
index 7b2ff5cd4b..e4caa95db7 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java
@@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.init.Blocks;
public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "metamorphicStone");
public GT_Block_Ores_UB2() {
- super("gt.blockores.ub2", true, Material.rock);
+ super("gt.blockores.ub2", 8, true, Material.rock);
+ if (aUBBlock == null) aUBBlock = Blocks.stone;
}
@Override
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java
index b2dc7d9238..85721556a3 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java
@@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.init.Blocks;
public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "sedimentaryStone");
public GT_Block_Ores_UB3() {
- super("gt.blockores.ub3", true, Material.rock);
+ super("gt.blockores.ub3", 8, true, Material.rock);
+ if (aUBBlock == null) aUBBlock = Blocks.stone;
}
@Override
@@ -40,4 +42,4 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)};
}
-} \ No newline at end of file
+}