mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 21:09:40 +00:00
ICustomNpc:
-Fix for setRetaliateType
This commit is contained in:
1 parent
bad6c3e9e4
commit
2819c76d0a
2 files changed
+7
-2
No files matched your search
@@ -613,7 +613,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
}
|
||||
tasks.taskEntries = new ArrayList<EntityAITaskEntry>();
|
||||
}
|
||||
private void updateTasks() {
|
||||
public void updateTasks() {
|
||||
if (worldObj == null || worldObj.isRemote)
|
||||
return;
|
||||
aiLeap = aiAttackTarget = aiResponse = aiSprint = aiRange = null;
|
||||
|
||||
@@ -1008,8 +1008,13 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
* @param type Retaliation type. 0:normal, 1:panic, 2:retreat, 3:nothing
|
||||
*/
|
||||
public void setRetaliateType(int type){
|
||||
if (type < 0)
|
||||
type = 0;
|
||||
if (type > 3)
|
||||
type = 3;
|
||||
|
||||
npc.ai.onAttack = type;
|
||||
npc.setResponse();
|
||||
npc.updateTasks();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user