diff --git a/Common/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt b/Common/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt index b0220168..8979b55f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt +++ b/Common/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt @@ -122,7 +122,7 @@ class GuiSpellcasting constructor( if (player != null) { val heldItem = player.getItemInHand(handOpenedWith) if (heldItem.isEmpty || !heldItem.`is`(HexTags.Items.STAVES)) - onClose() + closeForReal() } } @@ -287,6 +287,13 @@ class GuiSpellcasting constructor( } override fun onClose() { + if (drawState == PatternDrawState.BetweenPatterns) + closeForReal() + else + drawState = PatternDrawState.BetweenPatterns + } + + fun closeForReal() { Minecraft.getInstance().soundManager.stop(HexSounds.CASTING_AMBIANCE.location, null) super.onClose()