Remove command utilities plugin

This commit is contained in:
Major
2018-04-08 05:15:48 +01:00
parent 6e94f4c7d0
commit 275da1331b
8 changed files with 109 additions and 155 deletions
+6 -9
View File
@@ -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]")
}