fix bugs
This commit is contained in:
@@ -29,8 +29,8 @@ interface Item {
|
||||
fun update(player: Player): ItemStack
|
||||
|
||||
fun exeCommands(player: Player, amount: Int) {
|
||||
for (a in 1..amount){
|
||||
commands.map { it.replace("%player%", player.name) }.forEach { command ->
|
||||
commands.map { it.replace("%player%", player.name).replace("\${amount}", amount.toString()) }
|
||||
.forEach { command ->
|
||||
if (command.startsWith("[tell] ")) {
|
||||
player.sendMessage(command.substring(7).colored())
|
||||
} else if (command.startsWith("[console] ")) {
|
||||
@@ -50,7 +50,6 @@ interface Item {
|
||||
player.closeInventory()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,4 +67,4 @@ items:
|
||||
# 关闭此选项 可只执行命令 不给原版物品
|
||||
vanilla: false
|
||||
commands:
|
||||
- '[console] ia give %player% 物品'
|
||||
- '[console] ia give %player% 物品 ${amount}'
|
||||
Reference in New Issue
Block a user