diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-09-07 22:19:27 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-09-07 22:19:27 +0200 |
commit | f2bcdd4f50ef84e6d5a95349b70683c669571c2d (patch) | |
tree | 4616172add9c23d47a9aab2606cebd40d613b38d /src | |
parent | 8ccea289a40f43df29d99ec314e79a791b6decc5 (diff) | |
download | skyhanni-f2bcdd4f50ef84e6d5a95349b70683c669571c2d.tar.gz skyhanni-f2bcdd4f50ef84e6d5a95349b70683c669571c2d.tar.bz2 skyhanni-f2bcdd4f50ef84e6d5a95349b70683c669571c2d.zip |
edited lorenz test
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index 416034a97..d6d136ce2 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -7,6 +7,8 @@ import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.RenderUtils.renderString import net.minecraft.nbt.NBTTagCompound import net.minecraft.network.play.server.S0EPacketSpawnObject +import net.minecraft.network.play.server.S2APacketParticles +import net.minecraft.util.EnumParticleTypes import net.minecraftforge.client.event.RenderGameOverlayEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -19,9 +21,8 @@ class LorenzTest { private var shouldLogPackets = false var text = "" - // var a = 127.0 - var a = 2.0 - var b = 0.0 + var a = 127.0 + var b = 60.0 var c = 0.0 val debugLogger = LorenzLogger("debug/test") @@ -62,6 +63,15 @@ class LorenzTest { } } +// @SubscribeEvent +// fun onItemTooltipLow(event: ItemTooltipEvent) { +// val itemStack = event.itemStack +// if (itemStack != null) { +// val internalName = itemStack.getInternalName() +// event.toolTip.add("internal name: $internalName") +// } +// } + @SubscribeEvent fun renderOverlay(event: RenderGameOverlayEvent.Post) { if (!SkyHanniMod.feature.debug.enabled) return @@ -70,12 +80,53 @@ class LorenzTest { } @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) + fun onHypExplosions(event: PacketEvent.ReceiveEvent) { + val packet = event.packet + if (packet !is S2APacketParticles) return + if (packet.particleType == EnumParticleTypes.EXPLOSION_LARGE) { + event.isCanceled = true + } + } + + @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) fun onChatPacket(event: PacketEvent.ReceiveEvent) { val packet = event.packet val name = packet.javaClass.simpleName + if (!shouldLogPackets) return - packetLog.log(name) +// if (packet is S2APacketParticles) { +// +// +// val particleType = packet.particleType +// println("") +// println("particleType: $particleType") +// +//// val particleType = packet.particleType +//// val particleCount = packet.particleCount +//// +//// var lorenzVec = packet.toLorenzVec() +////// if (lorenzVec.distance(LocationUtils.playerLocation()) > 20) return +//// +//// if (particleType == EnumParticleTypes.FLAME) { +//// +//// println(" ") +//// val particleSpeed = packet.particleSpeed +//// val xOffset = packet.xOffset +//// val yOffset = packet.yOffset +//// val zOffset = packet.zOffset +//// println("particleCount: $particleCount") +//// println("particleSpeed: $particleSpeed") +//// println("xOffset: $xOffset") +//// println("yOffset: $yOffset") +//// println("zOffset: $zOffset") +//// } +// +// +// } + + println(name) +// packetLog.log(name) // if (packet is S18PacketEntityTeleport) { // val entityId = packet.entityId |