aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/mixins/hooks
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-28 21:59:37 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-28 21:59:37 +0200
commit03f30aa94951bef366985c1eddb72922c255b2b3 (patch)
treeb5c31870d5da08161f079cd3ba5440fe79d5175b /src/main/java/at/hannibal2/skyhanni/mixins/hooks
parent613a8603d081589684c9f54133cae9b7a398c759 (diff)
downloadskyhanni-03f30aa94951bef366985c1eddb72922c255b2b3.tar.gz
skyhanni-03f30aa94951bef366985c1eddb72922c255b2b3.tar.bz2
skyhanni-03f30aa94951bef366985c1eddb72922c255b2b3.zip
fixed stats tuning display
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/mixins/hooks')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt35
1 files changed, 12 insertions, 23 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt
index d4287f074..f8e0e225a 100644
--- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.mixins.hooks
+import at.hannibal2.skyhanni.events.DrawScreenAfterEvent
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.GuiContainerEvent.CloseWindowEvent
import at.hannibal2.skyhanni.events.GuiContainerEvent.SlotClickEvent
@@ -20,13 +21,7 @@ class GuiContainerHook(guiAny: Any) {
}
fun backgroundDrawn(mouseX: Int, mouseY: Int, partialTicks: Float, ci: CallbackInfo) {
- GuiContainerEvent.BackgroundDrawnEvent(
- gui,
- gui.inventorySlots,
- mouseX,
- mouseY,
- partialTicks
- ).postAndCatch()
+ GuiContainerEvent.BackgroundDrawnEvent(gui, gui.inventorySlots, mouseX, mouseY, partialTicks).postAndCatch()
}
fun foregroundDrawn(mouseX: Int, mouseY: Int, partialTicks: Float, ci: CallbackInfo) {
@@ -34,12 +29,7 @@ class GuiContainerHook(guiAny: Any) {
}
fun onDrawSlot(slot: Slot, ci: CallbackInfo) {
- if (GuiContainerEvent.DrawSlotEvent.Pre(
- gui,
- gui.inventorySlots,
- slot
- ).postAndCatch()
- ) ci.cancel()
+ if (GuiContainerEvent.DrawSlotEvent.Pre(gui, gui.inventorySlots, slot).postAndCatch()) ci.cancel()
}
fun onDrawSlotPost(slot: Slot, ci: CallbackInfo) {
@@ -47,15 +37,14 @@ class GuiContainerHook(guiAny: Any) {
}
fun onMouseClick(slot: Slot?, slotId: Int, clickedButton: Int, clickType: Int, ci: CallbackInfo) {
- if (
- SlotClickEvent(
- gui,
- gui.inventorySlots,
- slot,
- slotId,
- clickedButton,
- clickType
- ).postAndCatch()
- ) ci.cancel()
+ if (SlotClickEvent(gui, gui.inventorySlots, slot, slotId, clickedButton, clickType).postAndCatch()) ci.cancel()
+ }
+
+ fun onDrawScreenAfter(
+ mouseX: Int,
+ mouseY: Int,
+ ci: CallbackInfo,
+ ) {
+ if (DrawScreenAfterEvent(mouseX, mouseY, ci).postAndCatch()) ci.cancel()
}
} \ No newline at end of file