diff --git a/magicbees_res/assets/magicbees/lang/en_US.xml b/magicbees_res/assets/magicbees/lang/en_US.xml index 8464c85..a050b92 100644 --- a/magicbees_res/assets/magicbees/lang/en_US.xml +++ b/magicbees_res/assets/magicbees/lang/en_US.xml @@ -386,7 +386,7 @@ Dante Mixing bees in an inferno produces surprising results.|Apinomicon Pyro - "You Monster"|Apinomicon + You Monster.|Everyone, to you. Dante Mixing bees in an inferno produces surprising results.|Apinomicon Electrum @@ -420,6 +420,7 @@ --> + Blinding Cleansing Mining Swiftness @@ -439,7 +440,8 @@ Spidery Ablaze Vortex - Spiritual + Spiritual + Blizzy Books Thaumic Flowers Exotic Flowers diff --git a/magicbees_res/build.number b/magicbees_res/build.number deleted file mode 100644 index fc4f67c..0000000 --- a/magicbees_res/build.number +++ /dev/null @@ -1,3 +0,0 @@ -#Build Number for ANT. Do not edit! -#Thu Jan 16 14:17:04 CST 2014 -build.number=21 diff --git a/magicbees_res/build.xml b/magicbees_res/build.xml index a33312a..9bc96ce 100644 --- a/magicbees_res/build.xml +++ b/magicbees_res/build.xml @@ -4,7 +4,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/magicbees_res/changelog.txt b/magicbees_res/changelog.txt index 662e685..23e55fa 100644 --- a/magicbees_res/changelog.txt +++ b/magicbees_res/changelog.txt @@ -1,5 +1,9 @@ +2.1.12 +Changing hive gen to use isGenMineableReplaceable, which should make Deep hives spawn in Underground Biomes stone. + 2.1.11 Thermal Expansion & Redstone Arsenal bees, courtesy of jadedcat. +Adding missing loc string for Blinding speed allele 2.1.10 Changing Aluminum bees to use changed ore dictionary entries. mDiyo Houuuuuuuuuuuuuuuuuse! diff --git a/magicbees_src/magicbees/bees/Allele.java b/magicbees_src/magicbees/bees/Allele.java index 592a708..537ac6f 100644 --- a/magicbees_src/magicbees/bees/Allele.java +++ b/magicbees_src/magicbees/bees/Allele.java @@ -100,7 +100,7 @@ public class Allele implements IAllele if (ThermalExpansionHelper.isActive()) { - Allele.spawnBlizz = new AlleleEffectSpawnMob("Blizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID) + Allele.spawnBlizz = new AlleleEffectSpawnMob("TEBlizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID) .setThrottle(100).setChanceToSpawn(80); } else diff --git a/magicbees_src/magicbees/bees/BeeMutation.java b/magicbees_src/magicbees/bees/BeeMutation.java index cb4ecd0..e278338 100644 --- a/magicbees_src/magicbees/bees/BeeMutation.java +++ b/magicbees_src/magicbees/bees/BeeMutation.java @@ -235,62 +235,56 @@ public class BeeMutation implements IBeeMutation { new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8); } + if (RedstoneArsenalHelper.isActive()) { new BeeMutation(BeeSpecies.TE_ELECTRUM, BeeSpecies.TE_DESTABILIZED, BeeSpecies.RSA_FLUXED, 10) - .setBlockRequired("blockElectrumFlux"); - - + .setBlockRequired("blockElectrumFlux"); } if (ThermalExpansionHelper.isActive()) { new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12) - .setBlockRequired("blockBronze"); + .setBlockRequired("blockBronze"); new BeeMutation(BeeSpecies.GOLD, BeeSpecies.SILVER, BeeSpecies.TE_ELECTRUM, 10) - .setBlockRequired("blockElectrum"); + .setBlockRequired("blockElectrum"); new BeeMutation(BeeSpecies.IRON, BeeSpecies.ESOTERIC, BeeSpecies.TE_NICKEL, 14) - .setBlockRequired("blockNickel"); + .setBlockRequired("blockNickel"); new BeeMutation(BeeSpecies.IRON, BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, 14) - .setBlockRequired("blockInvar"); + .setBlockRequired("blockInvar"); new BeeMutation(BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, BeeSpecies.TE_PLATINUM, 10) - .setBlockRequired("blockPlatinum"); + .setBlockRequired("blockPlatinum"); new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12) - .setBlockRequired("blockBronze"); + .setBlockRequired("blockBronze"); new BeeMutation(BeeSpecies.SPITEFUL, BeeSpecies.TIN, BeeSpecies.TE_COAL, 12) - .setBlockRequired(Block.oreCoal); + .setBlockRequired(Block.oreCoal); new BeeMutation(BeeSpecies.SPITEFUL, Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED, 12) - .setBlockRequired(Block.oreRedstone); + .setBlockRequired(Block.oreRedstone); new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.INFERNAL, BeeSpecies.TE_LUX, 12) - .setBlockRequired(Block.glowStone); + .setBlockRequired(Block.glowStone); new BeeMutation(BeeSpecies.SMOULDERING, Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE, 12) - .setBiomeRequired(BiomeDictionary.Type.NETHER); + .setBiomeRequired(BiomeDictionary.Type.NETHER); new BeeMutation(BeeSpecies.TE_DANTE, BeeSpecies.TE_COAL, BeeSpecies.TE_PYRO, 8) - .setBiomeRequired(BiomeDictionary.Type.NETHER); + .setBiomeRequired(BiomeDictionary.Type.NETHER); new BeeMutation(BeeSpecies.SKULKING, Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY, 12); - - + new BeeMutation(BeeSpecies.TE_BLIZZY, Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID, 8); - - + new BeeMutation(BeeSpecies.TE_PLATINUM, BeeSpecies.OBLIVION, BeeSpecies.TE_WINSOME, 12); - - + new BeeMutation(BeeSpecies.TE_WINSOME, BeeSpecies.TE_COAL, BeeSpecies.TE_ENDEARING, 8) - .setBlockRequired("blockEnderium"); - - + .setBlockRequired("blockEnderium"); } } diff --git a/magicbees_src/magicbees/bees/BeeSpecies.java b/magicbees_src/magicbees/bees/BeeSpecies.java index 9d626a3..4591f23 100644 --- a/magicbees_src/magicbees/bees/BeeSpecies.java +++ b/magicbees_src/magicbees/bees/BeeSpecies.java @@ -812,7 +812,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider } TE_ELECTRUM.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTEElectrum()); + .setGenome(BeeGenomeManager.getTemplateTEElectrum()); if (OreDictionary.getOres("nuggetElectrum").size() > 0) { TE_ELECTRUM.addSpecialty(OreDictionary.getOres("nuggetElectrum").get(0), 18); @@ -825,7 +825,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TE_PLATINUM.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTEPlatinum()); + .setGenome(BeeGenomeManager.getTemplateTEPlatinum()); if (OreDictionary.getOres("nuggetPlatinum").size() > 0) { TE_PLATINUM.addSpecialty(OreDictionary.getOres("nuggetPlatinum").get(0), 18); @@ -838,7 +838,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TE_NICKEL.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTENickel()); + .setGenome(BeeGenomeManager.getTemplateTENickel()); if (OreDictionary.getOres("nuggetNickel").size() > 0) { TE_NICKEL.addSpecialty(OreDictionary.getOres("nuggetNickel").get(0), 18); @@ -851,7 +851,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TE_INVAR.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTEInvar()); + .setGenome(BeeGenomeManager.getTemplateTEInvar()); if (OreDictionary.getOres("nuggetInvar").size() > 0) { TE_INVAR.addSpecialty(OreDictionary.getOres("nuggetInvar").get(0), 18); @@ -864,7 +864,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TE_BRONZE.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTEBronze()); + .setGenome(BeeGenomeManager.getTemplateTEBronze()); if (OreDictionary.getOres("nuggetBronze").size() > 0) { TE_BRONZE.addSpecialty(OreDictionary.getOres("nuggetBronze").get(0), 18); @@ -877,7 +877,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider RSA_FLUXED.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateRSAFluxed()); + .setGenome(BeeGenomeManager.getTemplateRSAFluxed()); if (OreDictionary.getOres("nuggetElectrumFlux").size() > 0) { RSA_FLUXED.addSpecialty(OreDictionary.getOres("nuggetElectrumFlux").get(0), 18); @@ -890,56 +890,54 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TE_DANTE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 10) - .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 10) - .addSpecialty(new ItemStack(Item.blazePowder), 5) - .setGenome(BeeGenomeManager.getTemplateTEDante()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 10) + .addSpecialty(new ItemStack(Item.blazePowder), 5) + .setGenome(BeeGenomeManager.getTemplateTEDante()) + .register(); TE_PYRO.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 10) - .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 10) - .addSpecialty(new ItemStack(Item.blazePowder), 5) - .setGenome(BeeGenomeManager.getTemplateTEPyro()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 10) + .addSpecialty(new ItemStack(Item.blazePowder), 5) + .setGenome(BeeGenomeManager.getTemplateTEPyro()) + .register(); TE_DESTABILIZED.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 10) - .addProduct(Config.combs.getStackForType(CombType.OCCULT), 10) - .addSpecialty(new ItemStack(Item.redstone), 5) - .setGenome(BeeGenomeManager.getTemplateTEDestabilized()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.OCCULT), 10) + .addSpecialty(new ItemStack(Item.redstone), 5) + .setGenome(BeeGenomeManager.getTemplateTEDestabilized()) + .register(); TE_LUX.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 10) - .addProduct(Config.combs.getStackForType(CombType.OCCULT), 10) - .addSpecialty(new ItemStack(Item.glowstone), 5) - .setGenome(BeeGenomeManager.getTemplateTELux()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.OCCULT), 10) + .addSpecialty(new ItemStack(Item.glowstone), 5) + .setGenome(BeeGenomeManager.getTemplateTELux()) + .register(); TE_WINSOME.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 10) - .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 5) - .addSpecialty(new ItemStack(Item.enderPearl), 5) - .setGenome(BeeGenomeManager.getTemplateTEWinsome()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 5) + .addSpecialty(new ItemStack(Item.enderPearl), 5) + .setGenome(BeeGenomeManager.getTemplateTEWinsome()) + .register(); TE_ENDEARING.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 10) - .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 5) - .setGenome(BeeGenomeManager.getTemplateTEEndearing()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 5) + .setGenome(BeeGenomeManager.getTemplateTEEndearing()) + .register(); TE_COAL.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.HONEY.ordinal()), 10) - .addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 5) - .addSpecialty(new ItemStack(Item.coal), 5) - .setGenome(BeeGenomeManager.getTemplateTECoal()) - .register(); + .addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 5) + .addSpecialty(new ItemStack(Item.coal), 5) + .setGenome(BeeGenomeManager.getTemplateTECoal()) + .register(); TE_BLIZZY.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTEBlizzy()) - .register(); + .setGenome(BeeGenomeManager.getTemplateTEBlizzy()) + .register(); TE_GELID.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 10) - .setGenome(BeeGenomeManager.getTemplateTEGelid()) - .register(); + .setGenome(BeeGenomeManager.getTemplateTEGelid()) + .register(); } - - private String binomial; diff --git a/magicbees_src/magicbees/block/types/HiveType.java b/magicbees_src/magicbees/block/types/HiveType.java index 8cc9481..661c320 100644 --- a/magicbees_src/magicbees/block/types/HiveType.java +++ b/magicbees_src/magicbees/block/types/HiveType.java @@ -240,7 +240,7 @@ public enum HiveType } break; case RESONANT: - for (int i = 0; i < 2; ++i) + for (int i = 0; i < 3; ++i) { int coordX = chunkX * 16 + random.nextInt(16); int coordZ = chunkZ * 16 + random.nextInt(16); diff --git a/magicbees_src/magicbees/world/feature/FeatureHive.java b/magicbees_src/magicbees/world/feature/FeatureHive.java index 6b4a456..1d855bb 100644 --- a/magicbees_src/magicbees/world/feature/FeatureHive.java +++ b/magicbees_src/magicbees/world/feature/FeatureHive.java @@ -19,14 +19,14 @@ public class FeatureHive private static FeatureOreVein glowstoneGen; private static FeatureOreVein endStoneGen; - private static boolean logSpawns = false; + private static boolean logSpawns = true; public static void initialize() { - redstoneGen = new FeatureOreVein(Block.oreRedstone.blockID, Block.stone); - netherQuartzGen = new FeatureOreVein(Block.oreNetherQuartz.blockID, Block.netherrack); - glowstoneGen = new FeatureOreVein(Block.glowStone.blockID, Block.stone); - endStoneGen = new FeatureOreVein(Block.whiteStone.blockID, Block.stone); + redstoneGen = new FeatureOreVein(Block.oreRedstone, Block.stone); + netherQuartzGen = new FeatureOreVein(Block.oreNetherQuartz, Block.netherrack); + glowstoneGen = new FeatureOreVein(Block.glowStone, Block.stone); + endStoneGen = new FeatureOreVein(Block.whiteStone, Block.stone); } public static void generateHives(World world, Random random, int chunkX, int chunkZ, boolean initialGen) @@ -43,7 +43,8 @@ public class FeatureHive boolean doSpawn = false; Block b = Block.blocksList[world.getBlockId(coordX, coordY + 1, coordZ)]; - if (world.isAirBlock(coordX, coordY - 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) && + if (world.isAirBlock(coordX, coordY - 1, coordZ) && + world.isAirBlock(coordX, coordY, coordZ) && b != null && b.isLeaves(world, coordX, coordY + 1, coordZ)) { world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.CURIOUS.ordinal(), 3); @@ -59,8 +60,9 @@ public class FeatureHive int coordY = getHeight(world, random, coordX, coordZ); boolean doSpawn = false; - if (world.isAirBlock(coordX, coordY + 1, coordZ) && world.isAirBlock(coordX, coordY, coordZ) && - GlobalManager.dirtBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ)) ) + if (world.isAirBlock(coordX, coordY + 1, coordZ) && + world.isAirBlock(coordX, coordY, coordZ) && + canBlockReplaceAt(world, coordX, coordY - 1, coordZ, Block.dirt)) { doSpawn = true; } @@ -78,10 +80,10 @@ public class FeatureHive { int coordY = getHeight(world, random, coordX, coordZ); boolean doSpawn = false; - if (world.isAirBlock(coordX, coordY + 1, coordZ) && - (world.isAirBlock(coordX, coordY, coordZ) || world.getBlockId(coordX, coordY, coordZ) == Block.tallGrass.blockID) && - (GlobalManager.dirtBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ)) || - GlobalManager.sandBlockIds.contains(world.getBlockId(coordX, coordY - 1, coordZ))) ) + if (world.rand.nextInt() < 40 && world.isAirBlock(coordX, coordY + 1, coordZ) && + (world.isAirBlock(coordX, coordY, coordZ) || canBlockReplaceAt(world, coordX, coordY, coordZ, Block.tallGrass)) && + (canBlockReplaceAt(world, coordX, coordY - 1, coordZ, Block.dirt) || + canBlockReplaceAt(world, coordX, coordY - 1, coordZ, Block.sand))) { doSpawn = true; } @@ -104,8 +106,7 @@ public class FeatureHive boolean doSpawn = false; if (random.nextInt(100) < 40 && - !world.isAirBlock(coordX, coordY, coordZ) && - world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID) + !world.isAirBlock(coordX, coordY, coordZ) && canBlockReplaceAt(world, coordX, coordY, coordZ, Block.stone)) { doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.stone) >= 6; } @@ -135,7 +136,8 @@ public class FeatureHive int chop = random.nextInt(2) + 1; int coordY = random.nextInt(60 / chop) + random.nextInt(chop) * (120 / chop) - 5; - if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.netherrack.blockID) + if (!world.isAirBlock(coordX, coordY, coordZ) && Block.blocksList[world.getBlockId(coordX, coordY, coordZ)] != null && + Block.blocksList[world.getBlockId(coordX, coordY, coordZ)].isGenMineableReplaceable(world, coordX, coordY, coordZ, Block.netherrack.blockID)) { doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.netherrack) >= 5; } @@ -153,11 +155,12 @@ public class FeatureHive netherQuartzGen.generateVein(world, random, coordX, coordY, coordZ - 1, 4); } } - else if (MagicBees.getConfig().DoSpecialHiveGen) + else if (MagicBees.getConfig().DoSpecialHiveGen && world.rand.nextInt() < 11) { int coordY = random.nextInt(13) + 5; - if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID) + if (!world.isAirBlock(coordX, coordY, coordZ) && + canBlockReplaceAt(world, coordX, coordY, coordZ, Block.stone)) { doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.stone) >= 6; @@ -168,20 +171,23 @@ public class FeatureHive world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.INFERNAL.ordinal(), 3); if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Infernal", coordX, coordZ, coordY); - glowstoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, 2); - glowstoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, 2); - if (world.getBlockId(coordX, coordY + 1, coordZ) == Block.stone.blockID || - world.getBlockId(coordX, coordY + 1, coordZ) == Block.netherrack.blockID) + glowstoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, world.rand.nextInt(4) + 1); + glowstoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, world.rand.nextInt(4) + 1); + + if (canBlockReplaceAt(world, coordX, coordY + 1, coordZ, Block.stone) || + canBlockReplaceAt(world, coordX, coordY + 1, coordZ, Block.netherrack)) { world.setBlock(coordX, coordY + 1, coordZ, Block.glowStone.blockID, 0, 3); } - if (world.getBlockId(coordX, coordY - 1, coordZ) == Block.stone.blockID || - world.getBlockId(coordX, coordY + 1, coordZ) == Block.netherrack.blockID) + + if (canBlockReplaceAt(world, coordX, coordY - 1, coordZ, Block.stone) || + canBlockReplaceAt(world, coordX, coordY + 1, coordZ, Block.netherrack)) { world.setBlock(coordX, coordY - 1, coordZ, Block.glowStone.blockID, 0, 3); } - glowstoneGen.generateVein(world, random, coordX, coordY, coordZ + 1, 2); - glowstoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, 2); + + glowstoneGen.generateVein(world, random, coordX, coordY, coordZ + 1, world.rand.nextInt(4) + 1); + glowstoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, world.rand.nextInt(4) + 1); } } @@ -197,8 +203,8 @@ public class FeatureHive int coordY = 10 + random.nextInt(25); if (world.isAirBlock(coordX, coordY - 2, coordZ) && - world.getBlockId(coordX, coordY - 1, coordZ) == Block.whiteStone.blockID && - world.getBlockId(coordX, coordY, coordZ) == Block.whiteStone.blockID) + canBlockReplaceAt(world, coordX, coordY - 1, coordZ, Block.whiteStone) && + canBlockReplaceAt(world, coordX, coordY, coordZ, Block.whiteStone)) { doSpawn = true; } @@ -216,7 +222,7 @@ public class FeatureHive } } } - else if (MagicBees.getConfig().DoSpecialHiveGen) + else if (MagicBees.getConfig().DoSpecialHiveGen && world.rand.nextInt() < 8) { // 1 per gen int coordY = random.nextInt(5) + 5; @@ -225,8 +231,9 @@ public class FeatureHive { --coordY; - if (!world.isAirBlock(coordX, coordY, coordZ) && world.getBlockId(coordX, coordY, coordZ) == Block.stone.blockID || - world.getBlockId(coordX, coordY + 1, coordZ) == Block.whiteStone.blockID) + if (!world.isAirBlock(coordX, coordY, coordZ) && + canBlockReplaceAt(world, coordX, coordY, coordZ, Block.stone) || + canBlockReplaceAt(world, coordX, coordY, coordZ, Block.whiteStone)) { doSpawn = getSurroundCount(world, coordX, coordY, coordZ, Block.whiteStone) >= 5 || getSurroundCount(world, coordX, coordY, coordZ, Block.stone) >= 5; @@ -239,12 +246,12 @@ public class FeatureHive world.setBlock(coordX, coordY, coordZ, Config.hive.blockID, HiveType.OBLIVION.ordinal(), 3); if (logSpawns) FMLLog.info("Spawning %s hive at: X %d, Z %d, Y %d", "Oblivion", coordX, coordZ, coordY); - endStoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, 3); - endStoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, 3); - endStoneGen.generateVein(world, random, coordX, coordY + 1, coordZ, 2); - endStoneGen.generateVein(world, random, coordX, coordY - 1, coordZ, 2); - endStoneGen.generateVein(world, random, coordX, coordY, coordZ + 1, 3); - endStoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, 3); + endStoneGen.generateVein(world, random, coordX + 1, coordY, coordZ, world.rand.nextInt(6) + 1); + endStoneGen.generateVein(world, random, coordX - 1, coordY, coordZ, world.rand.nextInt(6) + 1); + endStoneGen.generateVein(world, random, coordX, coordY + 1, coordZ, world.rand.nextInt(3) + 1); + endStoneGen.generateVein(world, random, coordX, coordY - 1, coordZ, world.rand.nextInt(3) + 1); + endStoneGen.generateVein(world, random, coordX, coordY, coordZ + 1, world.rand.nextInt(6) + 1); + endStoneGen.generateVein(world, random, coordX, coordY, coordZ - 1, world.rand.nextInt(6) + 1); } } return doSpawn; @@ -261,35 +268,47 @@ public class FeatureHive return min + random.nextInt(max); } + // Determines if surrounding material is "equivalent" to provided block using isGenMineableReplaceable. private static int getSurroundCount(World world, int x, int y, int z, Block blockType) { int surroundCount = 0; - if (world.getBlockId(x+1, y, z) == blockType.blockID) + if (canBlockReplaceAt(world, x+1, y, z, blockType)) { ++surroundCount; } - if (world.getBlockId(x-1, y, z) == blockType.blockID) + + if (canBlockReplaceAt(world, x-1, y, z, blockType)) { ++surroundCount; } - if (world.getBlockId(x, y+1, z) == blockType.blockID) + + if (canBlockReplaceAt(world, x, y+1, z, blockType)) { ++surroundCount; } - if (world.getBlockId(x, y-1, z) == blockType.blockID) + + if (canBlockReplaceAt(world, x, y-1, z, blockType)) { ++surroundCount; } - if (world.getBlockId(x, y, z+1) == blockType.blockID) + + if (canBlockReplaceAt(world, x, y, z+1, blockType)) { ++surroundCount; } - if (world.getBlockId(x, y, z-1) == blockType.blockID) + + if (canBlockReplaceAt(world, x, y, z-1, blockType)) { ++surroundCount; } return surroundCount; } + + private static boolean canBlockReplaceAt(World world, int x, int y, int z, Block block) + { + return Block.blocksList[world.getBlockId(x, y, z)] != null && + Block.blocksList[world.getBlockId(x, y, z)].isGenMineableReplaceable(world, x, y, z, block.blockID); + } } diff --git a/magicbees_src/magicbees/world/feature/FeatureOreVein.java b/magicbees_src/magicbees/world/feature/FeatureOreVein.java index cb4c375..8cf4e6a 100644 --- a/magicbees_src/magicbees/world/feature/FeatureOreVein.java +++ b/magicbees_src/magicbees/world/feature/FeatureOreVein.java @@ -9,20 +9,20 @@ import net.minecraftforge.common.ForgeDirection; public class FeatureOreVein { - private int veinBlockId; + private Block veinBlock; private int veinBlockMeta; - private int replacesBlockId; + private Block replacesBlock; - public FeatureOreVein(int blockId, Block replacesBlock) + public FeatureOreVein(Block block, Block replacesBlock) { - this(blockId, 0, replacesBlock); + this(block, 0, replacesBlock); } - public FeatureOreVein(int blockId, int meta, Block replacesBlock) + public FeatureOreVein(Block block, int meta, Block replacesBlock) { - this.veinBlockId = blockId; + this.veinBlock = block; this.veinBlockMeta = meta; - this.replacesBlockId = replacesBlock.blockID; + this.replacesBlock = replacesBlock; } public void generateVein(World world, Random random, int startX, int startY, int startZ, int maxSpawnCount) @@ -37,9 +37,9 @@ public class FeatureOreVein { ++spawnAttempts; - if (!world.isAirBlock(currentX, currentY, currentZ) && world.getBlockId(currentX, currentY, currentZ) == replacesBlockId) + if (!world.isAirBlock(currentX, currentY, currentZ) && canBlockReplaceAt(world, currentX, currentY, currentZ, replacesBlock)) { - world.setBlock(currentX, currentY, currentZ, this.veinBlockId, this.veinBlockMeta, 2); + world.setBlock(currentX, currentY, currentZ, this.veinBlock.blockID, this.veinBlockMeta, 2); ++spawnCount; } @@ -66,4 +66,10 @@ public class FeatureOreVein } } } + + private static boolean canBlockReplaceAt(World world, int x, int y, int z, Block block) + { + return Block.blocksList[world.getBlockId(x, y, z)] != null && + Block.blocksList[world.getBlockId(x, y, z)].isGenMineableReplaceable(world, x, y, z, block.blockID); + } }