mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 22:42:19 +00:00
37 lines
889 B
Java
37 lines
889 B
Java
package noppes.npcs.ai;
|
|
|
|
import net.minecraft.entity.ai.EntityAIBase;
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
|
|
|
public class EntityAIRole extends EntityAIBase {
|
|
|
|
private EntityNPCInterface npc;
|
|
|
|
public EntityAIRole(EntityNPCInterface npc) {
|
|
this.npc = npc;
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldExecute() {
|
|
if (npc.isKilled() || npc.roleInterface == null)
|
|
return false;
|
|
return npc.roleInterface.aiShouldExecute();
|
|
}
|
|
|
|
public void startExecuting() {
|
|
npc.roleInterface.aiStartExecuting();
|
|
}
|
|
|
|
@Override
|
|
public boolean continueExecuting() {
|
|
if (npc.isKilled() || npc.roleInterface == null)
|
|
return false;
|
|
return npc.roleInterface.aiContinueExecute();
|
|
}
|
|
|
|
public void updateTask() {
|
|
if (npc.roleInterface != null)
|
|
npc.roleInterface.aiUpdateTask();
|
|
}
|
|
}
|