File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed
src/main/kotlin/com/lambda/util Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ class OneSetPerTick<T>(
3535 private set
3636
3737 init {
38- instances.add(this )
38+ listen<TickEvent .Post >(priority = Int .MIN_VALUE ) {
39+ setThisTick = false
40+ if (resetAfterTick) reset()
41+ }
3942 }
4043
4144 @Suppress(" Unused" )
@@ -60,22 +63,4 @@ class OneSetPerTick<T>(
6063 private fun reset () {
6164 value = defaultValue
6265 }
63-
64- fun destroy () {
65- destroyed = true
66- instances.remove(this )
67- }
68-
69- companion object {
70- private val instances = linkedSetOf<OneSetPerTick <* >>()
71-
72- init {
73- listen<TickEvent .Post >(priority = Int .MIN_VALUE ) {
74- instances.forEach {
75- it.setThisTick = false
76- if (it.resetAfterTick) it.reset()
77- }
78- }
79- }
80- }
8166}
You can’t perform that action at this time.
0 commit comments