summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/TileEntityMobSpawner.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/TileEntityMobSpawner.java')
-rw-r--r--src/main/java/net/minecraft/server/TileEntityMobSpawner.java38
1 files changed, 15 insertions, 23 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityMobSpawner.java b/src/main/java/net/minecraft/server/TileEntityMobSpawner.java
index b98f60bc..1cfb838f 100644
--- a/src/main/java/net/minecraft/server/TileEntityMobSpawner.java
+++ b/src/main/java/net/minecraft/server/TileEntityMobSpawner.java
@@ -17,7 +17,7 @@ public class TileEntityMobSpawner extends TileEntity {
this.mobName = s;
}
- public boolean a() {
+ public boolean c() {
return this.world.a((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D, 16.0D) != null;
}
@@ -37,9 +37,9 @@ public class TileEntityMobSpawner extends TileEntity {
}
// CraftBukkit end
- public void h_() {
+ public void l_() {
this.c = this.b;
- if (this.a()) {
+ if (this.c()) {
double d0 = (double) ((float) this.x + this.world.random.nextFloat());
double d1 = (double) ((float) this.y + this.world.random.nextFloat());
double d2 = (double) ((float) this.z + this.world.random.nextFloat());
@@ -53,7 +53,7 @@ public class TileEntityMobSpawner extends TileEntity {
if (!this.world.isStatic) {
if (this.spawnDelay == -1) {
- this.c();
+ this.e();
}
if (this.spawnDelay > 0) {
@@ -64,8 +64,7 @@ public class TileEntityMobSpawner extends TileEntity {
byte b0 = 4;
for (int i = 0; i < b0; ++i) {
- // CraftBukkit start
- Entity entityliving = EntityTypes.a(this.mobName, this.world);
+ Entity entityliving = EntityTypes.a(this.mobName, this.world); // CraftBukkit
if (entityliving == null) {
return;
@@ -74,7 +73,7 @@ public class TileEntityMobSpawner extends TileEntity {
int j = this.world.a(entityliving.getClass(), AxisAlignedBB.b((double) this.x, (double) this.y, (double) this.z, (double) (this.x + 1), (double) (this.y + 1), (double) (this.z + 1)).b(8.0D, 4.0D, 8.0D)).size();
if (j >= 6) {
- this.c();
+ this.e();
return;
}
@@ -84,39 +83,32 @@ public class TileEntityMobSpawner extends TileEntity {
double d5 = (double) this.z + (this.world.random.nextDouble() - this.world.random.nextDouble()) * 4.0D;
entityliving.setPositionRotation(d3, d4, d5, this.world.random.nextFloat() * 360.0F, 0.0F);
- if ((entityliving instanceof EntityLiving && ((EntityLiving)entityliving).d()) ||
+ // CraftBukkit start
+ if ((entityliving instanceof EntityLiving && ((EntityLiving) entityliving).g()) ||
(!(entityliving instanceof EntityLiving) && entityliving.world.containsEntity(entityliving.boundingBox) && entityliving.world.getEntities(entityliving, entityliving.boundingBox).size() == 0 && !entityliving.world.c(entityliving.boundingBox))) {
- // CraftBukkit end
- // CraftBukkit - added a reason for spawning this creature
this.world.addEntity(entityliving, SpawnReason.SPAWNER);
+ // CraftBukkit end
- for (int k = 0; k < 20; ++k) {
- d0 = (double) this.x + 0.5D + ((double) this.world.random.nextFloat() - 0.5D) * 2.0D;
- d1 = (double) this.y + 0.5D + ((double) this.world.random.nextFloat() - 0.5D) * 2.0D;
- d2 = (double) this.z + 0.5D + ((double) this.world.random.nextFloat() - 0.5D) * 2.0D;
- this.world.a("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D);
- this.world.a("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
- }
-
- // entity.ab(); // CraftBukkit - client side code, and not available in entity
- this.c();
+ this.world.f(2004, this.x, this.y, this.z, 0);
+ // entityliving.ah(); // CraftBukkit -- only avail on clientside
+ this.e();
}
}
}
}
- super.h_();
+ super.l_();
}
}
- private void c() {
+ private void e() {
this.spawnDelay = 200 + this.world.random.nextInt(600);
}
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
this.mobName = nbttagcompound.getString("EntityId");
- this.spawnDelay = nbttagcompound.d("Delay");
+ this.spawnDelay = nbttagcompound.e("Delay");
}
public void b(NBTTagCompound nbttagcompound) {