Skip to content

Commit

Permalink
Made TerminalSound work with middle click terms
Browse files Browse the repository at this point in the history
  • Loading branch information
odtheking committed Nov 14, 2024
1 parent 90ef0fa commit 270d29c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ object TerminalSolver : Module(

if (renderType != 3 && currentTerm.type != TerminalTypes.NONE && middleClickGUI && enabled) {
event.isCanceled = true
GuiEvent.GuiMouseClickEvent(event.gui, event.button, event.x, event.y).postAndCatch()
windowClick(gui.slotUnderMouse?.slotIndex ?: return, if (needed >= 3) PlayerUtils.ClickType.Right else PlayerUtils.ClickType.Middle)
}
if (currentTerm.type == TerminalTypes.NONE || !enabled || (currentTerm.type == TerminalTypes.MELODY && cancelMelodySolver)) return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ object TerminalSounds : Module(

@SubscribeEvent
fun onSlotClick(event: GuiEvent.GuiMouseClickEvent) {
if (!shouldReplaceSounds) return
clickSlot((event.gui as? GuiChest)?.slotUnderMouse?.slotIndex ?: return)
if (shouldReplaceSounds) clickSlot((event.gui as? GuiChest)?.slotUnderMouse?.slotIndex ?: return)
}

@SubscribeEvent
Expand Down

0 comments on commit 270d29c

Please sign in to comment.