summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/mixinhooks
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-17 03:05:34 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-17 03:05:34 +0200
commitef58a94bf31868c4b53218474f0be04c1cd93d97 (patch)
treecb56d5969f8bebf586298475a61c521229663fda /src/main/java/at/hannibal2/skyhanni/mixinhooks
parent5669dbf6f68e7cacb2df6a4e37d703df8635353e (diff)
downloadskyhanni-ef58a94bf31868c4b53218474f0be04c1cd93d97.tar.gz
skyhanni-ef58a94bf31868c4b53218474f0be04c1cd93d97.tar.bz2
skyhanni-ef58a94bf31868c4b53218474f0be04c1cd93d97.zip
moving packets around
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/mixinhooks')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixinhooks/GuiContainerHook.kt61
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixinhooks/NetHandlerPlayClientHook.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixinhooks/NetworkManagerHook.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderItemHook.kt33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderManagerHook.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/mixinhooks/render/BlockRendererDispatcherHook.kt25
6 files changed, 0 insertions, 163 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixinhooks/GuiContainerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixinhooks/GuiContainerHook.kt
deleted file mode 100644
index 6f2c5c03e..000000000
--- a/src/main/java/at/hannibal2/skyhanni/mixinhooks/GuiContainerHook.kt
+++ /dev/null
@@ -1,61 +0,0 @@
-package at.hannibal2.skyhanni.mixinhooks
-
-import at.hannibal2.skyhanni.events.GuiContainerEvent
-import at.hannibal2.skyhanni.events.GuiContainerEvent.CloseWindowEvent
-import at.hannibal2.skyhanni.events.GuiContainerEvent.SlotClickEvent
-import net.minecraft.client.gui.inventory.GuiContainer
-import net.minecraft.inventory.Slot
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
-
-class GuiContainerHook(guiAny: Any) {
-
- val gui: GuiContainer
-
- init {
- gui = guiAny as GuiContainer
- }
-
- fun closeWindowPressed(ci: CallbackInfo) {
- if (CloseWindowEvent(gui, gui.inventorySlots).postAndCatch()) ci.cancel()
- }
-
- fun backgroundDrawn(mouseX: Int, mouseY: Int, partialTicks: Float, ci: CallbackInfo) {
- GuiContainerEvent.BackgroundDrawnEvent(
- gui,
- gui.inventorySlots,
- mouseX,
- mouseY,
- partialTicks
- ).postAndCatch()
- }
-
- fun foregroundDrawn(mouseX: Int, mouseY: Int, partialTicks: Float, ci: CallbackInfo) {
- GuiContainerEvent.ForegroundDrawnEvent(gui, gui.inventorySlots, mouseX, mouseY, partialTicks).postAndCatch()
- }
-
- fun onDrawSlot(slot: Slot, ci: CallbackInfo) {
- if (GuiContainerEvent.DrawSlotEvent.Pre(
- gui,
- gui.inventorySlots,
- slot
- ).postAndCatch()
- ) ci.cancel()
- }
-
- fun onDrawSlotPost(slot: Slot, ci: CallbackInfo) {
- GuiContainerEvent.DrawSlotEvent.Post(gui, gui.inventorySlots, slot).postAndCatch()
- }
-
- fun onMouseClick(slot: Slot?, slotId: Int, clickedButton: Int, clickType: Int, ci: CallbackInfo) {
- if (
- SlotClickEvent(
- gui,
- gui.inventorySlots,
- slot,
- slotId,
- clickedButton,
- clickType
- ).postAndCatch()
- ) ci.cancel()
- }
-} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/mixinhooks/NetHandlerPlayClientHook.kt b/src/main/java/at/hannibal2/skyhanni/mixinhooks/NetHandlerPlayClientHook.kt
deleted file mode 100644
index 57511d618..000000000
--- a/src/main/java/at/hannibal2/skyhanni/mixinhooks/NetHandlerPlayClientHook.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package at.hannibal2.skyhanni.mixinhooks
-
-import at.hannibal2.skyhanni.events.PacketEvent
-import net.minecraft.network.Packet
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
-
-fun onSendPacket(packet: Packet<*>, ci: CallbackInfo) {
- if (PacketEvent.SendEvent(packet).postAndCatch()) ci.cancel()
-} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/mixinhooks/NetworkManagerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixinhooks/NetworkManagerHook.kt
deleted file mode 100644
index 44746cfbf..000000000
--- a/src/main/java/at/hannibal2/skyhanni/mixinhooks/NetworkManagerHook.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package at.hannibal2.skyhanni.mixinhooks
-
-import at.hannibal2.skyhanni.events.PacketEvent
-import io.netty.channel.ChannelHandlerContext
-import net.minecraft.network.Packet
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
-
-fun onReceivePacket(context: ChannelHandlerContext, packet: Packet<*>, ci: CallbackInfo) {
- if (PacketEvent.ReceiveEvent(packet).postAndCatch()) ci.cancel()
-} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderItemHook.kt b/src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderItemHook.kt
deleted file mode 100644
index ae21c622b..000000000
--- a/src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderItemHook.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-package at.hannibal2.skyhanni.mixinhooks
-
-import at.hannibal2.skyhanni.events.GuiRenderItemEvent
-import at.hannibal2.skyhanni.events.RenderRealOverlayEvent
-import net.minecraft.client.gui.FontRenderer
-import net.minecraft.item.ItemStack
-import net.minecraft.util.ResourceLocation
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
-
-val RES_ITEM_GLINT = ResourceLocation("textures/misc/enchanted_item_glint.png")
-
-var skipGlint = false
-
-fun renderItemOverlayPost(
- fr: FontRenderer,
- stack: ItemStack?,
- xPosition: Int,
- yPosition: Int,
- text: String?,
- ci: CallbackInfo
-) {
- GuiRenderItemEvent.RenderOverlayEvent.Post(
- fr,
- stack,
- xPosition,
- yPosition,
- text
- ).postAndCatch()
-}
-
-fun renderItemReturn(stack: ItemStack, x: Int, y: Int, ci: CallbackInfo) {
- RenderRealOverlayEvent(stack, x, y).postAndCatch()
-}
diff --git a/src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderManagerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderManagerHook.kt
deleted file mode 100644
index a183a0caa..000000000
--- a/src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderManagerHook.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-package at.hannibal2.skyhanni.mixinhooks
-
-import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
-import net.minecraft.client.renderer.culling.ICamera
-import net.minecraft.entity.Entity
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
-
-fun shouldRender(
- entityIn: Entity,
- camera: ICamera,
- camX: Double,
- camY: Double,
- camZ: Double,
- cir: CallbackInfoReturnable<Boolean>
-) {
- if (
- CheckRenderEntityEvent(
- entityIn,
- camera,
- camX,
- camY,
- camZ
- ).postAndCatch()
- ) cir.returnValue = false
-} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/mixinhooks/render/BlockRendererDispatcherHook.kt b/src/main/java/at/hannibal2/skyhanni/mixinhooks/render/BlockRendererDispatcherHook.kt
deleted file mode 100644
index d04e248ea..000000000
--- a/src/main/java/at/hannibal2/skyhanni/mixinhooks/render/BlockRendererDispatcherHook.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-//package at.hannibal2.skyhanni.mixinhooks.render
-//
-//import at.hannibal2.skyhanni.events.RenderBlockInWorldEvent
-//import net.minecraft.block.state.IBlockState
-//import net.minecraft.client.renderer.BlockRendererDispatcher
-//import net.minecraft.client.resources.model.IBakedModel
-//import net.minecraft.util.BlockPos
-//import net.minecraft.world.IBlockAccess
-//import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
-//
-//fun modifyGetModelFromBlockState(
-// blockRendererDispatcher: Any,
-// state: IBlockState?,
-// worldIn: IBlockAccess,
-// pos: BlockPos?,
-// cir: CallbackInfoReturnable<IBakedModel>
-//) {
-// (blockRendererDispatcher as BlockRendererDispatcher).apply {
-// val event = RenderBlockInWorldEvent(state, worldIn, pos)
-// event.postAndCatch()
-// if (event.state !== state) {
-// cir.returnValue = blockModelShapes.getModelForState(event.state)
-// }
-// }
-//} \ No newline at end of file