mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -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 {
|
fun canEnchant(index: Int): Boolean {
|
||||||
if (costs[index] < 0) {
|
val cost = costs[index]
|
||||||
|
if (cost < 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (connection.player.gamemode == Gamemodes.CREATIVE) {
|
if (connection.player.gamemode == Gamemodes.CREATIVE) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if (connection.player.experienceCondition.level < cost) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
val lapislazuli = this.lapislazuli
|
val lapislazuli = this.lapislazuli
|
||||||
if (lapislazuli < index + 1) {
|
if (lapislazuli < index + 1) {
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user