diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-04-04 04:56:02 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 19:56:02 +0200 |
commit | 1d051f3e1e35489989ca109f1493154641c23068 (patch) | |
tree | a3df2f70828ce87f487f43d6956718ab4c261838 /src/main/java/at/hannibal2/skyhanni/events | |
parent | 14980034dd0fb71973e15c40e1a8a6f4eaa29895 (diff) | |
download | skyhanni-1d051f3e1e35489989ca109f1493154641c23068.tar.gz skyhanni-1d051f3e1e35489989ca109f1493154641c23068.tar.bz2 skyhanni-1d051f3e1e35489989ca109f1493154641c23068.zip |
Fix: Tick event being called twice a tick (#1342)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/LorenzTickEvent.kt | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzTickEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzTickEvent.kt index 069cae5f8..12b837da5 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/LorenzTickEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/LorenzTickEvent.kt @@ -2,8 +2,7 @@ package at.hannibal2.skyhanni.events class LorenzTickEvent(private val tick: Int) : LorenzEvent() { - fun isMod(i: Int) = tick % i == 0 + fun isMod(i: Int, offset: Int = 0) = (tick + offset) % i == 0 - @Deprecated("Use SecondPassedEvent instead", ReplaceWith("")) - fun repeatSeconds(i: Int) = isMod(i * 20) + fun repeatSeconds(i: Int, offset: Int = 0) = isMod(i * 20, offset) } |