Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
andyksaw committed Nov 25, 2024
1 parent 26ae7d2 commit acfc3e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ suspend fun traceCommand(
// TODO: is this still needed?
context.source.sender.sendError("Error: You do not have permission to use this command")
} catch (e: ResponseParser.ValidationError) {
context.source.sender.sendError("Error: {${e.message}")
context.source.sender.sendError("Error: ${e.message}")
} catch (e: Exception) {
context.source.sender.sendError("An unexpected error occurred")

// Rethrow so that it bubbles up to the error reporter
throw e
throw e // Bubble it up to the error reporter
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ class BuildCommand(
checkNotNull(build) { "Build not found" }

val world = server.getWorld(build.world)
checkNotNull(world) { "Could not find world {$build.world}" }
checkNotNull(world) { "Could not find world ${build.world}" }

context.source.sender.sendMessage(
miniMessage.deserialize("<gray>Teleporting to $name...</gray>")
)
val location = Location(
world,
build.x,
Expand Down Expand Up @@ -91,9 +88,12 @@ class BuildCommand(
Component.text("TODO"),
)
)
context.source.sender.sendMessage(
miniMessage.deserialize("<gray>Teleported to $name</gray>")
)
if (!build.description.isNullOrEmpty()) {
executor.sendMessage(
miniMessage.deserialize("<gray>---<newline>Build Description:<newline>${build.description}</gray>")
miniMessage.deserialize("<gray>---<newline>Build Description: ${build.description}</gray>")
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class BuildsCommand(
.then(command = buildMoveCommand)
.then(command = buildVoteCommand)
.then(command = buildDeleteCommand)
.redirect(buildListCommand.buildLiteral())
.build()
}
}

0 comments on commit acfc3e4

Please sign in to comment.