Browse Source

Re-style to align with Pull Request #26 & getClass() check for entity-ness

master
Robotia 9 years ago
parent
commit
f0ea15ab97
  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); } 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 // 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 instanceof net.minecraft.entity.Entity) { return new CraftCustomEntity(server, (net.minecraft.entity.Entity) entity); }
else return null; 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 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 // Cauldron start - copy of getEntity() but operates on classes instead of instances, for EntityRegistry registerBukkitType

Loading…
Cancel
Save