summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-02-18 20:02:20 -0800
committersk89q <the.sk89q@gmail.com>2011-02-19 18:02:12 -0800
commitacd034445239325d60c3211ed71ee5e71c997ce0 (patch)
tree242fb323dc42fc1aa854a3c8c121f077c3cec2c3 /src/main/java/org
parentec0eec5863191009dda11e1068d81e21895ac2d6 (diff)
downloadcraftbukkit-acd034445239325d60c3211ed71ee5e71c997ce0.tar
craftbukkit-acd034445239325d60c3211ed71ee5e71c997ce0.tar.gz
craftbukkit-acd034445239325d60c3211ed71ee5e71c997ce0.tar.lz
craftbukkit-acd034445239325d60c3211ed71ee5e71c997ce0.tar.xz
craftbukkit-acd034445239325d60c3211ed71ee5e71c997ce0.zip
Added Entity.remove() which marks an entity for removal.
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 191212c5..9a876741 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -46,7 +46,6 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityGiantZombie) { return new CraftGiant( server, (EntityGiantZombie) entity); }
else if (entity instanceof EntitySkeleton) { return new CraftSkeleton( server, (EntitySkeleton) entity); }
else if (entity instanceof EntitySpider) { return new CraftSpider( server, (EntitySpider) entity); }
- else if (entity instanceof EntitySlime) { return new CraftSlime( server, (EntitySlime) entity); }
else { return new CraftMonster( server, (EntityMonster) entity); }
}
@@ -57,6 +56,8 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
else { return new CraftCreature( server, (EntityCreature) entity); }
}
+ // Slimes are a special (and broken) case
+ else if (entity instanceof EntitySlime) { return new CraftSlime( server, (EntitySlime) entity); }
// Flying
else if (entity instanceof EntityFlying) {
if (entity instanceof EntityGhast) { return new CraftGhast( server, (EntityGhast) entity); }
@@ -129,6 +130,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public void setFireTicks(int ticks) {
entity.fireTicks = ticks;
}
+
+ public void remove() {
+ entity.dead = true;
+ }
public Entity getHandle() {
return entity;