Browse Source

Fix #29, getting rid of the Assertion Error for Craft Entities

master
Robotia 9 years ago
parent
commit
8c205653f7
  1. 4
      src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java

4
src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java

@ -173,8 +173,8 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof net.minecraft.entity.item.EntityFireworkRocket) { return new CraftFirework(server, (net.minecraft.entity.item.EntityFireworkRocket) entity); }
// Cauldron - used for custom entities that extend Entity directly
else if (entity instanceof net.minecraft.entity.Entity) { return new CraftCustomEntity(server, (net.minecraft.entity.Entity) entity); }
else if (entity.getClass().getName().toLowerCase().contains("entity")) { return null; }
throw new AssertionError("Unknown entity " + entity == null ? null : entity.getClass() + ": " + entity); // Cauldron - show the entity that caused exception
else { return null; }
//throw new AssertionError("Unknown entity " + entity == null ? null : entity.getClass() + ": " + entity); // Cauldron - show the entity that caused exception
}
// Cauldron start - copy of getEntity() but operates on classes instead of instances, for EntityRegistry registerBukkitType

Loading…
Cancel
Save