Proper Reformating

This commit is contained in:
Kam committed 2025-03-13 17:14:45 -04:00
1 parent ce75880aba
commit 180d257024
1179 files changed
+59847 -61583

No files matched your search

@@ -5,8 +5,7 @@ import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.constants.EnumMovingType;
import noppes.npcs.entity.EntityNPCInterface;
public class EntityAIAnimation extends EntityAIBase
{
public class EntityAIAnimation extends EntityAIBase {
private EntityNPCInterface npc;
private boolean isAttacking = false;
@@ -15,53 +14,53 @@ public class EntityAIAnimation extends EntityAIBase
private boolean hasPath = false;
private int tick = 4;
public EntityAIAnimation(EntityNPCInterface npc){
public EntityAIAnimation(EntityNPCInterface npc) {
this.npc = npc;
}
@Override
public boolean shouldExecute(){
isDead = !npc.isEntityAlive();
if(isDead)
return npc.currentAnimation != EnumAnimation.LYING;
public boolean shouldExecute() {
isDead = !npc.isEntityAlive();
if (isDead)
return npc.currentAnimation != EnumAnimation.LYING;
if(npc.stats.aimWhileShooting && npc.isAttacking())
return npc.currentAnimation != EnumAnimation.AIMING;
if(npc.ais.animationType == EnumAnimation.NONE)
return npc.currentAnimation != EnumAnimation.NONE;
isAttacking = npc.isAttacking();
if(npc.ais.returnToStart)
isAtStartpoint = npc.isVeryNearAssignedPlace();
hasPath = !npc.getNavigator().noPath();
if (npc.stats.aimWhileShooting && npc.isAttacking())
return npc.currentAnimation != EnumAnimation.AIMING;
if (npc.ais.animationType == EnumAnimation.NONE)
return npc.currentAnimation != EnumAnimation.NONE;
isAttacking = npc.isAttacking();
if (npc.ais.returnToStart)
isAtStartpoint = npc.isVeryNearAssignedPlace();
hasPath = !npc.getNavigator().noPath();
if(npc.ais.movingType == EnumMovingType.Standing && hasNavigation() && npc.currentAnimation.getWalkingAnimation() == 0){
return npc.currentAnimation != EnumAnimation.NONE;
}
if (npc.ais.movingType == EnumMovingType.Standing && hasNavigation() && npc.currentAnimation.getWalkingAnimation() == 0) {
return npc.currentAnimation != EnumAnimation.NONE;
}
return npc.currentAnimation != npc.ais.animationType;
return npc.currentAnimation != npc.ais.animationType;
}
@Override
public void updateTask(){
if(npc.stats.aimWhileShooting && npc.isAttacking()){
setAnimation(EnumAnimation.AIMING);
return;
}
EnumAnimation type = npc.ais.animationType;
if(isDead)
type = EnumAnimation.LYING;
else if(npc.ais.movingType == EnumMovingType.Standing && npc.ais.animationType.getWalkingAnimation() == 0 && hasNavigation())
type = EnumAnimation.NONE;
setAnimation(type);
public void updateTask() {
if (npc.stats.aimWhileShooting && npc.isAttacking()) {
setAnimation(EnumAnimation.AIMING);
return;
}
EnumAnimation type = npc.ais.animationType;
if (isDead)
type = EnumAnimation.LYING;
else if (npc.ais.movingType == EnumMovingType.Standing && npc.ais.animationType.getWalkingAnimation() == 0 && hasNavigation())
type = EnumAnimation.NONE;
setAnimation(type);
}
private void setAnimation(EnumAnimation animation){
npc.setCurrentAnimation(animation);
npc.updateHitbox();
npc.setPosition(npc.posX, npc.posY, npc.posZ);
private void setAnimation(EnumAnimation animation) {
npc.setCurrentAnimation(animation);
npc.updateHitbox();
npc.setPosition(npc.posX, npc.posY, npc.posZ);
}
private boolean hasNavigation() {
return (isAttacking || npc.ais.returnToStart && !isAtStartpoint && !npc.isFollower() || hasPath);
return (isAttacking || npc.ais.returnToStart && !isAtStartpoint && !npc.isFollower() || hasPath);
}
}