package com.hbm.world; import java.util.ArrayList; import java.util.List; import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionParticle; import com.hbm.explosion.ExplosionParticleB; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; public class Meteorite { public void generate(World world, Random rand, int x, int y, int z) { List list = (List)world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(x - 7.5, y - 7.5, z - 7.5, x + 7.5, y + 7.5, z + 7.5)); for(Entity e : list) { e.attackEntityFrom(ModDamageSource.meteorite, 1000); } switch(rand.nextInt(300)) { case 0: //Meteor-only tiny meteorite List list0 = new ArrayList(); list0.add(new ItemStack(ModBlocks.block_meteor)); generateBox(world, rand, x, y, z, list0); return; case 1: //Large ore-only meteorite List list1 = new ArrayList(); list1.addAll(this.getRandomOre(rand)); int i = list1.size(); for(int j = 0; j < i; j++) list1.add(new ItemStack(Blocks.stone)); generateSphere7x7(world, rand, x, y, z, list1); return; case 2: //Medium ore-only meteorite List list2 = new ArrayList(); list2.addAll(this.getRandomOre(rand)); int k = list2.size() / 2; for(int j = 0; j < k; j++) list2.add(new ItemStack(Blocks.stone)); generateSphere5x5(world, rand, x, y, z, list2); return; case 3: //Small pure ore meteorite List list3 = new ArrayList(); list3.addAll(this.getRandomOre(rand)); generateBox(world, rand, x, y, z, list3); return; case 4: //Bamboozle world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 15F, true); ExplosionLarge.spawnRubble(world, x, y, z, 25); return; case 5: //Large treasure-only meteorite List list4 = new ArrayList(); list4.add(new ItemStack(ModBlocks.block_meteor_treasure)); list4.add(new ItemStack(ModBlocks.block_meteor_broken)); generateSphere7x7(world, rand, x, y, z, list4); return; case 6: //Medium treasure-only meteorite List list5 = new ArrayList(); list5.add(new ItemStack(ModBlocks.block_meteor_treasure)); list5.add(new ItemStack(ModBlocks.block_meteor_treasure)); list5.add(new ItemStack(ModBlocks.block_meteor_broken)); generateSphere5x5(world, rand, x, y, z, list5); return; case 7: //Small pure treasure meteorite List list6 = new ArrayList(); list6.add(new ItemStack(ModBlocks.block_meteor_treasure)); generateBox(world, rand, x, y, z, list6); return; case 8: //Large nuclear meteorite List list7 = new ArrayList(); list7.add(new ItemStack(ModBlocks.block_meteor_treasure)); List list8 = new ArrayList(); list8.add(new ItemStack(ModBlocks.toxic_block)); generateSphere7x7(world, rand, x, y, z, list7); generateSphere5x5(world, rand, x, y, z, list8); return; case 9: //Giant ore meteorite List list9 = new ArrayList(); list9.add(new ItemStack(ModBlocks.block_meteor_broken)); generateSphere9x9(world, rand, x, y, z, list9); generateSphere7x7(world, rand, x, y, z, this.getRandomOre(rand)); return; case 10: //Tainted Meteorite List list10 = new ArrayList(); list10.add(new ItemStack(ModBlocks.block_meteor_broken)); generateSphere5x5(world, rand, x, y, z, list10); world.setBlock(x, y, z, ModBlocks.taint); return; case 11: //Atomic meteorite EntityNukeExplosionMK3 entity0 = new EntityNukeExplosionMK3(world); entity0.posX = x + 0.5D; entity0.posY = y + 0.5D; entity0.posZ = z + 0.5D; entity0.destructionRange = MainRegistry.fatmanRadius; entity0.speed = MainRegistry.blastSpeed; entity0.coefficient = 10.0F; world.spawnEntityInWorld(entity0); if(MainRegistry.polaroidID == 11) if(rand.nextInt(100) >= 0) { ExplosionParticleB.spawnMush(world, x, y - 3, z); } else { ExplosionParticle.spawnMush(world, x, y - 3, z); } else if(rand.nextInt(100) == 0) { ExplosionParticleB.spawnMush(world, x, y - 3, z); } else { ExplosionParticle.spawnMush(world, x, y - 3, z); } return; } switch(rand.nextInt(3)) { case 0: generateLarge(world, rand, x, y, z); break; case 1: generateMedium(world, rand, x, y, z); break; case 2: generateSmall(world, rand, x, y, z); break; } } public void generateLarge(World world, Random rand, int x, int y, int z) { //0 - Molten //1 - Cobble //2 - Broken //3 - Mix int hull = rand.nextInt(4); //0 - Cobble //1 - Broken //2 - Mix int outerPadding = 0; if(hull == 2) outerPadding = 1 + rand.nextInt(2); else if(hull == 3) outerPadding = 2; //0 - Broken //1 - Stone //2 - Netherrack int innerPadding = rand.nextInt(hull == 0 ? 3 : 2); //0 - Meteor //1 - Treasure //2 - Ore int core = rand.nextInt(2); if(innerPadding > 0) core = 2; List hullL = new ArrayList(); switch(hull) { case 0: hullL.add(new ItemStack(ModBlocks.block_meteor_molten)); break; case 1: hullL.add(new ItemStack(ModBlocks.block_meteor_cobble)); break; case 2: for(int i = 0; i < 99; i++) hullL.add(new ItemStack(ModBlocks.block_meteor_broken)); hullL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 3: hullL.add(new ItemStack(ModBlocks.block_meteor_molten)); hullL.add(new ItemStack(ModBlocks.block_meteor_broken)); break; } List opL = new ArrayList(); switch(outerPadding) { case 0: opL.add(new ItemStack(ModBlocks.block_meteor_cobble)); break; case 1: for(int i = 0; i < 99; i++) opL.add(new ItemStack(ModBlocks.block_meteor_broken)); opL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 2: opL.add(new ItemStack(ModBlocks.block_meteor_cobble)); opL.add(new ItemStack(ModBlocks.block_meteor_broken)); break; } List ipL = new ArrayList(); switch(innerPadding) { case 0: for(int i = 0; i < 99; i++) ipL.add(new ItemStack(ModBlocks.block_meteor_broken)); ipL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 1: ipL.add(new ItemStack(Blocks.stone)); break; case 2: ipL.add(new ItemStack(Blocks.netherrack)); break; } List coreL = new ArrayList(); switch(core) { case 0: coreL.add(new ItemStack(ModBlocks.block_meteor)); break; case 1: coreL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 2: coreL.addAll(this.getRandomOre(rand)); break; } switch(rand.nextInt(5)) { case 0: genL1(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 1: genL2(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 2: genL3(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 3: genL4(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 4: genL5(world, rand, x, y, z, hullL, opL, ipL, coreL); break; } } public void generateMedium(World world, Random rand, int x, int y, int z) { //0 - Molten //1 - Cobble //2 - Broken //3 - Mix int hull = rand.nextInt(4); //0 - Cobble //1 - Broken //2 - Mix int outerPadding = 0; if(hull == 2) outerPadding = 1 + rand.nextInt(2); else if(hull == 3) outerPadding = 2; //0 - Broken //1 - Stone //2 - Netherrack int innerPadding = rand.nextInt(hull == 0 ? 3 : 2); //0 - Meteor //1 - Treasure //2 - Ore int core = rand.nextInt(2); if(innerPadding > 0) core = 2; List hullL = new ArrayList(); switch(hull) { case 0: hullL.add(new ItemStack(ModBlocks.block_meteor_molten)); break; case 1: hullL.add(new ItemStack(ModBlocks.block_meteor_cobble)); break; case 2: for(int i = 0; i < 99; i++) hullL.add(new ItemStack(ModBlocks.block_meteor_broken)); hullL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 3: hullL.add(new ItemStack(ModBlocks.block_meteor_molten)); hullL.add(new ItemStack(ModBlocks.block_meteor_broken)); break; } List opL = new ArrayList(); switch(outerPadding) { case 0: opL.add(new ItemStack(ModBlocks.block_meteor_cobble)); break; case 1: for(int i = 0; i < 99; i++) opL.add(new ItemStack(ModBlocks.block_meteor_broken)); opL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 2: opL.add(new ItemStack(ModBlocks.block_meteor_cobble)); opL.add(new ItemStack(ModBlocks.block_meteor_broken)); break; } List ipL = new ArrayList(); switch(innerPadding) { case 0: for(int i = 0; i < 99; i++) ipL.add(new ItemStack(ModBlocks.block_meteor_broken)); ipL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 1: ipL.add(new ItemStack(Blocks.stone)); break; case 2: ipL.add(new ItemStack(Blocks.netherrack)); break; } List coreL = new ArrayList(); switch(core) { case 0: coreL.add(new ItemStack(ModBlocks.block_meteor)); break; case 1: coreL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 2: coreL.addAll(this.getRandomOre(rand)); break; } List sCore = new ArrayList(); switch(core) { case 0: sCore.add(new ItemStack(ModBlocks.block_meteor)); break; case 1: sCore.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 2: sCore.add(new ItemStack(ModBlocks.block_meteor_treasure)); sCore.add(new ItemStack(ModBlocks.block_meteor)); break; } switch(rand.nextInt(6)) { case 0: genM1(world, rand, x, y, z, hullL, opL, ipL, sCore); break; case 1: genM2(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 2: genM3(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 3: genM4(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 4: genM5(world, rand, x, y, z, hullL, opL, ipL, coreL); break; case 5: genM6(world, rand, x, y, z, hullL, opL, ipL, coreL); break; } } public void generateSmall(World world, Random rand, int x, int y, int z) { //0 - Molten //1 - Cobble //2 - Broken //3 - Mix int hull = rand.nextInt(4); //0 - Meteor //1 - Treasure //2 - Ore int core = rand.nextInt(3); List hullL = new ArrayList(); switch(hull) { case 0: hullL.add(new ItemStack(ModBlocks.block_meteor_molten)); break; case 1: hullL.add(new ItemStack(ModBlocks.block_meteor_cobble)); break; case 2: for(int i = 0; i < 99; i++) hullL.add(new ItemStack(ModBlocks.block_meteor_broken)); hullL.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 3: hullL.add(new ItemStack(ModBlocks.block_meteor_molten)); hullL.add(new ItemStack(ModBlocks.block_meteor_broken)); break; } List sCore = new ArrayList(); switch(core) { case 0: sCore.add(new ItemStack(ModBlocks.block_meteor)); break; case 1: sCore.add(new ItemStack(ModBlocks.block_meteor_treasure)); break; case 2: sCore.add(new ItemStack(ModBlocks.block_meteor_treasure)); sCore.add(new ItemStack(ModBlocks.block_meteor)); break; } generateBox(world, rand, x, y, z, hullL); ItemStack stack = sCore.get(rand.nextInt(sCore.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genL1(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere7x7(world, rand, x, y, z, hull); generateStar5x5(world, rand, x, y, z, op); generateStar3x3(world, rand, x, y, z, ip); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genL2(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere7x7(world, rand, x, y, z, hull); generateSphere5x5(world, rand, x, y, z, op); generateStar3x3(world, rand, x, y, z, ip); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genL3(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere7x7(world, rand, x, y, z, hull); generateSphere5x5(world, rand, x, y, z, op); generateBox(world, rand, x, y, z, ip); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genL4(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere7x7(world, rand, x, y, z, hull); generateSphere5x5(world, rand, x, y, z, op); generateBox(world, rand, x, y, z, ip); generateStar3x3(world, rand, x, y, z, this.getRandomOre(rand)); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genL5(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere7x7(world, rand, x, y, z, hull); generateSphere5x5(world, rand, x, y, z, op); generateStar5x5(world, rand, x, y, z, ip); generateStar3x3(world, rand, x, y, z, this.getRandomOre(rand)); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genM1(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere5x5(world, rand, x, y, z, hull); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genM2(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere5x5(world, rand, x, y, z, hull); generateStar3x3(world, rand, x, y, z, op); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genM3(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere5x5(world, rand, x, y, z, hull); generateBox(world, rand, x, y, z, op); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genM4(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere5x5(world, rand, x, y, z, hull); generateBox(world, rand, x, y, z, op); generateStar3x3(world, rand, x, y, z, ip); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genM5(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere5x5(world, rand, x, y, z, hull); generateBox(world, rand, x, y, z, ip); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void genM6(World world, Random rand, int x, int y, int z, List hull, List op, List ip, List core) { generateSphere5x5(world, rand, x, y, z, hull); generateBox(world, rand, x, y, z, ip); generateStar3x3(world, rand, x, y, z, this.getRandomOre(rand)); ItemStack stack = core.get(rand.nextInt(core.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void generateSphere7x7(World world, Random rand, int x, int y, int z, List set) { for(int a = -3; a < 4; a++) for(int b = -1; b < 2; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -3; b < 4; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -1; b < 2; b++) for(int c = -3; c < 4; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -2; a < 3; a++) for(int b = -2; b < 3; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -2; b < 3; b++) for(int c = -2; c < 3; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -2; a < 3; a++) for(int b = -1; b < 2; b++) for(int c = -2; c < 3; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } } public void generateSphere5x5(World world, Random rand, int x, int y, int z, List set) { for(int a = -2; a < 3; a++) for(int b = -1; b < 2; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -2; b < 3; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -1; b < 2; b++) for(int c = -2; c < 3; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } } public void generateSphere9x9(World world, Random rand, int x, int y, int z, List set) { for(int a = -4; a < 5; a++) for(int b = -1; b < 2; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -4; b < 5; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -1; b < 2; b++) for(int c = -4; c < 5; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -1; a < 2; a++) for(int b = -3; b < 4; b++) for(int c = -3; c < 4; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -3; a < 4; a++) for(int b = -1; b < 2; b++) for(int c = -3; c < 4; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -3; a < 4; a++) for(int b = -3; b < 4; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -3; a < 4; a++) for(int b = -2; b < 3; b++) for(int c = -2; c < 3; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -2; a < 3; a++) for(int b = -3; b < 4; b++) for(int c = -2; c < 3; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } for(int a = -2; a < 3; a++) for(int b = -2; b < 3; b++) for(int c = -3; c < 4; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } } public void generateBox(World world, Random rand, int x, int y, int z, List set) { for(int a = -1; a < 2; a++) for(int b = -1; b < 2; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } } public void generateStar5x5(World world, Random rand, int x, int y, int z, List set) { for(int a = -1; a < 2; a++) for(int b = -1; b < 2; b++) for(int c = -1; c < 2; c++) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + a, y + b, z + c, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x + 2, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x - 2, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y + 2, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y - 2, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y, z + 2, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y, z - 2, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public void generateStar3x3(World world, Random rand, int x, int y, int z, List set) { ItemStack stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x + 1, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x - 1, y, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y + 1, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y - 1, z, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y, z + 1, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); stack = set.get(rand.nextInt(set.size())); world.setBlock(x, y, z - 1, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 2); } public List getRandomOre(Random rand) { List ores = new ArrayList(); String[] names = OreDictionary.getOreNames(); for(int i = 0; i < names.length; i++) { if(names[i].length() > 3 && names[i].substring(0, 3).equals("ore")) { List ota = OreDictionary.getOres(names[i]); for(int j = 0; j < ota.size(); j++) { ItemStack stack = ota.get(j); if(Block.getBlockFromItem(stack.getItem()) != null) ores.add(stack.copy()); } } } switch(rand.nextInt(15)) { case 0: List list1 = new ArrayList(); list1.add(new ItemStack(ModBlocks.ore_rare, 1).copy()); return list1; case 1: List list2 = new ArrayList(); list2.add(new ItemStack(ModBlocks.ore_uranium, 1).copy()); return list2; case 2: List list3 = new ArrayList(); list3.add(new ItemStack(ModBlocks.ore_reiium, 1).copy()); list3.add(new ItemStack(ModBlocks.ore_weidanium, 1).copy()); list3.add(new ItemStack(ModBlocks.ore_australium, 1).copy()); list3.add(new ItemStack(ModBlocks.ore_unobtainium, 1).copy()); list3.add(new ItemStack(ModBlocks.ore_daffergon, 1).copy()); list3.add(new ItemStack(ModBlocks.ore_verticium, 1).copy()); return list3; case 3: List list4 = new ArrayList(); list4.add(new ItemStack(ModBlocks.ore_nether_fire, 1).copy()); list4.add(new ItemStack(ModBlocks.ore_nether_plutonium, 1).copy()); list4.add(new ItemStack(ModBlocks.ore_nether_schrabidium, 1).copy()); list4.add(new ItemStack(ModBlocks.ore_nether_sulfur, 1).copy()); list4.add(new ItemStack(ModBlocks.ore_nether_tungsten, 1).copy()); list4.add(new ItemStack(ModBlocks.ore_nether_uranium, 1).copy()); return list4; } if(ores.isEmpty()) { List list = new ArrayList(); list.add(new ItemStack(Blocks.iron_ore, 1).copy()); return list; } else { return ores; } } }