From 1bf7162516afe737889b35dc6f7f96c7ea42bd56 Mon Sep 17 00:00:00 2001 From: TheBjoRedCraft Date: Thu, 14 May 2026 14:21:46 +0200 Subject: [PATCH 1/2] feat: update version to 3.3.1-SNAPSHOT and enhance world command permissions --- gradle.properties | 2 +- .../dev/slne/surf/essentials/command/WorldCommand.kt | 3 ++- .../dev/slne/surf/essentials/service/WorldService.kt | 11 +++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index b6a6fa3..eeee166 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ kotlin.code.style=official kotlin.stdlib.default.dependency=false org.gradle.parallel=true -version=3.3.0-SNAPSHOT \ No newline at end of file +version=3.3.1-SNAPSHOT \ No newline at end of file diff --git a/src/main/kotlin/dev/slne/surf/essentials/command/WorldCommand.kt b/src/main/kotlin/dev/slne/surf/essentials/command/WorldCommand.kt index 0ab8bf9..9010fb8 100644 --- a/src/main/kotlin/dev/slne/surf/essentials/command/WorldCommand.kt +++ b/src/main/kotlin/dev/slne/surf/essentials/command/WorldCommand.kt @@ -302,6 +302,7 @@ fun worldCommand() = commandTree("world") { } literalArgument("list") { + withPermission(EssentialsPermissionRegistry.WORLD_COMMAND_LIST) anyExecutor { executor, _ -> val worlds = Bukkit.getWorlds() @@ -322,7 +323,7 @@ fun worldCommand() = commandTree("world") { primary("Geladene Welten".toSmallCaps(), TextDecoration.BOLD) } - rowRenderer { row, index -> + rowRenderer { row, _ -> listOf( buildText { darkSpacer(">") diff --git a/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt b/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt index 37e805f..cc28a6f 100644 --- a/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt +++ b/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt @@ -80,6 +80,11 @@ object WorldService { return } + world.setGameRule(GameRules.LOCATOR_BAR, false) + world.setGameRule(GameRules.ADVANCE_TIME, false) + world.setGameRule(GameRules.ADVANCE_WEATHER, false) + world.setGameRule(GameRules.LOCATOR_BAR, false) + sender.sendText { appendSuccessPrefix() success("Die Welt ") @@ -136,7 +141,8 @@ object WorldService { } suspend fun unload(sender: CommandSender, world: World) { - val overworld = Bukkit.getWorlds().firstOrNull() ?: throw CommandAPI.failWithString("Es gibt keine Overworld") + val overworld = Bukkit.getWorlds().firstOrNull() + ?: throw CommandAPI.failWithString("Es gibt keine Overworld") val overworldSpawn = withContext(plugin.globalRegionDispatcher) { overworld.spawnLocation } sender.sendText { @@ -185,7 +191,8 @@ object WorldService { @OptIn(ExperimentalPathApi::class) suspend fun delete(sender: CommandSender, world: World) { - val overworld = Bukkit.getWorlds().firstOrNull() ?: throw CommandAPI.failWithString("Es gibt keine Overworld") + val overworld = Bukkit.getWorlds().firstOrNull() + ?: throw CommandAPI.failWithString("Es gibt keine Overworld") val spawnLocation = withContext(plugin.globalRegionDispatcher) { overworld.spawnLocation } val semaphore = Semaphore(64) From 935ba30e2dc3406bdf9af64c9effc3834dd82afa Mon Sep 17 00:00:00 2001 From: TheBjoRedCraft Date: Thu, 14 May 2026 14:22:31 +0200 Subject: [PATCH 2/2] fix: remove duplicate game rule setting in WorldService --- src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt b/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt index cc28a6f..c1e4979 100644 --- a/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt +++ b/src/main/kotlin/dev/slne/surf/essentials/service/WorldService.kt @@ -83,7 +83,6 @@ object WorldService { world.setGameRule(GameRules.LOCATOR_BAR, false) world.setGameRule(GameRules.ADVANCE_TIME, false) world.setGameRule(GameRules.ADVANCE_WEATHER, false) - world.setGameRule(GameRules.LOCATOR_BAR, false) sender.sendText { appendSuccessPrefix()