From ca4810e8d40c9c47fd12e656754483536f1330b8 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Thu, 15 Sep 2011 02:33:50 +0100 Subject: [PATCH] Implemented new entities --- .../craftbukkit/entity/CraftCaveSpider.java | 16 ++++++++++++++++ .../craftbukkit/entity/CraftEnderman.java | 16 ++++++++++++++++ .../bukkit/craftbukkit/entity/CraftEntity.java | 8 +++++++- .../craftbukkit/entity/CraftExperienceOrb.java | 17 +++++++++++++++++ .../craftbukkit/entity/CraftSilverfish.java | 16 ++++++++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java create mode 100644 src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java create mode 100644 src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java create mode 100644 src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java new file mode 100644 index 0000000000..6822e52e9a --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCaveSpider.java @@ -0,0 +1,16 @@ +package org.bukkit.craftbukkit.entity; + +import net.minecraft.server.EntityCaveSpider; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.CaveSpider; + +public class CraftCaveSpider extends CraftSpider implements CaveSpider { + public CraftCaveSpider(CraftServer server, EntityCaveSpider entity) { + super(server, entity); + } + + @Override + public EntityCaveSpider getHandle() { + return (EntityCaveSpider) super.getHandle(); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java new file mode 100644 index 0000000000..b68a524dd0 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -0,0 +1,16 @@ +package org.bukkit.craftbukkit.entity; + +import net.minecraft.server.EntityEnderman; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.Enderman; + +public class CraftEnderman extends CraftMonster implements Enderman { + public CraftEnderman(CraftServer server, EntityEnderman entity) { + super(server, entity); + } + + @Override + public EntityEnderman getHandle() { + return (EntityEnderman) super.getHandle(); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 7c97c845e1..36760e947a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -50,9 +50,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { else { return new CraftZombie(server, (EntityZombie) entity); } } else if (entity instanceof EntityCreeper) { return new CraftCreeper(server, (EntityCreeper) entity); } + else if (entity instanceof EntityEnderman) { return new CraftEnderman(server, (EntityEnderman) entity); } + else if (entity instanceof EntitySilverfish) { return new CraftSilverfish(server, (EntitySilverfish) 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 EntitySpider) { + if (entity instanceof EntityCaveSpider) { return new CraftCaveSpider(server, (EntityCaveSpider) entity); } + else { return new CraftSpider(server, (EntitySpider) entity); } + } else { return new CraftMonster(server, (EntityMonster) entity); } } @@ -72,6 +77,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } else { return new CraftLivingEntity(server, (EntityLiving) entity); } } + else if (entity instanceof EntityExperienceOrb) { return new CraftExperienceOrb(server, (EntityExperienceOrb) entity); } else if (entity instanceof EntityArrow) { return new CraftArrow(server, (EntityArrow) entity); } else if (entity instanceof EntityBoat) { return new CraftBoat(server, (EntityBoat) entity); } else if (entity instanceof EntityEgg) { return new CraftEgg(server, (EntityEgg) entity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java new file mode 100644 index 0000000000..3981bf323f --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java @@ -0,0 +1,17 @@ + +package org.bukkit.craftbukkit.entity; + +import net.minecraft.server.EntityExperienceOrb; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.ExperienceOrb; + +public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { + public CraftExperienceOrb(CraftServer server, EntityExperienceOrb entity) { + super(server, entity); + } + + @Override + public EntityExperienceOrb getHandle() { + return (EntityExperienceOrb) super.getHandle(); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java new file mode 100644 index 0000000000..8f6d3c23d5 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSilverfish.java @@ -0,0 +1,16 @@ +package org.bukkit.craftbukkit.entity; + +import net.minecraft.server.EntitySilverfish; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.Silverfish; + +public class CraftSilverfish extends CraftMonster implements Silverfish { + public CraftSilverfish(CraftServer server, EntitySilverfish entity) { + super(server, entity); + } + + @Override + public EntitySilverfish getHandle() { + return (EntitySilverfish) super.getHandle(); + } +}