mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 05:19:41 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -5,16 +5,14 @@ import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.constants.AiMutex;
|
||||
|
||||
public class EntityAIPanic extends EntityAIBase
|
||||
{
|
||||
public class EntityAIPanic extends EntityAIBase {
|
||||
private EntityCreature theEntityCreature;
|
||||
private float speed;
|
||||
private double randPosX;
|
||||
private double randPosY;
|
||||
private double randPosZ;
|
||||
|
||||
public EntityAIPanic(EntityCreature par1EntityCreature, float par2)
|
||||
{
|
||||
public EntityAIPanic(EntityCreature par1EntityCreature, float par2) {
|
||||
this.theEntityCreature = par1EntityCreature;
|
||||
this.speed = par2;
|
||||
this.setMutexBits(AiMutex.PASSIVE);
|
||||
@@ -23,18 +21,15 @@ public class EntityAIPanic extends EntityAIBase
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
public boolean shouldExecute(){
|
||||
if (this.theEntityCreature.getAttackTarget() == null && !this.theEntityCreature.isBurning()){
|
||||
public boolean shouldExecute() {
|
||||
if (this.theEntityCreature.getAttackTarget() == null && !this.theEntityCreature.isBurning()) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Vec3 var1 = RandomPositionGeneratorAlt.findRandomTarget(this.theEntityCreature, 5, 4);
|
||||
|
||||
if (var1 == null){
|
||||
if (var1 == null) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
this.randPosX = var1.xCoord;
|
||||
this.randPosY = var1.yCoord;
|
||||
this.randPosZ = var1.zCoord;
|
||||
@@ -46,16 +41,16 @@ public class EntityAIPanic extends EntityAIBase
|
||||
/**
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
public void startExecuting(){
|
||||
public void startExecuting() {
|
||||
this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
public boolean continueExecuting(){
|
||||
if(this.theEntityCreature.getAttackTarget() == null)
|
||||
return false;
|
||||
public boolean continueExecuting() {
|
||||
if (this.theEntityCreature.getAttackTarget() == null)
|
||||
return false;
|
||||
return !this.theEntityCreature.getNavigator().noPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user