@@ -40,10 +40,10 @@ public class JumpPlayer {
4040 private boolean jumpAllowed = true ;
4141
4242 /**
43- * Timestamp of the player's last performed jump.
43+ * Timestamp of the player's performed jump delay .
4444 * Used for applying cooldowns and delay-based restrictions.
4545 */
46- private Instant lastJump ;
46+ private Instant nextAllowedJump ;
4747
4848 /**
4949 * The last restriction reason that was notified to the player.
@@ -154,21 +154,23 @@ public void setJumpAllowed(boolean jumpAllowed) {
154154 }
155155
156156 /**
157- * Gets the timestamp of the player's last jump, if present.
157+ * Gets the timestamp indicating when the player is next allowed to perform a jump.
158+ * This value is used to enforce cooldowns between jumps.
158159 *
159- * @return an optional containing the last jump time, or empty if not set
160+ * @return an optional containing the next allowed jump time, or empty if not set
160161 */
161- public Optional <Instant > getLastJump () {
162- return Optional .ofNullable (this .lastJump );
162+ public Optional <Instant > getNextAllowedJump () {
163+ return Optional .ofNullable (this .nextAllowedJump );
163164 }
164165
165166 /**
166- * Sets the timestamp of the player's last jump.
167+ * Sets the timestamp after which the player is allowed to perform the next jump.
168+ * This is typically used to apply a cooldown delay.
167169 *
168- * @param lastJump the time the last jump occurred
170+ * @param nextAllowedJump the time after which jumping is allowed again; may be null to clear
169171 */
170- public void setLastJump (@ Nullable Instant lastJump ) {
171- this .lastJump = lastJump ;
172+ public void setNextAllowedJump (@ Nullable Instant nextAllowedJump ) {
173+ this .nextAllowedJump = nextAllowedJump ;
172174 }
173175
174176 /**
@@ -255,7 +257,7 @@ public String toString() {
255257 ", activationType=" + this .activationType +
256258 ", active=" + this .active +
257259 ", jumpAllowed=" + this .jumpAllowed +
258- ", lastJump =" + this .lastJump +
260+ ", nextAllowedJump =" + this .nextAllowedJump +
259261 ", lastNotifiedReason=" + this .lastNotifiedReason +
260262 ", jumpProperties=" + this .jumpVelocity +
261263 '}' ;
0 commit comments