mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Implemented Wolf
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
adcc9c9ddf
commit
57fa7c0118
3 changed files with 42 additions and 0 deletions
|
@ -33,6 +33,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
if (entity instanceof EntityChicken) { return new CraftChicken( server, (EntityChicken) 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 EntityCow) { return new CraftCow( server, (EntityCow) entity); }
|
||||||
else if (entity instanceof EntityPig) { return new CraftPig( server, (EntityPig) 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 if (entity instanceof EntitySheep) { return new CraftSheep( server, (EntitySheep) entity); }
|
||||||
else { return new CraftAnimals( server, (EntityAnimal) entity); }
|
else { return new CraftAnimals( server, (EntityAnimal) entity); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -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() + "]";
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ import net.minecraft.server.EntitySkeleton;
|
||||||
import net.minecraft.server.EntitySlime;
|
import net.minecraft.server.EntitySlime;
|
||||||
import net.minecraft.server.EntitySpider;
|
import net.minecraft.server.EntitySpider;
|
||||||
import net.minecraft.server.EntitySquid;
|
import net.minecraft.server.EntitySquid;
|
||||||
|
import net.minecraft.server.EntityWolf;
|
||||||
import net.minecraft.server.EntityZombie;
|
import net.minecraft.server.EntityZombie;
|
||||||
import net.minecraft.server.Item;
|
import net.minecraft.server.Item;
|
||||||
import net.minecraft.server.ItemStack;
|
import net.minecraft.server.ItemStack;
|
||||||
|
@ -200,6 +201,8 @@ public class CraftEventFactory {
|
||||||
type = CreatureType.GHAST;
|
type = CreatureType.GHAST;
|
||||||
} else if (entityliving instanceof EntityGiantZombie) {
|
} else if (entityliving instanceof EntityGiantZombie) {
|
||||||
type = CreatureType.GIANT;
|
type = CreatureType.GIANT;
|
||||||
|
} else if (entityliving instanceof EntityWolf) {
|
||||||
|
type = CreatureType.WOLF;
|
||||||
} else if (entityliving instanceof EntityPig) {
|
} else if (entityliving instanceof EntityPig) {
|
||||||
type = CreatureType.PIG;
|
type = CreatureType.PIG;
|
||||||
} else if (entityliving instanceof EntityPigZombie) {
|
} else if (entityliving instanceof EntityPigZombie) {
|
||||||
|
|
Loading…
Reference in a new issue