wands are required to cast spells
This commit is contained in:
parent
86e2cb4ee1
commit
518dec0da4
1 changed files with 10 additions and 0 deletions
|
@ -91,6 +91,16 @@ class GuiSpellcasting(private val handOpenedWith: InteractionHand,
|
|||
soundManager.play(this.ambianceSoundInstance!!)
|
||||
}
|
||||
|
||||
override fun tick() {
|
||||
val minecraft = Minecraft.getInstance()
|
||||
val player = minecraft.player
|
||||
if (player != null) {
|
||||
val heldItem = player.getItemInHand(handOpenedWith)
|
||||
if (heldItem.isEmpty || heldItem.item !is ItemWand)
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
|
||||
override fun mouseClicked(mxOut: Double, myOut: Double, pButton: Int): Boolean {
|
||||
if (super.mouseClicked(mxOut, myOut, pButton)) {
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue