Ore System Rewrite part 2

Lots of ore system changes
Added Marble/Basalt gen
Ore Mixes can now have a specified biome name that they can only spawn
in
This commit is contained in:
Muramasa 2016-07-21 07:24:42 +01:00
parent de6e90a000
commit 248ce596a5
17 changed files with 295 additions and 207 deletions

View file

@ -25,6 +25,7 @@ public enum OrePrefixes {
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!
oreBasalt("Basalt Ores", "Basalt ", " 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

View file

@ -1,10 +1,11 @@
package gregtech.api.interfaces.tileentity;
import gregtech.api.interfaces.ITexture;
import net.minecraft.block.Block;
public interface ITexturedTileEntity {
/**
* @return the Textures rendered by the GT Rendering
*/
public ITexture[] getTexture(byte aSide);
public ITexture[] getTexture(Block aBlock, byte aSide);
}

View file

@ -9,6 +9,7 @@ import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
import gregtech.api.net.GT_Packet_TileEntity;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.*;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -705,7 +706,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE
}
@Override
public ITexture[] getTexture(byte aSide) {
public ITexture[] getTexture(Block aBlock, byte aSide) {
ITexture rIcon = getCoverTexture(aSide);
if (rIcon != null) return new ITexture[]{rIcon};
return getTextureUncovered(aSide);

View file

@ -1001,7 +1001,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
@Override
public ITexture[] getTexture(byte aSide) {
public ITexture[] getTexture(Block aBlock, byte aSide) {
ITexture rIcon = getCoverTexture(aSide);
if (rIcon != null) return new ITexture[]{rIcon};
if (hasValidMetaTileEntity())

View file

@ -80,6 +80,18 @@ public class GT_Config implements Runnable {
return rResult;
}
public String get(Object aCategory, ItemStack aStack, String aDefault) {
return get(aCategory, getStackConfigName(aStack), aDefault);
}
public String get(Object aCategory, String aName, String aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
Property tProperty = mConfig.get(aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
String rResult = tProperty.getString();
if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save();
return rResult;
}
@Override
public void run() {
mConfig.save();

View file

@ -25,6 +25,7 @@ public class GT_Worldgen_GT_Ore_Layer
public final short mSecondaryMeta;
public final short mBetweenMeta;
public final short mSporadicMeta;
public final String mBiome;
public final boolean mOverworld;
public final boolean mNether;
public final boolean mEnd;
@ -45,6 +46,7 @@ public class GT_Worldgen_GT_Ore_Layer
this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
this.mBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "BiomeName", "None");
if (this.mEnabled) {
GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
@ -55,6 +57,9 @@ public class GT_Worldgen_GT_Ore_Layer
}
public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
if (!this.mBiome.equals("None") && (this.mBiome.equals(aBiome))) {
return false;
}
if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) {
return false;
}

View file

@ -2,6 +2,7 @@ package gregtech.common;
import gregtech.api.GregTech_API;
import gregtech.api.world.GT_Worldgen_Ore;
import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.blocks.GT_TileEntity_Ores;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@ -56,9 +57,12 @@ public class GT_Worldgen_Stone
double var45 = (eZ + 0.5D - var24) / (var28 / 2.0D);
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D) {
Block tTargetedBlock = aWorld.getBlock(eX, eY, eZ);
if (tTargetedBlock == GregTech_API.sBlockOres1) {
if (tTargetedBlock instanceof GT_Block_Ores_Abstract) {
TileEntity tTileEntity = aWorld.getTileEntity(eX, eY, eZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
if(tTargetedBlock != GregTech_API.sBlockOres1) {
tTileEntity = ((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, (GT_TileEntity_Ores)tTileEntity, eX, eY, eZ);
}
((GT_TileEntity_Ores) tTileEntity).overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta);
}
} else if (((this.mAllowToGenerateinVoid) && (aWorld.getBlock(eX, eY, eZ).isAir(aWorld, eX, eY, eZ))) || ((tTargetedBlock != null) && ((tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.end_stone)) || (tTargetedBlock.isReplaceableOreGen(aWorld, eX, eY, eZ, Blocks.netherrack))))) {

View file

@ -3,19 +3,17 @@ package gregtech.common.blocks;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
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;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class GT_Block_Ores extends GT_Block_Ores_Abstract {
@ -32,6 +30,7 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
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 + 6000) + ".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]));
@ -45,12 +44,14 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
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(OrePrefixes.oreBasalt.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 6000));
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 + 6000));
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));
@ -68,9 +69,12 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
}
@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)};
public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
return ((GT_TileEntity_Ores) tTileEntity).getDrops(GregTech_API.sBlockOres1, aFortune);
}
return mTemporaryTileEntity.get() == null ? new ArrayList() : mTemporaryTileEntity.get().getDrops(GregTech_API.sBlockOres1, aFortune);
}
@Override
@ -84,6 +88,7 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
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 + 6000));
aList.add(new ItemStack(aItem, 1, i + 16000));
aList.add(new ItemStack(aItem, 1, i + 17000));
aList.add(new ItemStack(aItem, 1, i + 18000));

View file

@ -7,7 +7,6 @@ import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.items.GT_Generic_Block;
import gregtech.common.render.GT_Renderer_Block;
import net.minecraft.block.Block;
@ -189,13 +188,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
aWorld.removeTileEntity(aX, aY, aZ);
}
public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
return ((GT_TileEntity_Ores) tTileEntity).getDrops(aFortune);
}
return mTemporaryTileEntity.get() == null ? new ArrayList() : mTemporaryTileEntity.get().getDrops(aFortune);
}
public abstract ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune);
public TileEntity createTileEntity(World aWorld, int aMeta) {
return new GT_TileEntity_Ores();
@ -203,6 +196,4 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
@SideOnly(Side.CLIENT)
public abstract void getSubBlocks(Item aItem, CreativeTabs aTab, List aList);
public abstract ITexture[] getStoneTexture(byte aSide, int aMetaData, Materials aMaterial);
}

View file

@ -2,13 +2,8 @@ package gregtech.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import exterminatorJeff.undergroundBiomes.common.UndergroundBiomes;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
@ -16,7 +11,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
@ -35,14 +33,14 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 5000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 6000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 7000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 8000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 9000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 10000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 11000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 12000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 13000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 14000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 15000) + ".name", "Small " + 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", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 22000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 23000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 1000));
@ -52,14 +50,14 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 5000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 6000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 7000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 8000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 9000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 10000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 11000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 12000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 13000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 14000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 15000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 16000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 17000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 18000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 19000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 20000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 21000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 22000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 23000));
if (tHideOres) {
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000));
@ -69,14 +67,14 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
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 + 8000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 9000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 10000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 11000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 12000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 13000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 14000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 15000));
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));
}
}
}
@ -89,9 +87,12 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
}
@Override
public ITexture[] getStoneTexture(byte aSide, int aMetaData, Materials aMaterial) {
ITexture[] mStoneTextures = {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, 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)};
return new ITexture[]{mStoneTextures[(aMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[aMetaData < 8000 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
return ((GT_TileEntity_Ores) tTileEntity).getDrops(GregTech_API.sBlockOresUb1, aFortune);
}
return mTemporaryTileEntity.get() == null ? new ArrayList() : mTemporaryTileEntity.get().getDrops(GregTech_API.sBlockOresUb1, aFortune);
}
@SideOnly(Side.CLIENT)
@ -107,14 +108,14 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
aList.add(new ItemStack(aItem, 1, i + 5000));
aList.add(new ItemStack(aItem, 1, i + 6000));
aList.add(new ItemStack(aItem, 1, i + 7000));
aList.add(new ItemStack(aItem, 1, i + 8000));
aList.add(new ItemStack(aItem, 1, i + 9000));
aList.add(new ItemStack(aItem, 1, i + 10000));
aList.add(new ItemStack(aItem, 1, i + 11000));
aList.add(new ItemStack(aItem, 1, i + 12000));
aList.add(new ItemStack(aItem, 1, i + 13000));
aList.add(new ItemStack(aItem, 1, i + 14000));
aList.add(new ItemStack(aItem, 1, i + 15000));
aList.add(new ItemStack(aItem, 1, i + 16000));
aList.add(new ItemStack(aItem, 1, i + 1700));
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 + 22000));
aList.add(new ItemStack(aItem, 1, i + 23000));
}
}
}

View file

@ -2,13 +2,8 @@ package gregtech.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import exterminatorJeff.undergroundBiomes.common.UndergroundBiomes;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
@ -16,7 +11,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
@ -35,14 +33,14 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 5000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 6000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 7000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 8000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 9000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 10000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 11000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 12000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 13000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 14000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 15000) + ".name", "Small " + 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", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 22000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 23000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 1000));
@ -52,14 +50,14 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 5000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 6000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 7000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 8000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 9000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 10000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 11000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 12000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 13000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 14000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 15000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 16000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 1700));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 18000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 19000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 20000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 21000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 22000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 23000));
if (tHideOres) {
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000));
@ -69,14 +67,14 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
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 + 8000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 9000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 10000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 11000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 12000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 13000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 14000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 15000));
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));
}
}
}
@ -89,9 +87,12 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
}
@Override
public ITexture[] getStoneTexture(byte aSide, int aMetaData, Materials aMaterial) {
ITexture[] mStoneTextures = {new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 7), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 7)};
return new ITexture[]{mStoneTextures[(aMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[aMetaData < 8000 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
return ((GT_TileEntity_Ores) tTileEntity).getDrops(GregTech_API.sBlockOresUb2, aFortune);
}
return mTemporaryTileEntity.get() == null ? new ArrayList() : mTemporaryTileEntity.get().getDrops(GregTech_API.sBlockOresUb2, aFortune);
}
@SideOnly(Side.CLIENT)
@ -107,14 +108,14 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
aList.add(new ItemStack(aItem, 1, i + 5000));
aList.add(new ItemStack(aItem, 1, i + 6000));
aList.add(new ItemStack(aItem, 1, i + 7000));
aList.add(new ItemStack(aItem, 1, i + 8000));
aList.add(new ItemStack(aItem, 1, i + 9000));
aList.add(new ItemStack(aItem, 1, i + 10000));
aList.add(new ItemStack(aItem, 1, i + 11000));
aList.add(new ItemStack(aItem, 1, i + 12000));
aList.add(new ItemStack(aItem, 1, i + 13000));
aList.add(new ItemStack(aItem, 1, i + 14000));
aList.add(new ItemStack(aItem, 1, i + 15000));
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 + 22000));
aList.add(new ItemStack(aItem, 1, i + 23000));
}
}
}

View file

@ -2,13 +2,8 @@ package gregtech.common.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import exterminatorJeff.undergroundBiomes.common.UndergroundBiomes;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
@ -16,7 +11,10 @@ import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.List;
public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
@ -35,14 +33,14 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 5000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 6000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 7000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 8000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 9000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 10000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 11000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 12000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 13000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 14000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 15000) + ".name", "Small " + 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", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 22000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 23000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 1000));
@ -52,14 +50,14 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 5000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 6000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 7000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 8000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 9000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 10000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 11000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 12000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 13000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 14000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 15000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 16000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 17000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 18000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 19000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 20000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 21000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 22000));
GT_OreDictUnificator.registerOre("ore", new ItemStack(this, 1, i + 23000));
if (tHideOres) {
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000));
@ -69,14 +67,14 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
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 + 8000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 9000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 10000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 11000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 12000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 13000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 14000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 15000));
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));
}
}
}
@ -89,9 +87,12 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
}
@Override
public ITexture[] getStoneTexture(byte aSide, int aMetaData, Materials aMaterial) {
ITexture[] mStoneTextures = {new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 7), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 7)};
return new ITexture[]{mStoneTextures[(aMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[aMetaData < 8000 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
return ((GT_TileEntity_Ores) tTileEntity).getDrops(GregTech_API.sBlockOresUb3, aFortune);
}
return mTemporaryTileEntity.get() == null ? new ArrayList() : mTemporaryTileEntity.get().getDrops(GregTech_API.sBlockOresUb3, aFortune);
}
@SideOnly(Side.CLIENT)
@ -107,14 +108,14 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
aList.add(new ItemStack(aItem, 1, i + 5000));
aList.add(new ItemStack(aItem, 1, i + 6000));
aList.add(new ItemStack(aItem, 1, i + 7000));
aList.add(new ItemStack(aItem, 1, i + 8000));
aList.add(new ItemStack(aItem, 1, i + 9000));
aList.add(new ItemStack(aItem, 1, i + 10000));
aList.add(new ItemStack(aItem, 1, i + 11000));
aList.add(new ItemStack(aItem, 1, i + 12000));
aList.add(new ItemStack(aItem, 1, i + 13000));
aList.add(new ItemStack(aItem, 1, i + 14000));
aList.add(new ItemStack(aItem, 1, i + 15000));
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 + 22000));
aList.add(new ItemStack(aItem, 1, i + 23000));
}
}
}

View file

@ -17,7 +17,37 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract {
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));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Marble Cobblestone");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mossy Marble Cobblestone");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Marble Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Cracked Marble Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Mossy Marble Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Chiseled Marble");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Smooth Marble");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Basalt");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Basalt Cobblestone");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Mossy Basalt Cobblestone");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Basalt Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Cracked Basalt Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Mossy Basalt Bricks");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Chiseled Basalt");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Smooth Basalt");
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 0));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 1));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 2));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 3));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 4));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 5));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 6));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Marble, new ItemStack(this, 1, 7));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 8));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 9));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 10));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 11));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 12));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 13));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 14));
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Basalt, new ItemStack(this, 1, 15));
}
public int getHarvestLevel(int aMeta) {
@ -29,8 +59,7 @@ public class GT_Block_Stones extends GT_Block_Stones_Abstract {
}
public IIcon getIcon(int aSide, int aMeta) {
//if ((aMeta >= 0) && (aMeta < 16)) {
if (aMeta == 0) {
if ((aMeta >= 0) && (aMeta < 16)) {
return gregtech.api.enums.Textures.BlockIcons.STONES[aMeta].getIcon();
}
return gregtech.api.enums.Textures.BlockIcons.STONES[0].getIcon();

View file

@ -26,15 +26,13 @@ import java.util.ArrayList;
import java.util.Random;
public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntity {
public 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)};
public 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_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)};
public static final ITexture[] mStoneTexturesUb1 = {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, 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)};
public static final ITexture[] mStoneTexturesUb2 = {new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 7), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.metamorphicStone, 0, 7)};
public static final ITexture[] mStoneTexturesUb3 = {new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 7), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 0), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 1), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 2), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 3), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 4), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 5), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 6), new GT_CopiedBlockTexture(UndergroundBiomes.sedimentaryStone, 0, 7)};
public short mMetaData = 0;
public boolean mNatural = false;
public boolean mBlocked = true;
public static String mOreBlock = ""; //TODO remove static
//public static Block mOreBlock = GregTech_API.sBlockOres1;
public static byte getHarvestData(short aMetaData) {
Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)];
@ -45,12 +43,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
return tByte;
}
public static byte getOreMeta(short aMetaData, Block tBlock) {
return (byte) (aMetaData % 16000 / 1000);
}
public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean smallOre) {
return setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false);
return setOreBlock(aWorld, aX, aY, aZ, aMetaData, smallOre, false);
}
public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean smallOre, boolean air) {
@ -60,6 +54,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
Block tBlock = aWorld.getBlock(aX, aY, aZ);
Block tOreBlock = GregTech_API.sBlockOres1;
int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ);
aMetaData += smallOre ? 16000 : 0;
if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) {
if (tBlock instanceof BlockMetadataBase) { //UBC Handling
if (tBlock == UndergroundBiomes.igneousStone) {
@ -69,7 +64,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else if(tBlock == UndergroundBiomes.sedimentaryStone) {
tOreBlock = GregTech_API.sBlockOresUb3;
}
aMetaData += smallOre ? 8000 + (BlockMeta * 1000) : (BlockMeta * 1000);
aMetaData += (BlockMeta * 1000);
} else { //Default Handling
if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) {
aMetaData += 1000;
@ -85,9 +80,9 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else {
aMetaData += 3000;
}
} else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) && smallOre) {
} /*else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone) && smallOre) {
aMetaData += 16000;
} else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
}*/ else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
return false;
}
}
@ -96,8 +91,6 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) aMetaData);
((GT_TileEntity_Ores) tTileEntity).mNatural = true;
((GT_TileEntity_Ores) tTileEntity).mOreBlock = tOreBlock.getUnlocalizedName();
//System.out.println(mOreBlock);
}
return true;
}
@ -108,14 +101,12 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
super.readFromNBT(aNBT);
this.mMetaData = aNBT.getShort("m");
this.mNatural = aNBT.getBoolean("n");
this.mOreBlock = aNBT.getString("o");
}
public void writeToNBT(NBTTagCompound aNBT) {
super.writeToNBT(aNBT);
aNBT.setShort("m", this.mMetaData);
aNBT.setBoolean("n", this.mNatural);
aNBT.setString("o", this.mOreBlock);
}
public void onUpdated() {
@ -135,29 +126,45 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
}
public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) {
this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L));
if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) {
this.mMetaData = ((short) (this.mMetaData + 1000));
} else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) {
this.mMetaData = ((short) (this.mMetaData + 2000));
} else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) {
if (aOverridingStoneBlock == GregTech_API.sBlockGranites) {
if (aOverridingStoneMeta < 8) {
this.mMetaData = ((short) (this.mMetaData + 3000));
//if(this.mMetaData < 3000) { //Fix issue where a black granite vein could override the meta of ores in an existing red granite vein.
//System.out.println("Data before: " + this.mMetaData);
this.mMetaData = ((short) (int) (this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L));
//System.out.println("Data after: " + this.mMetaData);
if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) {
this.mMetaData = ((short) (this.mMetaData + 1000));
} else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) {
this.mMetaData = ((short) (this.mMetaData + 2000));
} else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) {
if (aOverridingStoneBlock == GregTech_API.sBlockGranites) {
if (aOverridingStoneMeta < 8) {
this.mMetaData = ((short) (this.mMetaData + 3000));
} else {
this.mMetaData = ((short) (this.mMetaData + 4000));
}
} else {
this.mMetaData = ((short) (this.mMetaData + 4000));
this.mMetaData = ((short) (this.mMetaData + 3000));
}
} 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));
} else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockStones)) {
if (aOverridingStoneBlock == GregTech_API.sBlockStones) {
if (aOverridingStoneMeta < 8) {
this.mMetaData = ((short) (this.mMetaData + 5000));
} else {
this.mMetaData = ((short) (this.mMetaData + 6000));
}
}
}
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
//}
}
public TileEntity convertOreBlock(World aWorld, GT_TileEntity_Ores aTileEntityOres, int aX, int aY, int aZ) {
aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1);
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if(tTileEntity instanceof GT_TileEntity_Ores) {
short aMeta = aTileEntityOres.mMetaData;
((GT_TileEntity_Ores) tTileEntity).mMetaData = aMeta >= 16000 ? (short) ((aMeta % 1000) + 16000) : (short) (aMeta % 1000);
}
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
return tTileEntity;
}
public short getMetaData() {
@ -168,14 +175,14 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
return false;
}
public ArrayList<ItemStack> getDrops(int aFortune) {
public ArrayList<ItemStack> getDrops(Block aDroppedOre, int aFortune) {
ArrayList<ItemStack> rList = new ArrayList();
if (this.mMetaData <= 0) {
rList.add(new ItemStack(Blocks.cobblestone, 1, 0));
return rList;
}
if (this.mMetaData < 16000) {
rList.add(new ItemStack(GregTech_API.sBlockOres1, 1, this.mMetaData));
rList.add(new ItemStack(aDroppedOre, 1, this.mMetaData));
return rList;
}
Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)];
@ -257,24 +264,18 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
return rList;
}
public ITexture[] getTexture(byte aSide) {
if(this.mMetaData % 1000 >=0) {
Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)];
if ((aMaterial != null) && (this.mMetaData < 16000)) {
//return ((GT_Block_Ores_Abstract) mOreBlock).getStoneTexture(aSide, this.mMetaData, aMaterial);
//System.out.println(this.mOreBlock + " -- " + this.mMetaData);
if (this.mOreBlock.equalsIgnoreCase("gt.blockores")) {
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)};
} else if (this.mOreBlock.equalsIgnoreCase("gt.blockores.ub1")) {
return new ITexture[]{mStoneTexturesUb1[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData < 8000 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
} else if (this.mOreBlock.equalsIgnoreCase("gt.blockores.ub2")) {
return new ITexture[]{mStoneTexturesUb2[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData < 8000 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
} else if (this.mOreBlock.equalsIgnoreCase("gt.blockores.ub3")) {
return new ITexture[]{mStoneTexturesUb3[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData < 8000 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
}
public ITexture[] getTexture(Block aBlock, byte aSide) {
Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)];
if ((aMaterial != null) && (this.mMetaData < 32000)) {
if (aBlock instanceof GT_Block_Ores) {
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)};
} else if (aBlock instanceof GT_Block_Ores_UB1) {
return new ITexture[]{mStoneTexturesUb1[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
} else if (aBlock instanceof GT_Block_Ores_UB2) {
return new ITexture[]{mStoneTexturesUb2[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
} else if (aBlock instanceof GT_Block_Ores_UB3) {
return new ITexture[]{mStoneTexturesUb3[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa)};
}
} else {
System.out.println(this.mMetaData + "######################## ERROR ########################");
}
return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])};
}

View file

@ -117,7 +117,7 @@ public class GT_Renderer_Block
public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof ITexturedTileEntity)) {
return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{((ITexturedTileEntity) tTileEntity).getTexture((byte) 0), ((ITexturedTileEntity) tTileEntity).getTexture((byte) 1), ((ITexturedTileEntity) tTileEntity).getTexture((byte) 2), ((ITexturedTileEntity) tTileEntity).getTexture((byte) 3), ((ITexturedTileEntity) tTileEntity).getTexture((byte) 4), ((ITexturedTileEntity) tTileEntity).getTexture((byte) 5)});
return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 0), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 1), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 2), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 3), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 4), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 5)});
}
return false;
}
@ -162,7 +162,7 @@ public class GT_Renderer_Block
ITexture[][] tIcons = new ITexture[6][];
ITexture[][] tCovers = new ITexture[6][];
for (byte i = 0; i < 6; i = (byte) (i + 1)) {
tCovers[i] = aTileEntity.getTexture(i);
tCovers[i] = aTileEntity.getTexture(aBlock, i);
tIcons[i] = aTileEntity.getTextureUncovered(i);
}
if (tConnections == 0) {
@ -541,32 +541,32 @@ public class GT_Renderer_Block
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture((byte) 0), true);
renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture((byte) 1), true);
renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture((byte) 2), true);
renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture((byte) 3), true);
renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture((byte) 4), true);
renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture((byte) 5), true);
renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true);
Tessellator.instance.draw();
}
aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);

View file

@ -38,7 +38,27 @@ 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.tiny", true, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.marble.small", true, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.marble.medium", true, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.marble.large", true, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 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_Stone("overworld.stone.basalt.tiny", true, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.basalt.small", true, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.basalt.medium", true, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.tiny", true, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.small", true, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.medium", true, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.large", true, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.huge", true, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.tiny", true, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.small", true, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.medium", true, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 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);