completely implement iron golem and ocelot NPCs

This commit is contained in:
aPunch 2012-03-01 12:22:39 -06:00
parent 71153a40ea
commit b82cc9e8d5
7 changed files with 13 additions and 14 deletions

View File

@ -16,8 +16,8 @@
<javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,vars,source" includeantruntime="false" encoding="Cp1252">
<classpath>
<pathelement path="${lib}" />
<pathelement location="${lib}/bukkit-1.2.2-R0-SNAPSHOT.jar" />
<pathelement location="${lib}/craftbukkit-1.2.2-R0-SNAPSHOT.jar" />
<pathelement location="${lib}/bukkit-1.2.2-R0.1-SNAPSHOT.jar" />
<pathelement location="${lib}/craftbukkit-1.2.2-R0.1-SNAPSHOT.jar" />
<pathelement location="${lib}/CitizensAPI.jar" />
<pathelement location="${lib}/hamcrest.jar" />
<pathelement location="${lib}/junit-dep-4.10.jar" />

View File

@ -11,8 +11,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bukkit.version>1.2.2-R0-SNAPSHOT</bukkit.version>
<craftbukkit.version>1.2.2-R0-SNAPSHOT</craftbukkit.version>
<bukkit.version>1.2.2-R0.1-SNAPSHOT</bukkit.version>
<craftbukkit.version>1.2.2-R0.1-SNAPSHOT</craftbukkit.version>
<citizensapi.version>2.0-SNAPSHOT</citizensapi.version>
<build.number>Unknown</build.number>
</properties>

View File

@ -6,7 +6,7 @@ import net.citizensnpcs.npc.CitizensNPCManager;
import net.minecraft.server.EntityIronGolem;
import net.minecraft.server.World;
//import org.bukkit.entity.IronGolem;
import org.bukkit.entity.IronGolem;
public class CitizensIronGolemNPC extends CitizensMobNPC {
@ -14,10 +14,10 @@ public class CitizensIronGolemNPC extends CitizensMobNPC {
super(manager, id, name, EntityIronGolemNPC.class);
}
/*@Override
@Override
public IronGolem getBukkitEntity() {
return (IronGolem) getHandle().getBukkitEntity();
}*/
}
public static class EntityIronGolemNPC extends EntityIronGolem {

View File

@ -6,7 +6,7 @@ import net.citizensnpcs.npc.CitizensNPCManager;
import net.minecraft.server.EntityOcelot;
import net.minecraft.server.World;
//import org.bukkit.entity.Ocelot;
import org.bukkit.entity.Ocelot;
public class CitizensOcelotNPC extends CitizensMobNPC {
@ -14,10 +14,10 @@ public class CitizensOcelotNPC extends CitizensMobNPC {
super(manager, id, name, EntityOcelotNPC.class);
}
/*@Override
@Override
public Ocelot getBukkitEntity() {
return (Ocelot) getHandle().getBukkitEntity();
}*/
}
public static class EntityOcelotNPC extends EntityOcelot {

View File

@ -47,12 +47,13 @@ public class NPCBuilder {
types.put(EntityType.ENDERMAN, CitizensEndermanNPC.class);
types.put(EntityType.GHAST, CitizensGhastNPC.class);
types.put(EntityType.GIANT, CitizensGiantNPC.class);
// types.put(EntityType.IRON_GOLEM, CitizensIronGolemNPC.class);
types.put(EntityType.IRON_GOLEM, CitizensIronGolemNPC.class);
types.put(EntityType.MAGMA_CUBE, CitizensMagmaCubeNPC.class);
types.put(EntityType.MUSHROOM_COW, CitizensMushroomCowNPC.class);
// types.put(EntityType.OCELOT, CitizensOcelotNPC.class);
types.put(EntityType.OCELOT, CitizensOcelotNPC.class);
types.put(EntityType.PIG, CitizensPigNPC.class);
types.put(EntityType.PIG_ZOMBIE, CitizensPigZombieNPC.class);
types.put(EntityType.PLAYER, CitizensHumanNPC.class);
types.put(EntityType.SHEEP, CitizensSheepNPC.class);
types.put(EntityType.SILVERFISH, CitizensSilverfishNPC.class);
types.put(EntityType.SKELETON, CitizensSkeletonNPC.class);
@ -67,8 +68,6 @@ public class NPCBuilder {
public CitizensNPC getByType(EntityType type, CitizensNPCManager npcManager, int id, String name) {
Class<? extends CitizensNPC> npcClass = types.get(type);
if (npcClass == null)
npcClass = CitizensHumanNPC.class;
try {
return npcClass.getConstructor(CitizensNPCManager.class, int.class, String.class).newInstance(npcManager,
id, name);