2015-10-21 20:47:13 -04:00
|
|
|
package gregtech.common.blocks;
|
|
|
|
|
|
|
|
import gregtech.api.GregTech_API;
|
|
|
|
import gregtech.api.enums.Materials;
|
|
|
|
import gregtech.api.enums.OrePrefixes;
|
2016-07-18 19:00:53 +01:00
|
|
|
import gregtech.api.enums.Textures;
|
|
|
|
import gregtech.api.interfaces.ITexture;
|
|
|
|
import gregtech.api.objects.GT_CopiedBlockTexture;
|
|
|
|
import gregtech.api.objects.GT_RenderedTexture;
|
2015-10-21 20:47:13 -04:00
|
|
|
import gregtech.api.util.GT_LanguageManager;
|
|
|
|
import gregtech.api.util.GT_ModHandler;
|
|
|
|
import gregtech.api.util.GT_OreDictUnificator;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
2015-10-21 22:06:25 -04:00
|
|
|
import java.util.List;
|
|
|
|
|
2016-07-18 19:00:53 +01:00
|
|
|
public class GT_Block_Ores extends GT_Block_Ores_Abstract {
|
2015-10-21 22:06:25 -04:00
|
|
|
public GT_Block_Ores() {
|
2016-07-18 19:00:53 +01:00
|
|
|
super("gt.blockores", Material.rock);
|
2015-10-21 22:06:25 -04:00
|
|
|
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() + "." + i + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 1000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 2000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 3000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 4000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
2016-07-16 23:48:25 +01:00
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 5000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
2015-10-21 22:06:25 -04:00
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 16000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 17000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 18000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 19000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
|
|
|
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 20000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
2016-07-16 23:48:25 +01:00
|
|
|
|
2015-10-21 22:06:25 -04:00
|
|
|
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
|
|
|
|
GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i));
|
|
|
|
GT_OreDictUnificator.registerOre(OrePrefixes.oreNetherrack.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000));
|
|
|
|
GT_OreDictUnificator.registerOre(OrePrefixes.oreEndstone.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000));
|
|
|
|
GT_OreDictUnificator.registerOre(OrePrefixes.oreBlackgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000));
|
2016-07-16 23:48:25 +01:00
|
|
|
GT_OreDictUnificator.registerOre(OrePrefixes.oreRedgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000));
|
|
|
|
GT_OreDictUnificator.registerOre(OrePrefixes.oreMarble.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 5000));
|
2016-07-18 19:00:53 +01:00
|
|
|
if (tHideOres) {
|
|
|
|
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 + 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));
|
|
|
|
}
|
2016-03-20 16:47:17 +01:00
|
|
|
}
|
2015-10-21 22:06:25 -04:00
|
|
|
}
|
|
|
|
}
|
2015-10-21 20:47:13 -04:00
|
|
|
}
|
2015-10-21 22:06:25 -04:00
|
|
|
|
2016-07-18 19:00:53 +01:00
|
|
|
@Override
|
2015-10-21 22:06:25 -04:00
|
|
|
public String getUnlocalizedName() {
|
|
|
|
return "gt.blockores";
|
|
|
|
}
|
|
|
|
|
2016-07-18 19:00:53 +01:00
|
|
|
@Override
|
|
|
|
public ITexture[] getStoneTexture(byte aSide, int aMetaData, Materials aMaterial) {
|
|
|
|
ITexture[] mStoneTextures = {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_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), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)};
|
|
|
|
return new ITexture[]{mStoneTextures[(aMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[aMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
|
2015-10-21 22:06:25 -04:00
|
|
|
}
|
|
|
|
|
2016-07-18 19:00:53 +01:00
|
|
|
@Override
|
2015-10-21 22:06:25 -04:00
|
|
|
public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
|
|
|
|
for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
|
|
|
|
Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
|
|
|
|
if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)) {
|
|
|
|
aList.add(new ItemStack(aItem, 1, i));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 1000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 2000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 3000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 4000));
|
2016-07-16 23:48:25 +01:00
|
|
|
aList.add(new ItemStack(aItem, 1, i + 5000));
|
2015-10-21 22:06:25 -04:00
|
|
|
aList.add(new ItemStack(aItem, 1, i + 16000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 17000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 18000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 19000));
|
|
|
|
aList.add(new ItemStack(aItem, 1, i + 20000));
|
|
|
|
}
|
|
|
|
}
|
2015-10-21 20:47:13 -04:00
|
|
|
}
|
2016-07-18 19:00:53 +01:00
|
|
|
}
|