File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
bukkit/version/v1_17_1/src/main/kotlin/io/github/rothes/esu/bukkit/module/networkthrottle/v1_17_1 Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11package io.github.rothes.esu.bukkit.module.networkthrottle.v1_17_1
22
33import io.github.rothes.esu.bukkit.module.networkthrottle.EntityUpdateInterval
4+ import io.github.rothes.esu.core.command.annotation.ShortPerm
45import io.github.rothes.esu.core.configuration.meta.Comment
56import io.github.rothes.esu.core.module.configuration.BaseFeatureConfiguration
7+ import io.github.rothes.esu.core.user.User
68import io.github.rothes.esu.core.util.UnsafeUtils.usIntAccessor
79import net.minecraft.server.level.ServerEntity
810import net.minecraft.world.entity.EntityType
11+ import org.incendo.cloud.annotations.Command
912
1013class EntityUpdateIntervalImpl : EntityUpdateInterval <EntityUpdateIntervalImpl .FeatureConfig , Unit >() {
1114
@@ -23,6 +26,15 @@ class EntityUpdateIntervalImpl: EntityUpdateInterval<EntityUpdateIntervalImpl.Fe
2326
2427 override fun onEnable () {
2528 applyUpdateInterval()
29+
30+ registerCommands(object {
31+ @Command(" esu networkThrottle entityUpdateInterval entityType <entityType>" )
32+ @ShortPerm
33+ fun getUpdateInterval (sender : User , entityType : EntityType <* >) {
34+ val interval = entityTypeAccessor[entityType]
35+ sender.miniMessage(" <pc>Current update interval of entity type <pdc>${entityType.toShortString()} </pdc> is <pdc>$interval " )
36+ }
37+ })
2638 }
2739
2840 private fun applyUpdateInterval () {
You can’t perform that action at this time.
0 commit comments