It can now run in console

This commit is contained in:
Sedri05
2022-06-18 12:32:10 +02:00
parent 2d56e8a9d7
commit c362ad0d18

View File

@@ -23,10 +23,11 @@ class CommandGiveXP(plugin: EcoPlugin) : Subcommand(plugin, "givexp", "ecopets.c
sender.sendMessage(plugin.langYml.getMessage("needs-amount")) sender.sendMessage(plugin.langYml.getMessage("needs-amount"))
return return
} }
var player: Player = sender as Player var player = sender
if (args.size == 3){ if (args.size == 3){
player = Bukkit.getPlayer(args[2])!! player = Bukkit.getPlayer(args[2])!!
} }
if (!(player is Player)) return;
val pet = Pets.getByID(args[0]) val pet = Pets.getByID(args[0])
if (pet == null) { if (pet == null) {