diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-02 16:01:38 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-04-02 16:01:38 +0200 |
commit | 3e0198e3a803d2dd46988ba0ac445412c7da8390 (patch) | |
tree | 6f08cebe11894769ead7ce7473b27dbdf21523d5 /src/main/java/moe/nea/ledger/mixin/MouseClickEventPatch.java | |
parent | 8d26a206297071775e88b99d4b38efcc5577af0a (diff) | |
download | money-ledger-3e0198e3a803d2dd46988ba0ac445412c7da8390.tar.gz money-ledger-3e0198e3a803d2dd46988ba0ac445412c7da8390.tar.bz2 money-ledger-3e0198e3a803d2dd46988ba0ac445412c7da8390.zip |
Add bits stuff
Diffstat (limited to 'src/main/java/moe/nea/ledger/mixin/MouseClickEventPatch.java')
-rw-r--r-- | src/main/java/moe/nea/ledger/mixin/MouseClickEventPatch.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/ledger/mixin/MouseClickEventPatch.java b/src/main/java/moe/nea/ledger/mixin/MouseClickEventPatch.java new file mode 100644 index 0000000..9b109c4 --- /dev/null +++ b/src/main/java/moe/nea/ledger/mixin/MouseClickEventPatch.java @@ -0,0 +1,18 @@ +package moe.nea.ledger.mixin; + +import moe.nea.ledger.GuiClickEvent; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; +import net.minecraftforge.common.MinecraftForge; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(GuiContainer.class) +public class MouseClickEventPatch { + @Inject(method = "handleMouseClick", at = @At("HEAD")) + private void onHandleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType, CallbackInfo ci) { + MinecraftForge.EVENT_BUS.post(new GuiClickEvent(slotIn, slotId, clickedButton, clickType)); + } +} |