diff options
author | ingle <inglettronald@gmail.com> | 2022-11-28 10:14:44 -0600 |
---|---|---|
committer | ingle <inglettronald@gmail.com> | 2022-11-28 10:14:44 -0600 |
commit | 15b61517c59f8aa8135af82d6814739ad5da76b3 (patch) | |
tree | 19a13669ba1714cf9f763d632fafcfc6382eec54 /src/main/kotlin/dulkirmod/features | |
parent | 7df387ec0f015fc7b8179131f17a107be4d77f04 (diff) | |
download | DulkirMod-15b61517c59f8aa8135af82d6814739ad5da76b3.tar.gz DulkirMod-15b61517c59f8aa8135af82d6814739ad5da76b3.tar.bz2 DulkirMod-15b61517c59f8aa8135af82d6814739ad5da76b3.zip |
- 1.1.3
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
4 files changed, 90 insertions, 1 deletions
diff --git a/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt b/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt new file mode 100644 index 0000000..7237d95 --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/HurtCamSlider.kt @@ -0,0 +1,31 @@ +package dulkirmod.features + +import dulkirmod.DulkirMod.Companion.mc +import dulkirmod.config.Config +import net.minecraft.client.renderer.GlStateManager +import net.minecraft.entity.EntityLivingBase +import net.minecraft.util.MathHelper + +object HurtCamSlider { + fun renderHurt(partialTicks: Float): Boolean { + if (!Config.hurtCamSlider) return false + if (mc.renderViewEntity is EntityLivingBase) { + val entitylivingbase = mc.renderViewEntity as EntityLivingBase + var f: Float = (entitylivingbase.hurtTime.toFloat() - partialTicks) + if (entitylivingbase.health <= 0.0f) { + val f1: Float = entitylivingbase.deathTime.toFloat() + partialTicks + GlStateManager.rotate(40.0f - 8000.0f / (f1 + 200.0f), 0.0f, 0.0f, 1.0f) + } + if (f < 0.0f) { + return true + } + f /= entitylivingbase.maxHurtTime.toFloat() + f = MathHelper.sin(f * f * f * f * Math.PI.toFloat()) + val f2 = entitylivingbase.attackedAtYaw + GlStateManager.rotate(-f2, 0.0f, 1.0f, 0.0f) + GlStateManager.rotate(-f * 14.0f * Config.hurtCamIntensity, 0.0f, 0.0f, 1.0f) + GlStateManager.rotate(f2, 0.0f, 1.0f, 0.0f) + } + return true + } +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt b/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt new file mode 100644 index 0000000..7b82fa2 --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/KeeperWaypoints.kt @@ -0,0 +1,51 @@ +package dulkirmod.features + +import dulkirmod.DulkirMod.Companion.mc +import dulkirmod.config.Config +import dulkirmod.utils.Utils +import dulkirmod.utils.WorldRenderUtils +import net.minecraft.util.Vec3 +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.math.max + +class KeeperWaypoints { + @SubscribeEvent + fun onWorldRenderLast(event: RenderWorldLastEvent) { + if (!Config.keeperWaypoints) return + if (Utils.area != "Spider's Den") return + + val vec1 = Vec3(-208.5, 44.5, -259.5) + val vec2 = Vec3(-311.5, 43.5, -232.5) + val vec3 = Vec3(-230.5, 57.5, -307.5) + val vec4 = Vec3(-269.5, 47.5, -166.5) + val vec5 = Vec3(-292.5, 47.5, -167.5) + val vec6 = Vec3(-291.5, 47.5, -183.5) + val vec7 = Vec3(-282.5, 47.5, -195.5) + val vec8 = Vec3(-262.5, 49.5, -191.5) + val vec9 = Vec3(-269.5, 61.5, -159.5) + val playerVec = mc.thePlayer.positionVector + + val scale1 = max(1f, playerVec.distanceTo(vec1).toFloat()/10f) + val scale2 = max(1f,playerVec.distanceTo(vec2).toFloat()/10f) + val scale3 = max(1f, playerVec.distanceTo(vec3).toFloat()/10f) + val scale4 = max(1f, playerVec.distanceTo(vec4).toFloat()/10f) + val scale5 = max(1f, playerVec.distanceTo(vec5).toFloat()/10f) + val scale6 = max(1f, playerVec.distanceTo(vec6).toFloat()/10f) + val scale7 = max(1f, playerVec.distanceTo(vec7).toFloat()/10f) + val scale8 = max(1f, playerVec.distanceTo(vec8).toFloat()/10f) + val scale9 = max(1f, playerVec.distanceTo(vec9).toFloat()/10f) + + val color = Utils.getColorString(Config.bestiaryNotifColor) + WorldRenderUtils.render(vec1, "${color}1", false, scale1, true) + WorldRenderUtils.render(vec2, "${color}2", false, scale2, true) + WorldRenderUtils.render(vec3, "${color}3", false, scale3, true) + WorldRenderUtils.render(vec4, "${color}4", false, scale4, true) + WorldRenderUtils.render(vec5, "${color}5", false, scale5, true) + WorldRenderUtils.render(vec6, "${color}6", false, scale6, true) + WorldRenderUtils.render(vec7, "${color}7", false, scale7, true) + WorldRenderUtils.render(vec8, "${color}8", false, scale8, true) + WorldRenderUtils.render(vec9, "${color}9", false, scale9, true) + } +} + diff --git a/src/main/kotlin/dulkirmod/features/NametagCleaner.kt b/src/main/kotlin/dulkirmod/features/NametagCleaner.kt index e2e4a04..5dd190a 100644 --- a/src/main/kotlin/dulkirmod/features/NametagCleaner.kt +++ b/src/main/kotlin/dulkirmod/features/NametagCleaner.kt @@ -2,6 +2,7 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.config import dulkirmod.DulkirMod.Companion.mc +import dulkirmod.utils.Utils import dulkirmod.utils.Utils.stripColorCodes import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderLivingEvent @@ -30,6 +31,12 @@ object NametagCleaner { mc.theWorld.removeEntity(event.entity) } } + + if (config.keeperFocus && Utils.area == "Spider's Den") { + val name = stripColorCodes(event.entity.customNameTag) + if (!name.contains("Keeper")) + mc.theWorld.removeEntity(event.entity) + } } } } diff --git a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt index d2e0a69..f0a5cb0 100644 --- a/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt +++ b/src/main/kotlin/dulkirmod/features/chat/AbiphoneDND.kt @@ -18,6 +18,7 @@ class AbiphoneDND { if (!Config.abiDND) return if (System.currentTimeMillis() - lastRing < 5000) { if (event.name == "note.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) { + // This throws an error but still blocks the sound. Not a great solution, but it works for now event.isCanceled = true } } @@ -47,6 +48,5 @@ class AbiphoneDND { event.isCanceled = true; } } - } }
\ No newline at end of file |