summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-03-31 22:10:48 +0100
committerDinnerbone <dinnerbone@dinnerbone.com>2011-03-31 22:10:48 +0100
commitbaa8c53be0a616e8458f853462033db0bc171d96 (patch)
tree6e29b6402ccbbc92bf5bc6ad61f3b338208e2b60 /src
parent87c36febeb1801bc89ec040dd24db1ebac75ee36 (diff)
downloadcraftbukkit-baa8c53be0a616e8458f853462033db0bc171d96.tar
craftbukkit-baa8c53be0a616e8458f853462033db0bc171d96.tar.gz
craftbukkit-baa8c53be0a616e8458f853462033db0bc171d96.tar.lz
craftbukkit-baa8c53be0a616e8458f853462033db0bc171d96.tar.xz
craftbukkit-baa8c53be0a616e8458f853462033db0bc171d96.zip
Implemented Wolf
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java1
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java38
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java3
3 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 6fa8f87d..e0ba5986 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -33,6 +33,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
if (entity instanceof EntityChicken) { return new CraftChicken( server, (EntityChicken) entity); }
else if (entity instanceof EntityCow) { return new CraftCow( server, (EntityCow) entity); }
else if (entity instanceof EntityPig) { return new CraftPig( server, (EntityPig) entity); }
+ else if (entity instanceof EntityWolf) { return new CraftWolf( server, (EntityWolf) entity); }
else if (entity instanceof EntitySheep) { return new CraftSheep( server, (EntitySheep) entity); }
else { return new CraftAnimals( server, (EntityAnimal) entity); }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
new file mode 100644
index 00000000..1a6e5974
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
@@ -0,0 +1,38 @@
+
+package org.bukkit.craftbukkit.entity;
+
+import net.minecraft.server.EntityWolf;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.entity.Wolf;
+
+public class CraftWolf extends CraftAnimals implements Wolf {
+ public CraftWolf(CraftServer server, EntityWolf wolf) {
+ super(server, wolf);
+ }
+
+ public boolean isAngry() {
+ return getHandle().x();
+ }
+
+ public void setAngry(boolean angry) {
+ getHandle().c(angry);
+ }
+
+ public boolean isSitting() {
+ return getHandle().y();
+ }
+
+ public void setSitting(boolean sitting) {
+ getHandle().d(sitting);
+ }
+
+ @Override
+ public EntityWolf getHandle() {
+ return (EntityWolf) entity;
+ }
+
+ @Override
+ public String toString() {
+ return "CraftWolf[anger=" + isAngry() + ",owner=" + getTarget() + "]";
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e419dc0b..2983221b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -16,6 +16,7 @@ import net.minecraft.server.EntitySkeleton;
import net.minecraft.server.EntitySlime;
import net.minecraft.server.EntitySpider;
import net.minecraft.server.EntitySquid;
+import net.minecraft.server.EntityWolf;
import net.minecraft.server.EntityZombie;
import net.minecraft.server.Item;
import net.minecraft.server.ItemStack;
@@ -200,6 +201,8 @@ public class CraftEventFactory {
type = CreatureType.GHAST;
} else if (entityliving instanceof EntityGiantZombie) {
type = CreatureType.GIANT;
+ } else if (entityliving instanceof EntityWolf) {
+ type = CreatureType.WOLF;
} else if (entityliving instanceof EntityPig) {
type = CreatureType.PIG;
} else if (entityliving instanceof EntityPigZombie) {