mob spawning

This commit is contained in:
bconlon 2020-12-28 16:47:43 -08:00
parent f5a637e91c
commit 531a65e9e3
7 changed files with 18 additions and 11 deletions

View file

@ -50,8 +50,9 @@ public class EntityAechorPlant extends EntityAetherAnimal {
} }
@Override @Override
public int getMaxSpawnedInChunk() { public boolean getCanSpawnHere()
return 3; {
return this.rand.nextInt(15) == 0 && super.getCanSpawnHere();
} }
@Override @Override

View file

@ -48,7 +48,7 @@ public class EntityCockatrice extends EntityMob {
@Override @Override
public boolean getCanSpawnHere() { public boolean getCanSpawnHere() {
return this.rand.nextInt(25) == 0 && super.getCanSpawnHere(); return this.rand.nextInt(5) == 0 && super.getCanSpawnHere();
} }
@Override @Override

View file

@ -345,7 +345,7 @@ public class EntityWhirlwind extends EntityMob {
int j = MathHelper.floor_double(this.boundingBox.minY); int j = MathHelper.floor_double(this.boundingBox.minY);
int k = MathHelper.floor_double(this.posZ); int k = MathHelper.floor_double(this.posZ);
return this.rand.nextInt(450) == 0 && this.worldObj.getBlock(i, j - 1, k) == BlocksAether.aether_grass && this.worldObj.getBlockLightValue(i, j, k) > 8 && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); return this.rand.nextInt(15) == 0 && this.worldObj.getBlock(i, j - 1, k) == BlocksAether.aether_grass && this.worldObj.getBlockLightValue(i, j, k) > 8 && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
} }
public EntityPlayer findClosestPlayer() { public EntityPlayer findClosestPlayer() {

View file

@ -40,7 +40,7 @@ public class EntityZephyr extends EntityFlying implements IMob {
int j = MathHelper.floor_double(this.boundingBox.minY); int j = MathHelper.floor_double(this.boundingBox.minY);
int k = MathHelper.floor_double(this.posZ); int k = MathHelper.floor_double(this.posZ);
return this.worldObj.getBlock(i, j - 1, k) == BlocksAether.aether_grass && this.rand.nextInt(85) == 0 && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.isAnyLiquid(this.boundingBox) && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY), MathHelper.floor_double(this.posZ)) > 8 && super.getCanSpawnHere(); return this.worldObj.getBlock(i, j - 1, k) == BlocksAether.aether_grass && this.rand.nextInt(25) == 0 && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.isAnyLiquid(this.boundingBox) && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY), MathHelper.floor_double(this.posZ)) > 8 && super.getCanSpawnHere();
} }
@Override @Override

View file

@ -56,7 +56,7 @@ public class EntityAerwhale extends EntityFlying {
int j = MathHelper.floor_double(this.boundingBox.minY); int j = MathHelper.floor_double(this.boundingBox.minY);
int k = MathHelper.floor_double(this.posZ); int k = MathHelper.floor_double(this.posZ);
return this.worldObj.getBlock(i, j - 1, k) == BlocksAether.aether_grass && this.rand.nextInt(65) == 0 && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.isAnyLiquid(this.boundingBox) && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY), MathHelper.floor_double(this.posZ)) > 8 && super.getCanSpawnHere(); return this.worldObj.getBlock(i, j - 1, k) == BlocksAether.aether_grass && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.isAnyLiquid(this.boundingBox) && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY), MathHelper.floor_double(this.posZ)) > 8 && super.getCanSpawnHere();
} }
@Override @Override

View file

@ -68,6 +68,12 @@ public class EntitySwet extends EntityMountable {
} }
} }
@Override
public boolean getCanSpawnHere()
{
return this.rand.nextInt(10) == 0 && super.getCanSpawnHere();
}
@Override @Override
public void onUpdate() { public void onUpdate() {
super.onUpdate(); super.onUpdate();

View file

@ -58,7 +58,7 @@ public class AetherBiome extends BiomeGenBase {
private void addCreatureEntry(ArrayList<SpawnListEntry> list) private void addCreatureEntry(ArrayList<SpawnListEntry> list)
{ {
list.add(new SpawnListEntry(EntityAerwhale.class, 30, 1, 1)); list.add(new SpawnListEntry(EntityAerwhale.class, 12, 1, 1));
list.add(new SpawnListEntry(EntityPhyg.class, 12, 4, 4)); list.add(new SpawnListEntry(EntityPhyg.class, 12, 4, 4));
list.add(new SpawnListEntry(EntitySheepuff.class, 10, 4, 4)); list.add(new SpawnListEntry(EntitySheepuff.class, 10, 4, 4));
list.add(new SpawnListEntry(EntityFlyingCow.class, 8, 4, 4)); list.add(new SpawnListEntry(EntityFlyingCow.class, 8, 4, 4));
@ -68,11 +68,11 @@ public class AetherBiome extends BiomeGenBase {
private void addMobEntry(ArrayList<SpawnListEntry> list) private void addMobEntry(ArrayList<SpawnListEntry> list)
{ {
list.add(new SpawnListEntry(EntityAechorPlant.class, 1000, 2, 3));
list.add(new SpawnListEntry(EntityCockatrice.class, 100, 4, 4)); list.add(new SpawnListEntry(EntityCockatrice.class, 100, 4, 4));
list.add(new SpawnListEntry(EntityZephyr.class, 95, 1, 2)); list.add(new SpawnListEntry(EntityZephyr.class, 50, 1, 2));
list.add(new SpawnListEntry(EntityWhirlwind.class, 90, 1, 2)); list.add(new SpawnListEntry(EntityAechorPlant.class, 20, 2, 3));
list.add(new SpawnListEntry(EntitySwet.class, 1, 2, 3)); list.add(new SpawnListEntry(EntityWhirlwind.class, 10, 1, 2));
list.add(new SpawnListEntry(EntitySwet.class, 10, 2, 3));
} }
@Override @Override