1
1
package io.github.rothes.esu.bukkit.module.exploitfix
2
2
3
- import io.github.rothes.esu.bukkit.module.ExploitFixModule
3
+ import io.github.rothes.esu.bukkit.module.ExploitFixesModule
4
4
import io.github.rothes.esu.bukkit.plugin
5
5
import io.github.rothes.esu.bukkit.user
6
6
import io.github.rothes.esu.bukkit.util.CoordinateUtils.blockKey_
@@ -44,7 +44,7 @@ internal object VaultUnlocking: Listener {
44
44
opened.getOrPut(block.world) { Long2ObjectOpenHashMap () }.getOrPut(block.blockKey_) { LongArrayList () }
45
45
46
46
fun onEnable () {
47
- if (ExploitFixModule .config.vaultUnlocking.enabled) {
47
+ if (ExploitFixesModule .config.vaultUnlocking.enabled) {
48
48
if (ServerCompatibility .serverVersion < Version .fromString(" 1.21" )) {
49
49
plugin.err(" [VaultUnlocking] This feature requires Bukkit 1.21+" )
50
50
return
@@ -53,7 +53,7 @@ internal object VaultUnlocking: Listener {
53
53
this .register()
54
54
purgeTask = Scheduler .async(30 .minutes, 30 .minutes) {
55
55
val now = System .currentTimeMillis()
56
- val config = ExploitFixModule .config.vaultUnlocking
56
+ val config = ExploitFixesModule .config.vaultUnlocking
57
57
val expired = now - config.unlockExpiry.toMillis()
58
58
val iterator = opened.iterator()
59
59
for ((_, map) in iterator) {
@@ -74,7 +74,7 @@ internal object VaultUnlocking: Listener {
74
74
}
75
75
76
76
fun onReload () {
77
- if (ExploitFixModule .enabled && ExploitFixModule .config.vaultUnlocking.enabled) {
77
+ if (ExploitFixesModule .enabled && ExploitFixesModule .config.vaultUnlocking.enabled) {
78
78
onEnable()
79
79
} else {
80
80
onDisable()
@@ -107,7 +107,7 @@ internal object VaultUnlocking: Listener {
107
107
if (ominous != blockData.isOminous) return
108
108
109
109
val now = System .currentTimeMillis()
110
- val config = ExploitFixModule .config.vaultUnlocking
110
+ val config = ExploitFixesModule .config.vaultUnlocking
111
111
val expired = now - config.unlockExpiry.toMillis()
112
112
val times = getBlockTimes(block)
113
113
times.removeWhile { it < expired }
@@ -117,7 +117,7 @@ internal object VaultUnlocking: Listener {
117
117
event.isCancelled = true
118
118
val duration = if (times.isNotEmpty()) (times.getLong(0 ) - expired).milliseconds else Duration .INFINITE
119
119
val user = event.player.user
120
- user.message(ExploitFixModule .locale, { vaultUnlocking.tooManyUnlocks }, duration(duration, user))
120
+ user.message(ExploitFixesModule .locale, { vaultUnlocking.tooManyUnlocks }, duration(duration, user))
121
121
}
122
122
}
123
123
}
0 commit comments