Changed how wasp spawners generate

This commit is contained in:
Matt Caughey 2013-10-29 15:31:35 -04:00
parent 442fc76cd3
commit f370a1291d
2 changed files with 12 additions and 16 deletions

View File

@ -68,15 +68,6 @@ public class WorldGenHive extends WorldGenerator
public void generateHiveCube(World world, int origx, int origy, int origz, int height, int width, int cubeno, float chance, int honeychance) public void generateHiveCube(World world, int origx, int origy, int origz, int height, int width, int cubeno, float chance, int honeychance)
{ {
world.setBlock(origx, origy - (height / 2), origz, Block.mobSpawner.blockID);
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)world.getBlockTileEntity(origx, origy - (height / 2), origz);
if (tileentitymobspawner != null)
{
tileentitymobspawner.getSpawnerLogic().setMobID("BiomesOPlenty.Wasp");
}
for (int hLayer = 0; hLayer < height; hLayer++) for (int hLayer = 0; hLayer < height; hLayer++)
{ {
for (int i = -width; i < width; i++) for (int i = -width; i < width; i++)
@ -125,15 +116,20 @@ public class WorldGenHive extends WorldGenerator
{ {
for (int spawn = 0; spawn < amount; spawn++) for (int spawn = 0; spawn < amount; spawn++)
{ {
int spawnx = (x - 4) + rand.nextInt(8); int spawnx = (x - 8) + rand.nextInt(16);
int spawny = (y - 6) - rand.nextInt(4); int spawny = (y + 2) - rand.nextInt(16);
int spawnz = (z - 4) + rand.nextInt(8); int spawnz = (z - 8) + rand.nextInt(16);
if (world.isAirBlock(spawnx, spawny, spawnz)) if (world.getBlockId(spawnx, spawny, spawnz) == Blocks.hive.get().blockID)
{ {
EntityWasp wasp = new EntityWasp(world); world.setBlock(spawnx, spawny, spawnz, Block.mobSpawner.blockID);
wasp.setLocationAndAngles((double)spawnx, (double)spawny, (double)spawnz, 0.0F, 0.0F);
world.spawnEntityInWorld(wasp); TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)world.getBlockTileEntity(spawnx, spawny, spawnz);
if (tileentitymobspawner != null)
{
tileentitymobspawner.getSpawnerLogic().setMobID("BiomesOPlenty.Wasp");
}
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B