We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c568c2b commit 2a0dd3eCopy full SHA for 2a0dd3e
cranberri-server-plugin/src/main/kotlin/jupiterpi/cranberri/computers.kt
@@ -14,6 +14,7 @@ import org.bukkit.event.block.Action
14
import org.bukkit.event.block.BlockBreakEvent
15
import org.bukkit.event.player.PlayerInteractEvent
16
import org.bukkit.util.Vector
17
+import java.util.Date
18
19
val COMPUTER_MATERIAL = Material.TARGET
20
@@ -67,10 +68,9 @@ class Computer(
67
68
}
69
70
- var invocations = 0
71
+ val timeoutStart = Date().time
72
Bukkit.getScheduler().runTaskTimer(plugin, { task ->
- invocations++
73
- if (invocations > 40) task.cancel()
+ if (Date().time - timeoutStart > 30*1000) task.cancel()
74
75
if (runningScript != null) {
76
task.cancel()
0 commit comments