mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 03:52:18 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -5,27 +5,29 @@ import net.minecraft.entity.ai.EntityAIBase;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAISprintToTarget extends EntityAIBase
|
||||
{
|
||||
private EntityNPCInterface npc;
|
||||
public class EntityAISprintToTarget extends EntityAIBase {
|
||||
private final EntityNPCInterface npc;
|
||||
|
||||
public EntityAISprintToTarget(EntityNPCInterface par1EntityLiving){
|
||||
public EntityAISprintToTarget(EntityNPCInterface par1EntityLiving) {
|
||||
this.npc = par1EntityLiving;
|
||||
this.setMutexBits(AiMutex.PASSIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldExecute(){
|
||||
public boolean shouldExecute() {
|
||||
EntityLivingBase runTarget = this.npc.getAttackTarget();
|
||||
|
||||
if (runTarget == null || this.npc.getNavigator().noPath()){
|
||||
if (runTarget == null || this.npc.getNavigator().noPath()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(this.npc.ais.onAttack){
|
||||
case 0 : return !this.npc.isInRange(runTarget, 8)? (!this.npc.onGround ? false : true) : false;
|
||||
case 2 : return this.npc.isInRange(runTarget, 7)? (!this.npc.onGround ? false : true) : false;
|
||||
default : return false;
|
||||
switch (this.npc.ais.onAttack) {
|
||||
case 0:
|
||||
return !this.npc.isInRange(runTarget, 8) && (this.npc.onGround);
|
||||
case 2:
|
||||
return this.npc.isInRange(runTarget, 7) && (this.npc.onGround);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,8 +35,7 @@ public class EntityAISprintToTarget extends EntityAIBase
|
||||
/**
|
||||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
public boolean continueExecuting()
|
||||
{
|
||||
public boolean continueExecuting() {
|
||||
return this.npc.isEntityAlive() && this.npc.onGround && this.npc.hurtTime <= 0 && (this.npc.motionX != 0.0D && this.npc.motionZ != 0.0D);
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ public class EntityAISprintToTarget extends EntityAIBase
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
@Override
|
||||
public void startExecuting(){
|
||||
public void startExecuting() {
|
||||
this.npc.setSprinting(true);
|
||||
}
|
||||
|
||||
@@ -50,7 +51,7 @@ public class EntityAISprintToTarget extends EntityAIBase
|
||||
* Resets the task
|
||||
*/
|
||||
@Override
|
||||
public void resetTask(){
|
||||
public void resetTask() {
|
||||
this.npc.setSprinting(false);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user