Skip to content

Commit 0a35601

Browse files
committed
Fix TempFallingBlocks from staying around forever
- Add a long timeout for TempFallingBlocks even if they aren't supposed to timeout.
1 parent 3ac5edd commit 0a35601

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/com/jedk1/jedcore/util/TempFallingBlock.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ public TempFallingBlock(Location location, BlockData data, Vector veloctiy, Abil
3636
}
3737

3838
public static void manage() {
39+
long time = System.currentTimeMillis();
40+
3941
for (TempFallingBlock tfb : instances.values()) {
40-
if (tfb.canExpire() && System.currentTimeMillis() > tfb.getCreationTime() + 5000) {
42+
if (tfb.canExpire() && time > tfb.getCreationTime() + 5000) {
43+
tfb.remove();
44+
} else if (time > tfb.getCreationTime() + 120000) { // Add a hard timeout for any abilities that misuse this.
4145
tfb.remove();
4246
}
4347
}

0 commit comments

Comments
 (0)