Tidying up from merge some

Switching hivegen to respect isGenMineableReplaceable for crazy mods like underground biomes.
This commit is contained in:
MysteriousAges committed 2014-01-18 12:44:14 -08:00
1 parent 2146249b9c
commit 85f8ab960d
10 files changed
+142 -122

No files matched your search

@@ -386,7 +386,7 @@
<entry key="magicbees.speciesTEDante">Dante</entry>
<entry key="magicbees.speciesTEDante.description">Mixing bees in an inferno produces surprising results.|Apinomicon</entry>
<entry key="magicbees.speciesTEPyro">Pyro</entry>
<entry key="magicbees.speciesTEPyro.description">"You Monster"|Apinomicon</entry>
<entry key="magicbees.speciesTEPyro.description">You Monster.|Everyone, to you.</entry>
<entry key="magicbees.speciesTEDante">Dante</entry>
<entry key="magicbees.speciesTEDante.description">Mixing bees in an inferno produces surprising results.|Apinomicon</entry>
<entry key="magicbees.speciesTEElectrum">Electrum</entry>
@@ -420,6 +420,7 @@
-->
<!-- Bee Alleles -->
<entry key="magicbees.speedBlinding">Blinding</entry>
<entry key="magicbees.effectCurative">Cleansing</entry>
<entry key="magicbees.effectDigSpeed">Mining</entry>
<entry key="magicbees.effectMoveSpeed">Swiftness</entry>
@@ -439,7 +440,8 @@
<entry key="magicbees.effectSpidery">Spidery</entry>
<entry key="magicbees.effectAblaze">Ablaze</entry>
<entry key="magicbees.effectManaDrainer">Vortex</entry>
<entry key="magicbees.effectAMWisp">Spiritual</entry>
<entry key="magicbees.effectAMWisp">Spiritual</entry>
<entry key="magicbees.effectTEBlizzy">Blizzy</entry>
<entry key="flowerProvider.book">Books</entry>
<entry key="flowerProvider.magic">Thaumic Flowers</entry>
<entry key="flowerProvider.arsmagica">Exotic Flowers</entry>
-3
View File
@@ -1,3 +0,0 @@
#Build Number for ANT. Do not edit!
#Thu Jan 16 14:17:04 CST 2014
build.number=21
+2 -2
View File
@@ -4,7 +4,7 @@
<property name="resource.dir" value="${build.dir}/mc.dev" />
<property name="jar.dir" value="build/jar" />
<property name="src.dir" value="Sources/Minecraft" />
<property name="src.dir" value="Sources/MagicBees" />
<property name="forge.dir" value="${build.dir}/forge" />
<property name="mcp.dir" value="${forge.dir}/mcp" />
@@ -15,7 +15,7 @@
<property name="mc.version" value="1.6.2"/>
<property name="forge.version" value="9.10.1.849"/>
<property name="magicbees.version" value="2.1.10"/>
<property name="magicbees.version" value="2.1.12"/>
<!-- TARGETS -->
<target name="clean">
+4
View File
@@ -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!
+1 -1
View File
@@ -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
+17 -23
View File
@@ -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");
}
}
+37 -39
View File
@@ -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;
@@ -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);
@@ -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);
}
}
@@ -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);
}
}