mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Fixed IRole.getType returning out of order types for scripting.
This commit is contained in:
1 parent
e81f9403a1
commit
75ba7a792b
4 files changed
+26
-6
No files matched your search
@@ -2,9 +2,10 @@ package noppes.npcs.scripted.constants;
|
||||
|
||||
public class RoleType {
|
||||
public static final int UNKNOWN = 0;
|
||||
public static final int MAILMAN = 1;
|
||||
public static final int TRADER = 2;
|
||||
public static final int FOLLOWER = 3;
|
||||
public static final int BANK = 4;
|
||||
public static final int TRANSPORTER = 5;
|
||||
public static final int TRADER = 1;
|
||||
public static final int FOLLOWER = 2;
|
||||
public static final int BANK = 3;
|
||||
public static final int TRANSPORTER = 4;
|
||||
public static final int POSTMAN = 5;
|
||||
public static final int COMPANION = 6;
|
||||
}
|
||||
@@ -404,6 +404,8 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
return new ScriptRoleTrader(npc);
|
||||
else if(npc.advanced.role == EnumRoleType.Transporter)
|
||||
return new ScriptRoleTransporter(npc);
|
||||
else if(npc.advanced.role == EnumRoleType.Companion)
|
||||
return new ScriptRoleCompanion(npc);
|
||||
return new ScriptRoleInterface(npc);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package noppes.npcs.scripted.roles;
|
||||
|
||||
import noppes.npcs.api.roles.IRoleMailman;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.constants.RoleType;
|
||||
|
||||
public class ScriptRoleCompanion extends ScriptRoleInterface implements IRoleMailman {
|
||||
|
||||
public ScriptRoleCompanion(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType(){
|
||||
return RoleType.COMPANION;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,6 @@ public class ScriptRoleMailman extends ScriptRoleInterface implements IRoleMailm
|
||||
|
||||
@Override
|
||||
public int getType(){
|
||||
return RoleType.MAILMAN;
|
||||
return RoleType.POSTMAN;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user