Skip to content

Commit e291a3e

Browse files
feat: disable specific commands and notify users in WorldCommand and WorldService
1 parent 3192e5d commit e291a3e

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/main/kotlin/dev/slne/surf/essentials/command/WorldCommand.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ fun worldCommand() = commandTree("world") {
108108
anyExecutor { executor, args ->
109109
val name: String by args
110110

111+
executor.sendText {
112+
appendPrefix()
113+
info("Dieser Befehl ist zurzeit deaktiviert.")
114+
}
115+
return@anyExecutor
116+
111117
if (Bukkit.getServer().isFolia()) {
112118
executor.sendText {
113119
appendPrefix()
@@ -127,6 +133,12 @@ fun worldCommand() = commandTree("world") {
127133
anyExecutor { executor, args ->
128134
val world: World by args
129135

136+
executor.sendText {
137+
appendPrefix()
138+
info("Dieser Befehl ist zurzeit deaktiviert.")
139+
}
140+
return@anyExecutor
141+
130142
if (Bukkit.getServer().isFolia()) {
131143
executor.sendText {
132144
appendPrefix()
@@ -146,6 +158,12 @@ fun worldCommand() = commandTree("world") {
146158
anyExecutor { executor, args ->
147159
val name: String by args
148160

161+
executor.sendText {
162+
appendPrefix()
163+
info("Dieser Befehl ist zurzeit deaktiviert.")
164+
}
165+
return@anyExecutor
166+
149167
if (Bukkit.getServer().isFolia()) {
150168
executor.sendText {
151169
appendPrefix()
@@ -166,6 +184,12 @@ fun worldCommand() = commandTree("world") {
166184
anyExecutor { executor, args ->
167185
val world: World by args
168186

187+
executor.sendText {
188+
appendPrefix()
189+
info("Dieser Befehl ist zurzeit deaktiviert.")
190+
}
191+
return@anyExecutor
192+
169193
if (Bukkit.getServer().isFolia()) {
170194
executor.sendText {
171195
appendPrefix()

src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package dev.slne.surf.essentials.service
33
import dev.slne.surf.essentials.plugin
44
import dev.slne.surf.essentials.util.util.isFolia
55
import dev.slne.surf.surfapi.core.api.messages.adventure.sendText
6-
import net.kyori.adventure.util.TriState
76
import org.bukkit.*
87
import org.bukkit.command.CommandSender
98
import org.bukkit.persistence.PersistentDataType
@@ -53,8 +52,6 @@ class WorldService {
5352
hardcore?.let { creator.hardcore(it) }
5453
seed?.let { creator.seed(it) }
5554

56-
creator.keepSpawnLoaded(TriState.TRUE)
57-
5855
sender.sendText {
5956
appendPrefix()
6057
info("Die Welt wird erstellt...")

0 commit comments

Comments
 (0)