Browse Source

calculate combat stats spam fix

lakebane-ai
FatBoy-DOTC 3 weeks ago
parent
commit
f4267c3c92
  1. 4
      src/engine/objects/PlayerCharacter.java
  2. 24
      src/engine/objects/PlayerCombatStats.java

4
src/engine/objects/PlayerCharacter.java

@ -5060,14 +5060,16 @@ public class PlayerCharacter extends AbstractCharacter {
return; return;
} }
this.updateLocation(); this.updateLocation();
if(this.isAlive() && this.isActive && this.enteredWorld) {
this.updateMovementState(); this.updateMovementState();
this.doRegen(); this.doRegen();
if (this.combatStats == null) { if (this.combatStats == null) {
this.combatStats = new PlayerCombatStats(this); this.combatStats = new PlayerCombatStats(this);
} else { } else {
this.combatStats.update(); this.combatStats.update();
} }
}
if (this.getStamina() < 10) { if (this.getStamina() < 10) {
if (this.getAltitude() > 0 || this.getDesiredAltitude() > 0) { if (this.getAltitude() > 0 || this.getDesiredAltitude() > 0) {

24
src/engine/objects/PlayerCombatStats.java

@ -41,62 +41,62 @@ public class PlayerCombatStats {
try { try {
this.calculateATR(true); this.calculateATR(true);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateATR(false); this.calculateATR(false);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE ATR FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateMin(true); this.calculateMin(true);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateMin(false); this.calculateMin(false);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Min FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateMax(true); this.calculateMax(true);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateMax(false); this.calculateMax(false);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Max FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateAttackSpeed(true); this.calculateAttackSpeed(true);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateAttackSpeed(false); this.calculateAttackSpeed(false);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Attack Speed FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateAttackRange(true); this.calculateAttackRange(true);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateAttackRange(false); this.calculateAttackRange(false);
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Attack Range FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateRegen(); this.calculateRegen();
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Regen FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Regen FOR: " + this.owner.getObjectUUID());
} }
try { try {
this.calculateDefense(); this.calculateDefense();
} catch (Exception e) { } catch (Exception e) {
Logger.error("FAILED TO CALCULATE Defense FOR: " + this.owner.getObjectUUID()); //Logger.error("FAILED TO CALCULATE Defense FOR: " + this.owner.getObjectUUID());
} }
} }

Loading…
Cancel
Save