From 345c451ac8b79fa2290cffe5b6f9373df18583ea Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 11 Feb 2025 20:13:32 -0600 Subject: [PATCH] stam ticks --- src/engine/objects/PlayerCharacter.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 241e066c..61278b7a 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -5147,6 +5147,26 @@ public class PlayerCharacter extends AbstractCharacter { forceRespawn(this); return; } + if(!this.timestamps.containsKey("stamTick")){ + this.timestamps.put("stamTick", System.currentTimeMillis()); + }else{ + if(this.containsEffect(441156479) || this.containsEffect(441156455)) { + if(System.currentTimeMillis() - this.timestamps.get("stamTick") > 5000){ + boolean worked = false; + while(!worked) { + float old = this.stamina.get(); + float mod = old + 4; + if (mod > this.staminaMax) + mod = this.staminaMax; + + worked = this.stamina.compareAndSet(old, mod); + } + this.timestamps.put("stamTick", System.currentTimeMillis()); + } + }else{ + this.timestamps.put("stamTick", System.currentTimeMillis()); + } + } if (this.isAlive() && this.isActive && this.enteredWorld) {