mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
Remove command utilities plugin
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import com.google.common.primitives.Ints
|
||||
import org.apollo.game.model.Animation
|
||||
import org.apollo.game.model.entity.setting.PrivilegeLevel
|
||||
import org.apollo.game.plugin.util.command.valid_arg_length
|
||||
|
||||
on_command("animate", PrivilegeLevel.MODERATOR)
|
||||
.then { player ->
|
||||
val invalidSyntax = "Invalid syntax - ::animate [animation-id]"
|
||||
if (valid_arg_length(arguments, 1, player, invalidSyntax)) {
|
||||
val id = Ints.tryParse(arguments[0])
|
||||
if (id == null) {
|
||||
player.sendMessage(invalidSyntax)
|
||||
arguments.firstOrNull()
|
||||
?.let(String::toIntOrNull)
|
||||
?.let(::Animation)
|
||||
?.let {
|
||||
player.playAnimation(it)
|
||||
return@then
|
||||
}
|
||||
|
||||
player.playAnimation(Animation(id))
|
||||
}
|
||||
player.sendMessage("Invalid syntax - ::animate [animation-id]")
|
||||
}
|
||||
Reference in New Issue
Block a user