diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index c9868a93..6fe01016 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -1,11 +1,5 @@ package gregtech; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.PrintStream; -import java.util.*; -import java.util.Map.Entry; - import cpw.mods.fml.common.*; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.registry.EntityRegistry; @@ -56,6 +50,12 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.PrintStream; +import java.util.*; +import java.util.Map.Entry; + //import forestry.factory.recipes.ISqueezerRecipe; //import forestry.factory.tiles.TileCentrifuge; //import forestry.factory.tiles.TileSqueezer; @@ -612,31 +612,31 @@ public class GT_Mod } GT_Log.out.println("GT_Mod: Adding Fake Recipes for NEI"); if (ItemList.FR_Bee_Drone.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Drone.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Drone.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Bee_Princess.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Princess.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Princess.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Bee_Queen.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Queen.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Bee_Queen.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Tree_Sapling.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Tree_Sapling.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Tree_Sapling.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Butterfly.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Butterfly.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Butterfly.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Larvae.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Larvae.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Larvae.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Serum.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Serum.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Serum.getWithName(1L, "Scanned Serum", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Serum.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Serum.getWithName(1L, "Scanned Serum", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_Caterpillar.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Caterpillar.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_Caterpillar.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.FR_PollenFertile.get(1L, new Object[0]) != null) { - GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_PollenFertile.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(50L)}, null, 500, 2, 0); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.FR_PollenFertile.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen", new Object[0])}, null, new FluidStack[]{Materials.Honey.getFluid(100L)}, null, 500, 2, 0); } if (ItemList.IC2_Crop_Seeds.get(1L, new Object[0]) != null) { GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.IC2_Crop_Seeds.getWildcard(1L, new Object[0])}, new ItemStack[]{ItemList.IC2_Crop_Seeds.getWithName(1L, "Scanned Seeds", new Object[0])}, null, null, null, 160, 8, 0); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index c6090fe8..574ed1e5 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1,9 +1,5 @@ package gregtech.common; -import java.io.File; -import java.text.DateFormat; -import java.util.*; - import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.Loader; @@ -75,6 +71,10 @@ import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; +import java.io.File; +import java.text.DateFormat; +import java.util.*; + public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { private static final EnumSet PREVENTED_ORES = EnumSet.of(OreGenEvent.GenerateMinable.EventType.COAL, new OreGenEvent.GenerateMinable.EventType[]{OreGenEvent.GenerateMinable.EventType.IRON, OreGenEvent.GenerateMinable.EventType.GOLD, @@ -1747,12 +1747,13 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { if (GT_Utility.areStacksEqual(aFuel, new ItemStack(Items.wooden_door, 1))) { rFuelValue = (short) Math.max(rFuelValue, 600); } - if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1, new Object[0]))) { - rFuelValue = Math.max(rFuelValue, 100000); - } if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_MSSFUEL.get(1, new Object[0]))) { - rFuelValue = Math.max(rFuelValue, 150000); + rFuelValue = (short) Math.max(rFuelValue, 150000); } + if (GT_Utility.areStacksEqual(aFuel, ItemList.Block_SSFUEL.get(1, new Object[0]))) { + rFuelValue = (short) Math.max(rFuelValue, 100000); + } + return rFuelValue; } diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 7b8d6d70..5365eb82 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -18,6 +18,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces public final boolean mOverworld; public final boolean mNether; public final boolean mEnd; + public final String mBiome; public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary) { super(aName, GregTech_API.sWorldgenList, aDefault); @@ -28,16 +29,20 @@ public class GT_Worldgen_GT_Ore_SmallPieces this.mMaxY = ((short) Math.max(this.mMinY + 1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", aMaxY))); this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); + this.mBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "BiomeName", "None"); } 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; //Not the correct biome for ore mix + } if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } if (this.mMeta > 0) { int i = 0; for (int j = Math.max(1, this.mAmount / 2 + aRandom.nextInt(this.mAmount) / 2); i < j; i++) { - GT_TileEntity_Ores.setOreBlock(aWorld, aChunkX + aRandom.nextInt(16), this.mMinY + aRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), aChunkZ + aRandom.nextInt(16), /*this.mMeta + 16000*/this.mMeta, true); + GT_TileEntity_Ores.setOreBlock(aWorld, aChunkX + aRandom.nextInt(16), this.mMinY + aRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), aChunkZ + aRandom.nextInt(16), this.mMeta, true); } } return true; diff --git a/src/main/java/gregtech/common/GT_Worldgen_Stone.java b/src/main/java/gregtech/common/GT_Worldgen_Stone.java index 2febb35f..fe3029cc 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_Stone.java +++ b/src/main/java/gregtech/common/GT_Worldgen_Stone.java @@ -62,7 +62,7 @@ public class GT_Worldgen_Stone if ((tTileEntity instanceof GT_TileEntity_Ores)) { short aMeta = ((GT_TileEntity_Ores) tTileEntity).mMetaData; if (tTargetedBlock != GregTech_API.sBlockOres1) { - ((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, aMeta, eX, eY, eZ); + ((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, eX, eY, eZ); } ((GT_TileEntity_Ores)tTileEntity).overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta); } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java index ff8543bd..c9e02c06 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -7,68 +7,13 @@ 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.Block; 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 { public GT_Block_Ores() { - super("gt.blockores", Material.rock); - 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])); - 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])); - 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])); - 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(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)); - 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)); - } - } - } - } + super("gt.blockores", false, Material.rock); } @Override @@ -76,46 +21,28 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract { return "gt.blockores"; } + @Override + public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries; an entry can be null to disable automatic recipes. + return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.oreNetherrack, OrePrefixes.oreEndstone, OrePrefixes.oreBlackgranite, OrePrefixes.oreRedgranite, OrePrefixes.oreMarble, OrePrefixes.oreBasalt, null}; + } + + @Override + public Block getDroppedBlock() { + return GregTech_API.sBlockOres1; + } + + @Override + public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. + return new Materials[]{Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Marble, Materials.Basalt, Materials.Stone}; + } + @Override public int getHarvestLevel(int aMeta) { return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8; } @Override - public ArrayList 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 - public ITexture[] getStoneTexture(int aTextureIndex, GT_RenderedTexture aIconSet) { - ITexture[] mStoneTextures = new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)}; - return new ITexture[]{mStoneTextures[aTextureIndex], aIconSet}; - } - - @Override - 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)); - 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)); - 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)); - } - } + public ITexture[] getTextureSet() { //Must have 16 entries. + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)}; } } \ No newline at end of file diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index 87f2c790..5b314ae5 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -9,7 +9,9 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; import gregtech.api.items.GT_Generic_Block; -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 gregtech.common.render.GT_Renderer_Block; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; @@ -35,12 +37,63 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public static boolean FUCKING_LOCK = false; public static boolean tHideOres; - protected GT_Block_Ores_Abstract(String aUnlocalizedName, Material aMaterial) { + protected GT_Block_Ores_Abstract(String aUnlocalizedName, boolean aHideFirstMeta, Material aMaterial) { super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); this.isBlockContainer = true; setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH_ORES); tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres; + 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])); + 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 + 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(this.getProcessingPrefix()[0] != null ? this.getProcessingPrefix()[0].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[1] != null ? this.getProcessingPrefix()[1].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 1000)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[2] != null ? this.getProcessingPrefix()[2].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 2000)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[3] != null ? this.getProcessingPrefix()[3].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 3000)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[4] != null ? this.getProcessingPrefix()[4].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 4000)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[5] != null ? this.getProcessingPrefix()[5].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 5000)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[6] != null ? this.getProcessingPrefix()[6].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 6000)); + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[7] != null ? this.getProcessingPrefix()[7].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + 7000)); + if (tHideOres) { + if (aHideFirstMeta) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000)); + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000)); + } + } + } + } } public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { @@ -190,14 +243,48 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements aWorld.removeTileEntity(aX, aY, aZ); } - public abstract ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune); + public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes. + + public abstract Block getDroppedBlock(); + + public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null. + + public ArrayList 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(getDroppedBlock(), aFortune); + } + return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores) mTemporaryTileEntity.get()).getDrops(getDroppedBlock(), aFortune); + } public TileEntity createTileEntity(World aWorld, int aMeta) { return new GT_TileEntity_Ores(); } - @SideOnly(Side.CLIENT) - public abstract void getSubBlocks(Item aItem, CreativeTabs aTab, List aList); + public abstract ITexture[] getTextureSet(); //Must have 16 entries. - public abstract ITexture[] getStoneTexture(int aTextureIndex, GT_RenderedTexture aIconSet); + @Override + 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)); + 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 + 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)); + } + } + } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java index 92814ff8..6a9c51f4 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java @@ -1,81 +1,17 @@ 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; +import net.minecraft.block.Block; 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 { public GT_Block_Ores_UB1() { - super("gt.blockores.ub1", Material.rock); - 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])); - 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 + 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(OrePrefixes.oreRedgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i)); - GT_OreDictUnificator.registerOre(OrePrefixes.oreBlackgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000)); - GT_OreDictUnificator.registerOre(OrePrefixes.oreBasalt.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 5000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 6000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 7000)); - if (tHideOres) { - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000)); - } - } - } - } + super("gt.blockores.ub1", true, Material.rock); } @Override @@ -84,42 +20,22 @@ public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { } @Override - public ArrayList 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); + public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries. + return new OrePrefixes[]{OrePrefixes.oreRedgranite, OrePrefixes.oreBlackgranite, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreBasalt, OrePrefixes.ore, OrePrefixes.ore}; } @Override - public ITexture[] getStoneTexture(int aTextureIndex, GT_RenderedTexture aIconSet) { - ITexture[] mStoneTextures = new ITexture[]{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[aTextureIndex], aIconSet}; + public Block getDroppedBlock() { + return GregTech_API.sBlockOresUb1; } - @SideOnly(Side.CLIENT) - 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)); - 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 + 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)); - } - } + @Override + public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. + return new Materials[]{Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone}; + } + + @Override + public ITexture[] getTextureSet() { //Must have 16 entries. + return new ITexture[]{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)}; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java index 6ab1c16b..66e59d45 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java @@ -1,81 +1,17 @@ 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; +import net.minecraft.block.Block; 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 { public GT_Block_Ores_UB2() { - super("gt.blockores.ub2", Material.rock); - 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])); - 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 + 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(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000)); - GT_OreDictUnificator.registerOre(OrePrefixes.oreMarble.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 5000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 6000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 7000)); - if (tHideOres) { - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000)); - } - } - } - } + super("gt.blockores.ub2", true, Material.rock); } @Override @@ -84,42 +20,22 @@ public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { } @Override - public ArrayList 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); + public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries; an entry can be null to disable automatic recipes. + return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreMarble, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore}; } @Override - public ITexture[] getStoneTexture(int aTextureIndex, GT_RenderedTexture aIconSet) { - ITexture[] mStoneTextures = new ITexture[]{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[aTextureIndex], aIconSet}; + public Block getDroppedBlock() { + return GregTech_API.sBlockOresUb2; } - @SideOnly(Side.CLIENT) - 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)); - 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 + 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)); - } - } + @Override + public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. + return new Materials[]{Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone}; + } + + @Override + public ITexture[] getTextureSet() { //Must have 16 entries. + return new ITexture[]{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)}; } } diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java index b3ac0edc..80e3f548 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java @@ -1,81 +1,17 @@ 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; +import net.minecraft.block.Block; 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 { public GT_Block_Ores_UB3() { - super("gt.blockores.ub3", Material.rock); - 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])); - 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 + 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(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 5000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 6000)); - GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 7000)); - if (tHideOres) { - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000)); - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000)); - } - } - } - } + super("gt.blockores.ub3", true, Material.rock); } @Override @@ -84,42 +20,22 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { } @Override - public ArrayList 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); + public OrePrefixes[] getProcessingPrefix() { //Must have 8 entries; an entry can be null to disable automatic recipes. + return new OrePrefixes[]{OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore}; } @Override - public ITexture[] getStoneTexture(int aTextureIndex, GT_RenderedTexture aIconSet) { - ITexture[] mStoneTextures = new ITexture[]{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[aTextureIndex], aIconSet}; + public Block getDroppedBlock() { + return GregTech_API.sBlockOresUb3; } - @SideOnly(Side.CLIENT) - 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)); - 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 + 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)); - } - } + @Override + public Materials[] getDroppedDusts() { //Must have 8 entries; can be null. + return new Materials[]{Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone}; } -} + + @Override + public ITexture[] getTextureSet() { //Must have 16 entries. + return new ITexture[]{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)}; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index e7566b6b..6bf6a713 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -36,11 +36,11 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit return tByte; } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean smallOre) { - return setOreBlock(aWorld, aX, aY, aZ, aMetaData, smallOre, false); + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { + return setOreBlock(aWorld, aX, aY, aZ, aMetaData, isSmallOre, false); } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean smallOre, boolean air) { + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre, boolean air) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -48,7 +48,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit Block tOreBlock = GregTech_API.sBlockOres1; int BlockMeta = aWorld.getBlockMetadata(aX, aY, aZ); String BlockName = tBlock.getUnlocalizedName(); - aMetaData += smallOre ? 16000 : 0; + aMetaData += isSmallOre ? 16000 : 0; if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) { if (BlockName.equals("tile.igneousStone")) { tOreBlock = GregTech_API.sBlockOresUb1; @@ -155,12 +155,13 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0); } - public void convertOreBlock(World aWorld, short aMeta, int aX, int aY, int aZ) { + public void convertOreBlock(World aWorld, int aX, int aY, int aZ) { + short aMeta = ((short) (int) (this.mMetaData % 1000 + (this.mMetaData / 16000 * 16000))); aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof GT_TileEntity_Ores) { - ((GT_TileEntity_Ores) tTileEntity).mMetaData = (short)(aMeta % 1000); - this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData((short)(aMeta % 1000)), 0); + ((GT_TileEntity_Ores) tTileEntity).mMetaData = aMeta; + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(aMeta), 0); } } @@ -240,22 +241,8 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit } } if (tRandom.nextInt(3 + aFortune) > 1) { - switch (this.mMetaData / 1000 % 16) { - case 0: - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); - break; - case 1: - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Netherrack, 1L)); - break; - case 2: - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Endstone, 1L)); - break; - case 3: - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.GraniteBlack, 1L)); - break; - case 4: - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.GraniteRed, 1L)); - } + Materials dustMat = ((GT_Block_Ores_Abstract) aDroppedOre).getDroppedDusts()[this.mMetaData / 1000 % 16]; + if (dustMat != null) rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, dustMat, 1L)); } } return rList; @@ -266,7 +253,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit if ((aMaterial != null) && (this.mMetaData < 32000)) { GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData / 16000 == 0 ? OrePrefixes.ore.mTextureIndex : OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa); if (aBlock instanceof GT_Block_Ores_Abstract) { - return ((GT_Block_Ores_Abstract) aBlock).getStoneTexture(((this.mMetaData / 1000) % 16), aIconSet); + return new ITexture[]{((GT_Block_Ores_Abstract) aBlock).getTextureSet()[((this.mMetaData / 1000) % 16)], aIconSet}; } } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index bdeaa4f2..91a14333 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -39,8 +39,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace "Controller Block for the Blast Furnace", "Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)", "16x Heating Coils (Two middle Layers, hollow)", - "1x Input (Any bottom layer casing)", - "1x Output (Any bottom layer casing)", + "1x Input Hatch/Bus (Any bottom layer casing)", + "1x Output Hatch/Bus (Any bottom layer casing)", "1x Energy Hatch (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Top middle)", diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 51715a54..30a6dd14 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -37,10 +37,11 @@ public abstract class GT_MetaTileEntity_LargeBoiler "Produces "+(getEUt()*40)*(runtimeBoost(20)/20f)+"L of Steam/sec for 1 Coal", "Size(WxHxD): 3x5x3, Controller (Front middle in Fireboxes)", "3x1x3 of Fire Boxes (Bottom layer, Min 3)", - "3x4x3 of Casing (Above Fireboxes, hollow, Min 24!)", + "3x4x3 of Casings (Above Fireboxes, hollow, Min 24!)", "3 Pipe Casing Blocks (Inside the Hollow Casing)", - "1x Input Hatch/Bus (Any Firebox)", - "1x Output Hatch (Any Firebox)", + "1x Input Fuel Hatch/Bus (Any Firebox)", + "1x Input Water Hatch (Any Firebox)", + "1x Output Hatch (Any Casing)", "1x Maintenance Hatch (Any Firebox)", "1x Muffler Hatch (Any Firebox)", "Refined liquid fuels have 1/4 efficiency"};