diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-09-11 22:18:35 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-09-11 22:18:35 +0200 |
commit | 3948cac80fe43683e12d8fa8d4f1058512eed853 (patch) | |
tree | b85f55ef50830575f1eaeeff29b16c5542375f62 | |
parent | 13c654c0f5c9be7ec12b253e95449f4bddf1b679 (diff) | |
download | skyhanni-3948cac80fe43683e12d8fa8d4f1058512eed853.tar.gz skyhanni-3948cac80fe43683e12d8fa8d4f1058512eed853.tar.bz2 skyhanni-3948cac80fe43683e12d8fa8d4f1058512eed853.zip |
added sound debugs
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt | 217 |
1 files changed, 208 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index 3b3afe087..5f5a77929 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -2,14 +2,15 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.PacketEvent -import at.hannibal2.skyhanni.utils.LorenzDebug -import at.hannibal2.skyhanni.utils.LorenzLogger +import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.RenderUtils.renderString +import net.minecraft.client.Minecraft 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.minecraft.network.play.server.S29PacketSoundEffect import net.minecraftforge.client.event.RenderGameOverlayEvent +import net.minecraftforge.event.entity.living.EnderTeleportEvent import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -81,11 +82,16 @@ 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 - } +// val packet = event.packet +// if (packet !is S2APacketParticles) return +// if (packet.particleType == EnumParticleTypes.EXPLOSION_LARGE) { +// event.isCanceled = true +// } + } + + @SubscribeEvent + fun onEnderTeleport(event: EnderTeleportEvent) { +// event.isCanceled = true } @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) @@ -134,6 +140,199 @@ class LorenzTest { if (!shouldLogPackets) return + + + if (packet is S29PacketSoundEffect) { + val x = packet.x + val y = packet.y + val z = packet.z + val location = LorenzVec(x, y, z) + val distance = LocationUtils.playerLocation().distance(location).round(2) + val soundName = packet.soundName + val pitch = packet.pitch.toDouble() + val volume = packet.volume.toDouble() + + + //background music + if (soundName == "note.harp") { +// if (distance < 2) { + + + //Wilderness + val list = mutableListOf<Double>() +// list.add(0.4920635) +// list.add(0.74603176) +// list.add(0.8888889) +// list.add(1.1746032) +// list.add(1.7777778) +// list.add(0.5873016) +// list.add(1.0) +// list.add(1.4920635) +// list.add(0.4920635) +// list.add(1.8730159) +// list.add(0.82539684) +// list.add(1.1111112) +// list.add(1.6666666) +// list.add(0.5555556) +// list.add(0.6984127) +// list.add(0.93650794) +// list.add(1.4126984) +// list.add(1.3333334) +// list.add(1.5873016) + + if (pitch in list) { + if (Minecraft.getMinecraft().thePlayer.isSneaking) { + event.isCanceled = true + } + return + } + } + + + //diana ancestral spade + if (soundName == "note.harp") { + val list = mutableListOf<Double>() + list.add(0.523809552192688) + list.add(0.5555555820465088) + list.add(0.60317462682724) + list.add(0.6349206566810608) + list.add(0.682539701461792) + list.add(0.7142857313156128) + list.add(0.761904776096344) + list.add(0.7936508059501648) + list.add(0.841269850730896) + list.add(0.8888888955116272) + list.add(0.920634925365448) + list.add(0.9682539701461792) + list.add(1.047619104385376) + list.add(1.047619104385376) + list.add(0.5079365372657776) + list.add(0.6507936716079712) + list.add(0.6984127163887024) + list.add(0.7460317611694336) + list.add(0.9365079402923584) + list.add(0.9841269850730896) + list.add(1.9682539701461792) + list.add(0.4920634925365448) + list.add(1.0158730745315552) + list.add(1.158730149269104) + list.add(1.2857142686843872) + list.add(1.4126983880996704) + list.add(1.682539701461792) + list.add(1.8095238208770752) + list.add(1.9365079402923584) + list.add(1.4920635223388672) + list.add(1.5396825075149536) + list.add(0.8730158805847168) + list.add(1.2539682388305664) + list.add(1.4285714626312256) + list.add(1.6190476417541504) + list.add(1.4920635223388672) + list.add(0.9047619104385376) + list.add(1.1111111640930176) + list.add(1.317460298538208) + list.add(1.523809552192688) + list.add(1.7301586866378784) + + list.add(0.5873016119003296) + list.add(0.6190476417541504) + list.add(0.6666666865348816) + list.add(0.7301587462425232) + list.add(0.7777777910232544) + list.add(0.8095238208770752) + list.add(0.8095238208770752) + list.add(0.8253968358039856) + + list.add(0.5714285969734192) + list.add(0.8571428656578064) + list.add(1.0317460298538208) + list.add(1.0952380895614624) + list.add(1.1428571939468384) + list.add(1.20634925365448) + list.add(1.2698413133621216) + list.add(1.0634920597076416) + list.add(1.2380952835083008) + list.add(1.79365074634552) + list.add(1.9841269254684448) + list.add(1.1746032238006592) + list.add(1.3492063283920288) + list.add(1.6984126567840576) + list.add(1.8571428060531616) + + if (pitch in list) { + return + } + } + + //use ancestral spade + if (soundName == "mob.zombie.infect") { + if (pitch == 1.9682539701461792) { + if (volume == 0.30000001192092896) { + LorenzUtils.chat("used ancestral spade!") + return + } + } + } + + //wither shield activated + if (soundName == "mob.zombie.remedy") { + if (pitch == 0.6984127163887024) { + if (volume == 1.0) { + LorenzUtils.chat("use wither shield!") + return + } + } + } + + //wither shield cooldown over + if (soundName == "random.levelup") { + if (pitch == 3.0) { + if (volume == 1.0) { + return + } + } + } + + //teleport (hyp or aote) + if (soundName == "mob.endermen.portal") { + if (pitch == 1.0 && volume == 1.0) { + return + } + } + + //hyp wither impact + if (soundName == "random.explode") { + if (pitch == 1.0 && volume == 1.0) { + return + } + } + + //pick coins up + if (soundName == "random.orb") { + if (pitch == 1.4920635223388672 && volume == 1.0) { + return + } + } + + + + if (soundName == "game.player.hurt") return + + println("") + println("S29PacketSoundEffect") + println("soundName: $soundName") + println("distance: $distance") + println("pitch: $pitch") + println("volume: $volume") + + +// println("x: '$x'") +// println("y: '$y'") +// println("z: '$z'") + + } + + val name = packet.javaClass.simpleName // // if (name == "S2APacketParticles") return |