mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
Make the spawning listen to the server spawn-settings
This commit is contained in:
parent
f789c9e744
commit
40f7986a11
@ -245,10 +245,14 @@ public class EntityEgg extends Entity {
|
||||
break;
|
||||
}
|
||||
|
||||
// The world we're spawning in accepts this creature
|
||||
boolean isAnimal = entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal;
|
||||
if ((isAnimal && this.world.L) || (!isAnimal && this.world.K)) {
|
||||
entity.c(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
|
||||
this.world.a(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
for (int l = 0; l < 8; ++l) {
|
||||
|
@ -49,6 +49,13 @@ public class TileEntityMobSpawner extends TileEntity {
|
||||
return;
|
||||
}
|
||||
|
||||
// CraftBukkit start - The world we're spawning in accepts this creature
|
||||
boolean isAnimal = entityliving instanceof EntityAnimal || entityliving instanceof EntityWaterAnimal;
|
||||
if ((isAnimal && !this.a.L) || (!isAnimal && !this.a.K)) {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
int j = this.a.a(entityliving.getClass(), AxisAlignedBB.b((double) this.b, (double) this.c, (double) this.d, (double) (this.b + 1), (double) (this.c + 1), (double) (this.d + 1)).b(8.0D, 4.0D, 8.0D)).size();
|
||||
|
||||
if (j >= 6) {
|
||||
|
@ -61,8 +61,8 @@ public class World implements IBlockAccess {
|
||||
public boolean x;
|
||||
private ArrayList I = new ArrayList();
|
||||
private int J = 0;
|
||||
private boolean K = true;
|
||||
private boolean L = true;
|
||||
public boolean K = true; // CraftBukkit private->public
|
||||
public boolean L = true; // CraftBukkit private->public
|
||||
static int y = 0;
|
||||
private Set M = new HashSet();
|
||||
private int N;
|
||||
@ -1439,7 +1439,11 @@ public class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
public void f() {
|
||||
// CraftBukkit start -- Only call spawner if we have players online and the world allows for mobs or animals
|
||||
if ((this.K || this.L) && (this instanceof WorldServer && ((WorldServer) this).getServer().getHandle().b.size() > 0))
|
||||
SpawnerCreature.a(this, this.K, this.L);
|
||||
// CraftBukkit end
|
||||
|
||||
this.G.a();
|
||||
int i = this.a(1.0F);
|
||||
|
||||
|
@ -47,9 +47,11 @@ public class WorldServer extends World implements BlockChangeDelegate {
|
||||
}
|
||||
|
||||
public void a(Entity entity, boolean flag) {
|
||||
if (!this.D.m && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) {
|
||||
entity.q();
|
||||
}
|
||||
// CraftBukkit start -- We prevent spawning in general, so this butching is not needed
|
||||
//if (!this.D.m && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) {
|
||||
// entity.q();
|
||||
//}
|
||||
// CraftBukkit end
|
||||
|
||||
if (entity.passenger == null || !(entity.passenger instanceof EntityHuman)) {
|
||||
super.a(entity, flag);
|
||||
|
Loading…
Reference in New Issue
Block a user