From 846d720c2f3f0a86ac40c81cd80d828c81abeefd Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 28 Feb 2025 17:30:34 -0600 Subject: [PATCH] attempt to stop second box crash --- src/engine/objects/PlayerCharacter.java | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index fecc31b4..71c782fb 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -5180,24 +5180,26 @@ public class PlayerCharacter extends AbstractCharacter { this.updateBlessingMessage(); this.safeZone = this.isInSafeZone(); - if (!this.timestamps.containsKey("nextBoxCheck")) - this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000); - if (!this.isBoxed && this.timestamps.get("nextBoxCheck") < System.currentTimeMillis()) { - this.isBoxed = checkIfBoxed(this); - this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000); - } + if(this.isActive && this.enteredWorld) { + if (!this.timestamps.containsKey("nextBoxCheck")) + this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000); - if (this.level < 10 && this.enteredWorld) { - while (this.level < 10) { - grantXP(Experience.getBaseExperience(this.level + 1) - this.exp); + if (!this.isBoxed && this.timestamps.get("nextBoxCheck") < System.currentTimeMillis()) { + this.isBoxed = checkIfBoxed(this); + this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000); } - } - if (this.isBoxed && !this.containsEffect(1672601862)) { - PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); - } + if (this.level < 10 && this.enteredWorld) { + while (this.level < 10) { + grantXP(Experience.getBaseExperience(this.level + 1) - this.exp); + } + } + if (this.isBoxed && !this.containsEffect(1672601862)) { + PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); + } + } if (this.isFlying()) { if (this.effects.containsKey("MoveBuff")) { GroundPlayer(this);