summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-11-28 05:08:28 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-11-28 05:08:28 +0000
commit99771b7b7296553374d3f60f0b3e3c6d0ea22ae6 (patch)
treea39af355f4a2cc94cfdf69856fbd78cdd5118e16
parent4b87704c5a6628bca48135882f3da47907707154 (diff)
downloadcraftbukkit-99771b7b7296553374d3f60f0b3e3c6d0ea22ae6.tar
craftbukkit-99771b7b7296553374d3f60f0b3e3c6d0ea22ae6.tar.gz
craftbukkit-99771b7b7296553374d3f60f0b3e3c6d0ea22ae6.tar.lz
craftbukkit-99771b7b7296553374d3f60f0b3e3c6d0ea22ae6.tar.xz
craftbukkit-99771b7b7296553374d3f60f0b3e3c6d0ea22ae6.zip
Fixed magma slimes from being nonspawnable
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 50454eb0..fe13485f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -734,7 +734,11 @@ public class CraftWorld implements World {
} else if (Skeleton.class.isAssignableFrom(clazz)) {
entity = new EntitySkeleton(world);
} else if (Slime.class.isAssignableFrom(clazz)) {
- entity = new EntitySlime(world);
+ if (MagmaCube.class.isAssignableFrom(clazz)) {
+ entity = new EntityLavaSlime(world);
+ } else {
+ entity = new EntitySlime(world);
+ }
} else if (Spider.class.isAssignableFrom(clazz)) {
if (CaveSpider.class.isAssignableFrom(clazz)) {
entity = new EntityCaveSpider(world);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index df90513c..76bc4084 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -15,6 +15,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Bukkit;
+import org.bukkit.entity.MagmaCube;
public abstract class CraftEntity implements org.bukkit.entity.Entity {
private static final Map<String, CraftPlayer> players = new MapMaker().softValues().makeMap();
@@ -79,7 +80,10 @@ 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); }
+ else if (entity instanceof EntitySlime) {
+ if (entity instanceof MagmaCube) { return new CraftMagmaCube(server, (EntityLavaSlime) entity); }
+ else { return new CraftSlime(server, (EntitySlime) entity); }
+ }
// Flying
else if (entity instanceof EntityFlying) {
if (entity instanceof EntityGhast) { return new CraftGhast(server, (EntityGhast) entity); }