diff options
author | â€huajijam <strhuaji@gmail.com> | 2019-04-24 17:26:22 +0800 |
---|---|---|
committer | â€huajijam <strhuaji@gmail.com> | 2019-04-24 17:26:22 +0800 |
commit | de9f7710d6f32af0d941085e1029a106b5bc22ff (patch) | |
tree | 71918df2e7294d96a2c3dd81dd02cc4b872fe111 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities | |
parent | f004369537bf82a3318f2d315af530944433dac5 (diff) | |
parent | ea049ad62ba64a414fccfa5cbb875d72e7e94d00 (diff) | |
download | GT5-Unofficial-de9f7710d6f32af0d941085e1029a106b5bc22ff.tar.gz GT5-Unofficial-de9f7710d6f32af0d941085e1029a106b5bc22ff.tar.bz2 GT5-Unofficial-de9f7710d6f32af0d941085e1029a106b5bc22ff.zip |
Automatic synchronization
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java | 482 |
1 files changed, 409 insertions, 73 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java index 9ac67cf874..fb4884e278 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java @@ -3,14 +3,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.b import java.util.ArrayList; import java.util.HashMap; -import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkPosition; - +import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -22,16 +15,28 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; - +import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.ORES; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.MiningUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkPosition; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends GT_MetaTileEntity_MultiBlockBase { @@ -41,7 +46,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G private static final Block miningPipeTipBlock; private final ArrayList<ChunkPosition> oreBlockPositions; - protected double mProductionModifier = 100; + protected double mProductionModifier = 0; private Block casingBlock; private int casingMeta; @@ -113,70 +118,46 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G public void saveNBTData(final NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setDouble("mProductionModifier", mProductionModifier); - for (int g = 0; g < 5; g++) { - aNBT.setBoolean("isPickingPipes" + g, this.isPickingPipes[g]); - } } public void loadNBTData(final NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.mProductionModifier = aNBT.getDouble("mProductionModifier"); - for (int g = 0; g < 5; g++) { - this.isPickingPipes[g] = aNBT.getBoolean("isPickingPipes" + g); - } } public boolean checkRecipe(final ItemStack aStack) { - this.setElectricityStats(); + //this.setElectricityStats(); boolean[] didWork = new boolean[5]; - - final int oldYHead = this.yHead[0]; - if (!this.checkPipesAndSetYHead() || !this.isEnergyEnough()) { - this.stopMachine(); + + if (!this.tryConsumeDrillingFluid()) { + Logger.INFO("No drilling Fluid."); return false; } - if (this.yHead[0] != oldYHead) { - this.oreBlockPositions.clear(); + + if (MathUtils.isNumberEven((int) this.mProductionModifier)) { + if (!this.tryConsumePyrotheum()) { + Logger.INFO("No tryConsumePyrotheum Fluid."); + return false; + } + else { + mProductionModifier++; + } } - - for (int g = 0; g < 5; g++) { - if (this.isPickingPipes[g]) { - if (this.tryPickPipe(g)) { - this.mOutputItems = new ItemStack[] { GT_Utility.copyAmount(1L, - new Object[] { GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe }) }; - didWork[g] = true; - continue; - } - this.isPickingPipes[g] = false; - this.stopMachine(); - didWork[g] = false; + else { + if (!this.tryConsumeCryotheum()) { + Logger.INFO("No tryConsumeCryotheum Fluid."); + return false; } else { - this.putMiningPipesFromInputsInController(); - - if (!this.tryConsumeDrillingFluid()) { - return false; - } - - if (this.oreBlockPositions.isEmpty()) { - // Hit bedrock Either retract pipe or Dig! - if (!this.tryLowerPipe(g)) { - // Mining Head is too high, we best retract. - if (!mMiningHeads.isEmpty() && mMiningHeads.containsKey(g) && mMiningHeads.get(g).yPos >= 6) { - for (int r = 0; r < 5; r++) { - this.isPickingPipes[r] = true; - } - didWork[g] = this.isPickingPipes[g]; - } - // Full Power! - else { - didWork[g] = true; - } - } - } + mProductionModifier++; } } + + for (int i = 0; i < 5; i++) { + process(); + didWork[i] = true; + } // Fail recipe handling if one pipe didn't handle properly, to try again // next run. @@ -186,7 +167,11 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G return false; } } - // Logger.INFO("[Bedrock Miner] Success? [x]"); + + this.mEUt = 8000; + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 10000; + return true; } @@ -228,13 +213,15 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G private void setElectricityStats() { //this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); this.mEfficiencyIncrease = 10000; - final int overclock = 1 << GT_Utility.getTier(this.getMaxInputVoltage()) - 1; - this.mEUt = -12 * overclock * overclock; + final int overclock = 8 << GT_Utility.getTier(this.getMaxInputVoltage()); + //this.mEUt = -12 * overclock * overclock; + Logger.INFO("Trying to set EU to "+(12 * overclock * overclock)); int mCombinedAvgTime = 0; for (int g = 0; g < 5; g++) { mCombinedAvgTime += (this.isPickingPipes[g] ? 80 : this.getBaseProgressTime()) / overclock; } - this.mMaxProgresstime = (mCombinedAvgTime / 5); + Logger.INFO("Trying to set Max Time to "+(mCombinedAvgTime)); + //this.mMaxProgresstime = (mCombinedAvgTime / 5); } /* @@ -282,16 +269,16 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G boolean g = (this.getBaseMetaTileEntity().getWorld().getTotalWorldTime() % 2 == 0); consumed = (g ? tryConsumePyrotheum() : tryConsumeCryotheum()); if (consumed) { - increaseProduction(g ? 2 : 1); + //increaseProduction(g ? 2 : 1); } else { - lowerProduction(g ? 5 : 3); + //lowerProduction(g ? 5 : 3); } return consumed; } private boolean tryConsumePyrotheum() { - return this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 2)); + return this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 4)); } private boolean tryConsumeCryotheum() { @@ -382,11 +369,11 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G } boolean didWork[] = new boolean[3]; - if (this.checkBlockAndMeta(this.xCenter[pipe], this.yHead[pipe] - 1, this.zCenter[pipe], Blocks.bedrock, + /*if (this.checkBlockAndMeta(this.xCenter[pipe], this.yHead[pipe] - 1, this.zCenter[pipe], Blocks.bedrock, 32767)) { // Logger.INFO("[Bedrock Miner] Pipe "+pipe+" is at Bedrock."); return false; - } + }*/ didWork[0] = this.getBaseMetaTileEntity().getWorld().setBlock(this.xCenter[pipe], this.yHead[pipe] - 1, this.zCenter[pipe], GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipeTipBlock); if (didWork[0]) { @@ -425,7 +412,72 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { this.updateCoordinates(); - for (int xOff = -1 + this.back.offsetX; xOff <= 1 + this.back.offsetX; ++xOff) { + + + + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int tAmount = 0; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { + return false; + } else { + + Block aCasing = Block.getBlockFromItem(getCasingBlockItem().getItem()); + + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int h = -1; h < 2; ++h) { + if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, + h, zDir + j); + Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); + int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); + + if (!this.addToMachineList(tTileEntity, 48)) { + if (aBlock != aCasing) { + Logger.INFO("Found Bad Casing"); + return false; + } + if (aMeta != 3) { + Logger.INFO("Found Bad Meta"); + return false; + } + } + ++tAmount; + + + + /*if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta, sBlockCasings4, 0)) { + Logger.INFO("Bad centrifuge casing"); + return false; + }*/ + + } + } + } + } + return tAmount >= 10; + } + + + + + + + + + + + + + + + + + + + + /*for (int xOff = -1 + this.back.offsetX; xOff <= 1 + this.back.offsetX; ++xOff) { for (int zOff = -1 + this.back.offsetZ; zOff <= 1 + this.back.offsetZ; ++zOff) { if (xOff != 0 || zOff != 0) { final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xOff, 0, zOff); @@ -436,7 +488,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G && !this.addInputToMachineList(tTileEntity, this.casingTextureIndex) && !this.addOutputToMachineList(tTileEntity, this.casingTextureIndex) && !this.addEnergyInputToMachineList(tTileEntity, this.casingTextureIndex)) { - Logger.INFO("[Bedrock Miner] Found bad blosck in Structure."); + Logger.INFO("[Bedrock Miner] Found bad block in Structure."); if (tBlock != null) { //Logger.INFO("[Bedrock Miner] Found "+(new ItemStack(tBlock, tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(), xOff, 0, zOff))).getDisplayName()+", expected "+this.getCasingBlockItem().get(0L, new Object[0]).getDisplayName()); } @@ -466,12 +518,12 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G } } Logger.INFO("[Bedrock Miner] Built."); - return true; + return true;*/ } private void updateCoordinates() { this.xDrill = this.getBaseMetaTileEntity().getXCoord(); - this.yDrill = this.getBaseMetaTileEntity().getYCoord(); + this.yDrill = this.getBaseMetaTileEntity().getYCoord()-1; this.zDrill = this.getBaseMetaTileEntity().getZCoord(); this.back = ForgeDirection.getOrientation((int) this.getBaseMetaTileEntity().getBackFacing()); @@ -495,7 +547,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G private boolean checkPipesAndSetYHead() { for (int g = 0; g < 5; g++) { - this.yHead[g] = this.yDrill - 1; + this.yHead[g] = this.yDrill -5; // Logger.INFO("[Bedrock Miner] Set yHead["+g+"] to // "+this.yHead[g]+"."); while (this.checkBlockAndMeta(this.xCenter[g], this.yHead[g], this.zCenter[g], @@ -504,7 +556,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G } if (this.checkBlockAndMeta(this.xCenter[g], this.yHead[g], this.zCenter[g], GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipeTipBlock, 32767) - || ++this.yHead[g] == this.yDrill) { + || ++this.yHead[g] == this.yDrill || GT_Utility.isBlockAir(this.getBaseMetaTileEntity().getWorld(), this.xCenter[g], this.yHead[g], this.zCenter[g])) { continue; } this.getBaseMetaTileEntity().getWorld().setBlock(this.xCenter[g], this.yHead[g], this.zCenter[g], @@ -595,4 +647,288 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G miningPipeBlock = ModBlocks.blockFakeMiningPipe; miningPipeTipBlock = ModBlocks.blockFakeMiningHead; } + + + + + + + + + + + + + + + + + + + + + + + + + + private AutoMap<ItemStack> mOutputs; + + public void process() { + ItemStack aOutput = generateOutputWithchance(); + if (aOutput != null) { + this.addOutput(aOutput); + Logger.INFO("Mined some "+aOutput.getDisplayName()); + } + this.updateSlots(); + } + + public ItemStack generateOutputWithchance() { + int aChance = MathUtils.randInt(0, 7500); + if (aChance < 100) { + return generateOutput(); + } + else { + return null; + } + } + + public ItemStack generateOutput() { + AutoMap<ItemStack> aData = generateOreForOutput(); + int aMax = aData.size()-1; + return aData.get(MathUtils.randInt(0, aMax)); + } + + /** + * Here we generate valid ores and also a basic loot set + */ + + public AutoMap<ItemStack> generateOreForOutput() { + + if (mOutputs != null) { + return mOutputs; + } + + AutoMap<GT_Worldgen_GT_Ore_Layer> aOverWorldOres = MiningUtils.getOresForDim(0); + AutoMap<GT_Worldgen_GT_Ore_Layer> aNetherOres = MiningUtils.getOresForDim(-1); + AutoMap<GT_Worldgen_GT_Ore_Layer> aEndOres = MiningUtils.getOresForDim(1); + + AutoMap<ItemStack> aTempMap = new AutoMap<ItemStack>(); + Block tOreBlock = GregTech_API.sBlockOres1; + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Initial]"); + + for (GT_Worldgen_GT_Ore_Layer layer : aOverWorldOres) { + if (layer.mEnabled) { + ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); + ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); + ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); + ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); + aTempMap.put(aTempOreStack1); + aTempMap.put(aTempOreStack2); + aTempMap.put(aTempOreStack3); + aTempMap.put(aTempOreStack4); + aTempMap.put(aTempOreStack1); + aTempMap.put(aTempOreStack2); + aTempMap.put(aTempOreStack3); + aTempMap.put(aTempOreStack4); + aTempMap.put(aTempOreStack1); + aTempMap.put(aTempOreStack2); + aTempMap.put(aTempOreStack3); + aTempMap.put(aTempOreStack4); + } + } + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Overworld]"); + for (GT_Worldgen_GT_Ore_Layer layer : aNetherOres) { + if (layer.mEnabled) { + ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); + ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); + ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); + ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); + aTempMap.put(aTempOreStack1); + aTempMap.put(aTempOreStack2); + aTempMap.put(aTempOreStack3); + aTempMap.put(aTempOreStack4); + aTempMap.put(aTempOreStack1); + aTempMap.put(aTempOreStack2); + aTempMap.put(aTempOreStack3); + aTempMap.put(aTempOreStack4); + } + } + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Nether]"); + for (GT_Worldgen_GT_Ore_Layer layer : aEndOres) { + if (layer.mEnabled) { + ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); + ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); + ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); + ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); + aTempMap.put(aTempOreStack1); + aTempMap.put(aTempOreStack2); + aTempMap.put(aTempOreStack3); + aTempMap.put(aTempOreStack4); + } + } + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [End]"); + + addOreTypeToMap(ELEMENT.getInstance().IRON, 200, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().COPPER, 175, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().TIN, 150, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().GOLD, 150, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().SILVER, 110, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().NICKEL, 40, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().ZINC, 40, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().LEAD, 40, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().ALUMINIUM, 30, aTempMap); + addOreTypeToMap(ELEMENT.getInstance().THORIUM, 20, aTempMap); + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Extra Common Ores]"); + + AutoMap<Pair<String, Integer>> mMixedOreData = new AutoMap<Pair<String, Integer>>(); + mMixedOreData.put(new Pair<String, Integer>("oreRuby", 30)); + mMixedOreData.put(new Pair<String, Integer>("oreSapphire", 25)); + mMixedOreData.put(new Pair<String, Integer>("oreEmerald", 25)); + mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40)); + mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40)); + + if (LoadedMods.Thaumcraft || (OreDictionary.doesOreNameExist("oreAmber") && OreDictionary.doesOreNameExist("oreCinnabar"))) { + mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20)); + mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20)); + } + if (LoadedMods.Railcraft || OreDictionary.doesOreNameExist("oreSaltpeter")) { + mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10)); + } + if (LoadedMods.IndustrialCraft2 || OreDictionary.doesOreNameExist("oreUranium")) { + mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10)); + } + if (OreDictionary.doesOreNameExist("oreSulfur")) { + mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15)); + } + if (OreDictionary.doesOreNameExist("oreSilicon")) { + mMixedOreData.put(new Pair<String, Integer>("oreSilicon", 15)); + } + if (OreDictionary.doesOreNameExist("oreApatite")) { + mMixedOreData.put(new Pair<String, Integer>("oreApatite", 25)); + } + + mMixedOreData.put(new Pair<String, Integer>("oreFirestone", 2)); + mMixedOreData.put(new Pair<String, Integer>("oreBismuth", 20)); + mMixedOreData.put(new Pair<String, Integer>("oreLithium", 20)); + mMixedOreData.put(new Pair<String, Integer>("oreManganese", 20)); + mMixedOreData.put(new Pair<String, Integer>("oreBeryllium", 20)); + mMixedOreData.put(new Pair<String, Integer>("oreCoal", 75)); + mMixedOreData.put(new Pair<String, Integer>("oreLignite", 75)); + mMixedOreData.put(new Pair<String, Integer>("oreSalt", 15)); + mMixedOreData.put(new Pair<String, Integer>("oreCalcite", 15)); + mMixedOreData.put(new Pair<String, Integer>("oreBauxite", 20)); + mMixedOreData.put(new Pair<String, Integer>("oreAlmandine", 15)); + mMixedOreData.put(new Pair<String, Integer>("oreGraphite", 25)); + mMixedOreData.put(new Pair<String, Integer>("oreGlauconite", 15)); + mMixedOreData.put(new Pair<String, Integer>("orePyrolusite", 15)); + mMixedOreData.put(new Pair<String, Integer>("oreGrossular", 15)); + mMixedOreData.put(new Pair<String, Integer>("oreTantalite", 15)); + + for (Pair<String, Integer> g : mMixedOreData) { + for (int i=0; i<g.getValue();i++) { + aTempMap.put(ItemUtils.getItemStackOfAmountFromOreDict(g.getKey(), 1)); + } + } + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [Extra Mixed Ores]"); + + + addOreTypeToMap(ELEMENT.STANDALONE.RUNITE, 2, aTempMap); + addOreTypeToMap(ELEMENT.STANDALONE.GRANITE, 8, aTempMap); + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [OSRS Ores]"); + + + AutoMap<Material> aMyOreMaterials = new AutoMap<Material>(); + aMyOreMaterials.add(ORES.CROCROITE); + aMyOreMaterials.add(ORES.GEIKIELITE); + aMyOreMaterials.add(ORES.NICHROMITE); + aMyOreMaterials.add(ORES.TITANITE); + aMyOreMaterials.add(ORES.ZIMBABWEITE); + aMyOreMaterials.add(ORES.ZIRCONILITE); + aMyOreMaterials.add(ORES.GADOLINITE_CE); + aMyOreMaterials.add(ORES.GADOLINITE_Y); + aMyOreMaterials.add(ORES.LEPERSONNITE); + aMyOreMaterials.add(ORES.SAMARSKITE_Y); + aMyOreMaterials.add(ORES.SAMARSKITE_YB); + aMyOreMaterials.add(ORES.XENOTIME); + aMyOreMaterials.add(ORES.YTTRIAITE); + aMyOreMaterials.add(ORES.YTTRIALITE); + aMyOreMaterials.add(ORES.YTTROCERITE); + aMyOreMaterials.add(ORES.ZIRCON); + aMyOreMaterials.add(ORES.POLYCRASE); + aMyOreMaterials.add(ORES.ZIRCOPHYLLITE); + aMyOreMaterials.add(ORES.ZIRKELITE); + aMyOreMaterials.add(ORES.LANTHANITE_LA); + aMyOreMaterials.add(ORES.LANTHANITE_CE); + aMyOreMaterials.add(ORES.LANTHANITE_ND); + aMyOreMaterials.add(ORES.AGARDITE_Y); + aMyOreMaterials.add(ORES.AGARDITE_CD); + aMyOreMaterials.add(ORES.AGARDITE_LA); + aMyOreMaterials.add(ORES.AGARDITE_ND); + aMyOreMaterials.add(ORES.HIBONITE); + aMyOreMaterials.add(ORES.CERITE); + aMyOreMaterials.add(ORES.FLUORCAPHITE); + aMyOreMaterials.add(ORES.FLORENCITE); + aMyOreMaterials.add(ORES.CRYOLITE); + aMyOreMaterials.add(ORES.LAUTARITE); + aMyOreMaterials.add(ORES.LAFOSSAITE); + aMyOreMaterials.add(ORES.DEMICHELEITE_BR); + aMyOreMaterials.add(ORES.COMANCHEITE); + aMyOreMaterials.add(ORES.PERROUDITE); + aMyOreMaterials.add(ORES.HONEAITE); + aMyOreMaterials.add(ORES.ALBURNITE); + aMyOreMaterials.add(ORES.MIESSIITE); + aMyOreMaterials.add(ORES.KASHINITE); + aMyOreMaterials.add(ORES.IRARSITE); + aMyOreMaterials.add(ORES.RADIOBARITE); + aMyOreMaterials.add(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT); + + for (Material aOreType : aMyOreMaterials) { + if (aOreType == ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT || aOreType == ORES.RADIOBARITE) { + addOreTypeToMap(aOreType, 4, aTempMap); + } + else { + addOreTypeToMap(aOreType, 7, aTempMap); + } + } + + //Cleanup Map + Logger.INFO("Ore Map contains "+aTempMap.size()+" values. [GT++]"); + AutoMap<ItemStack> aCleanUp = new AutoMap<ItemStack>(); + for (ItemStack verify : aTempMap) { + if (!ItemUtils.checkForInvalidItems(verify)) { + aCleanUp.put(verify); + } + } + Logger.INFO("Cleanup Map contains "+aCleanUp.size()+" values."); + for (ItemStack remove : aCleanUp) { + aTempMap.remove(remove); + } + + //Generate Massive Map + AutoMap<ItemStack> aFinalMap = new AutoMap<ItemStack>(); + for (ItemStack aTempItem : aTempMap) { + int aTempMulti = MathUtils.randInt(20, 50); + for (int i=0;i<aTempMulti;i++) { + aFinalMap.put(aTempItem.copy()); + } + } + Logger.INFO("Final Ore Map contains "+aFinalMap.size()+" values."); + mOutputs = aFinalMap; + return mOutputs; + } + + + private static void addOreTypeToMap(Material aMaterial, int aAmount, AutoMap<ItemStack> aMap) { + for (int i=0; i<aAmount;i++) { + aMap.add(aMaterial.getOre(1)); + } + } + + + + + + + }
\ No newline at end of file |