Initial
This is more of a test and resource for when I eventually rewrite the GT5U ore texture/metadata system.
This commit is contained in:
parent
be3a6292bb
commit
51e269e3f5
10 changed files with 92 additions and 6 deletions
|
@ -176,7 +176,7 @@ public class GregTech_API {
|
|||
*/
|
||||
public static Block sBlockMachines;
|
||||
public static Block sBlockOres1, sBlockGem, sBlockMetal1, sBlockMetal2, sBlockMetal3, sBlockMetal4, sBlockMetal5, sBlockMetal6, sBlockMetal7, sBlockMetal8, sBlockGem1, sBlockGem2, sBlockGem3, sBlockReinforced;
|
||||
public static Block sBlockGranites, sBlockConcretes;
|
||||
public static Block sBlockGranites, sBlockConcretes, sBlockStones;
|
||||
public static Block sBlockCasings1, sBlockCasings2, sBlockCasings3, sBlockCasings4;
|
||||
/**
|
||||
* Getting assigned by the Config
|
||||
|
|
|
@ -24,6 +24,7 @@ public enum OrePrefixes {
|
|||
@Deprecated itemDust("Dusts", "", "", false, false, false, false, false, false, false, false, false, false, B[0] | B[1] | B[2] | B[3], -1, 64, -1),
|
||||
oreBlackgranite("Black Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
|
||||
oreRedgranite("Red Granite Ores", "Granite ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
|
||||
oreMarble("Marble Ores", "Marble ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // In case of an End-Ores Mod. Ore -> Material is a Oneway Operation!
|
||||
oreNetherrack("Netherrack Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
|
||||
oreNether("Nether Ores", "Nether ", " Ore", true, true, false, false, false, true, false, false, false, true, B[3], -1, 64, -1), // Prefix of the Nether-Ores Mod. Causes Ores to double. Ore -> Material is a Oneway Operation!
|
||||
@Deprecated denseore("Dense Ores", "", "", false, false, false, false, false, true, false, false, false, true, B[3], -1, 64, -1),
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -91,6 +91,7 @@ public class GT_Worldgen_GT_Ore_Layer
|
|||
if (GT_Values.D1) {
|
||||
System.out.println("Generated Orevein: " + this.mWorldGenName);
|
||||
}
|
||||
System.out.println("######META: " + this.mPrimaryMeta);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,27 +53,40 @@ public class GT_Block_Ores
|
|||
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]));
|
||||
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 5000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||
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]));
|
||||
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 21000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||
//GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 30000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||
//GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 50000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
|
||||
|
||||
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));
|
||||
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));
|
||||
GT_OreDictUnificator.registerOre("oreIgneousStone", new ItemStack(this, 1, i + 21000));
|
||||
//GT_OreDictUnificator.registerOre("oreMetamorphicStone", new ItemStack(this, 1, i + 40000));
|
||||
//GT_OreDictUnificator.registerOre("oreSedimentaryStone", new ItemStack(this, 1, i + 50000));
|
||||
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));
|
||||
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000));
|
||||
//codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 40000));
|
||||
//codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 50000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -251,11 +264,15 @@ public class GT_Block_Ores
|
|||
aList.add(new ItemStack(aItem, 1, i + 2000));
|
||||
aList.add(new ItemStack(aItem, 1, i + 3000));
|
||||
aList.add(new ItemStack(aItem, 1, i + 4000));
|
||||
aList.add(new ItemStack(aItem, 1, i + 5000));
|
||||
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));
|
||||
aList.add(new ItemStack(aItem, 1, i + 21000));
|
||||
//aList.add(new ItemStack(aItem, 1, i + 40000));
|
||||
//aList.add(new ItemStack(aItem, 1, i + 50000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
42
src/main/java/gregtech/common/blocks/GT_Block_Stones.java
Normal file
42
src/main/java/gregtech/common/blocks/GT_Block_Stones.java
Normal file
|
@ -0,0 +1,42 @@
|
|||
package gregtech.common.blocks;
|
||||
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.OrePrefixes;
|
||||
import gregtech.api.util.GT_LanguageManager;
|
||||
import gregtech.api.util.GT_OreDictUnificator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GT_Block_Stones extends GT_Block_Stones_Abstract {
|
||||
public GT_Block_Stones() {
|
||||
super(GT_Item_Granites.class, "gt.blockstones");
|
||||
setResistance(60.0F);
|
||||
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Marble");
|
||||
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Stone, new ItemStack(this, 1, 0));
|
||||
}
|
||||
|
||||
public int getHarvestLevel(int aMeta) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
|
||||
return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F;
|
||||
}
|
||||
|
||||
public IIcon getIcon(int aSide, int aMeta) {
|
||||
//if ((aMeta >= 0) && (aMeta < 16)) {
|
||||
if (aMeta == 0) {
|
||||
return gregtech.api.enums.Textures.BlockIcons.STONES[aMeta].getIcon();
|
||||
}
|
||||
return gregtech.api.enums.Textures.BlockIcons.STONES[0].getIcon();
|
||||
}
|
||||
|
||||
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
|
||||
return !(entity instanceof EntityWither);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package gregtech.common.blocks;
|
||||
|
||||
import exterminatorJeff.undergroundBiomes.common.UndergroundBiomes;
|
||||
import exterminatorJeff.undergroundBiomes.common.block.BlockMetadataBase;
|
||||
import gregtech.GT_Mod;
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
|
@ -26,7 +28,8 @@ import java.util.Random;
|
|||
public class GT_TileEntity_Ores
|
||||
extends TileEntity
|
||||
implements ITexturedTileEntity {
|
||||
private static final 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)};
|
||||
//private static final 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), 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(UndergroundBiomes.igneousStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 7), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 8), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 8)};
|
||||
private static final ITexture[] mStoneTextures = {new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), 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.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 7), new GT_CopiedBlockTexture(UndergroundBiomes.igneousStone, 0, 8), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)};
|
||||
public short mMetaData = 0;
|
||||
public boolean mNatural = false;
|
||||
public boolean mBlocked = true;
|
||||
|
@ -64,6 +67,15 @@ public class GT_TileEntity_Ores
|
|||
} else {
|
||||
aMetaData += 3000;
|
||||
}
|
||||
} else if (tBlock instanceof BlockMetadataBase) { //TODO Implement config option
|
||||
int aMeta = aWorld.getBlockMetadata(aX, aY, aZ);
|
||||
if(tBlock == UndergroundBiomes.igneousStone) {
|
||||
aMetaData += (21000 + (aMeta * 1000));
|
||||
} /*else if(tBlock == UndergroundBiomes.metamorphicStone && tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, UndergroundBiomes.metamorphicStone)) {
|
||||
//aMetaData += (40000 + (aMeta * 1000));
|
||||
} else if(tBlock == UndergroundBiomes.sedimentaryStone && tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, UndergroundBiomes.sedimentaryStone)) {
|
||||
//aMetaData += (50000 + (aMeta * 1000));
|
||||
}*/
|
||||
} else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -122,6 +134,12 @@ public class GT_TileEntity_Ores
|
|||
} else {
|
||||
this.mMetaData = ((short) (this.mMetaData + 3000));
|
||||
}
|
||||
} else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) {
|
||||
if (aOverridingStoneBlock == GregTech_API.sBlockStones) {
|
||||
if (aOverridingStoneMeta == 0) {
|
||||
this.mMetaData = ((short) (this.mMetaData + 5000));
|
||||
}
|
||||
}
|
||||
}
|
||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
|
||||
}
|
||||
|
@ -225,8 +243,9 @@ public class GT_TileEntity_Ores
|
|||
|
||||
public ITexture[] getTexture(byte aSide) {
|
||||
Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)];
|
||||
if ((aMaterial != null) && (this.mMetaData < 32000)) {
|
||||
return new ITexture[]{mStoneTextures[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
|
||||
if ((aMaterial != null) && (this.mMetaData < 32767)) {
|
||||
System.out.println((this.mMetaData / 1000 % 31));
|
||||
return new ITexture[]{mStoneTextures[(this.mMetaData / 1000 % 31)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[!(this.mMetaData >=16000 && this.mMetaData <=20999) ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
|
||||
}
|
||||
return new ITexture[]{mStoneTextures[0], new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])};
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ public class GT_Worldgenloader
|
|||
new GT_Worldgen_Stone("nether.stone.redgranite.large", false, GregTech_API.sBlockGranites, 8, -1, 1, 300, 192, 0, 120, null, false);
|
||||
new GT_Worldgen_Stone("nether.stone.redgranite.huge", false, GregTech_API.sBlockGranites, 8, -1, 1, 400, 240, 0, 120, null, false);
|
||||
|
||||
new GT_Worldgen_Stone("overworld.stone.marble.huge", true, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false);
|
||||
|
||||
new GT_Worldgen_GT_Ore_SmallPieces("ore.small.copper", true, 60, 120, 32, !tPFAA, true, true, Materials.Copper);
|
||||
new GT_Worldgen_GT_Ore_SmallPieces("ore.small.tin", true, 60, 120, 32, !tPFAA, true, true, Materials.Tin);
|
||||
new GT_Worldgen_GT_Ore_SmallPieces("ore.small.bismuth", true, 80, 120, 8, !tPFAA, true, false, Materials.Bismuth);
|
||||
|
|
|
@ -135,6 +135,7 @@ public class GT_Loader_Item_Block_And_Fluid
|
|||
GregTech_API.sBlockCasings4 = new GT_Block_Casings4();
|
||||
GregTech_API.sBlockGranites = new GT_Block_Granites();
|
||||
GregTech_API.sBlockConcretes = new GT_Block_Concretes();
|
||||
GregTech_API.sBlockStones = new GT_Block_Stones();
|
||||
GregTech_API.sBlockOres1 = new GT_Block_Ores();
|
||||
GregTech_API.sBlockMetal1 = new GT_Block_Metal("gt.blockmetal1", new Materials[]{
|
||||
Materials.Adamantium,
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 350 B |
Loading…
Reference in a new issue