mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 19:05:02 -04:00
enchanting: check level
This commit is contained in:
parent
90c8095624
commit
784453a754
@ -72,12 +72,16 @@ class EnchantingContainer(connection: PlayConnection, type: ContainerType, title
|
||||
}
|
||||
|
||||
fun canEnchant(index: Int): Boolean {
|
||||
if (costs[index] < 0) {
|
||||
val cost = costs[index]
|
||||
if (cost < 0) {
|
||||
return false
|
||||
}
|
||||
if (connection.player.gamemode == Gamemodes.CREATIVE) {
|
||||
return true
|
||||
}
|
||||
if (connection.player.experienceCondition.level < cost) {
|
||||
return false
|
||||
}
|
||||
val lapislazuli = this.lapislazuli
|
||||
if (lapislazuli < index + 1) {
|
||||
return false
|
||||
|
Loading…
x
Reference in New Issue
Block a user