diff options
author | inglettronald <inglettronald@gmail.com> | 2023-07-23 08:28:08 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-07-23 08:28:08 -0500 |
commit | 6028973423c664e4a4626c577f4884cc4d92cbe0 (patch) | |
tree | d09fa6974290af6cac621e4a33d77a334cb2456d /src/main/kotlin/com | |
parent | 4e8e3ae91f8be1906c298bf7b0aceb1b39d083d3 (diff) | |
download | DulkirMod-Fabric-6028973423c664e4a4626c577f4884cc4d92cbe0.tar.gz DulkirMod-Fabric-6028973423c664e4a4626c577f4884cc4d92cbe0.tar.bz2 DulkirMod-Fabric-6028973423c664e4a4626c577f4884cc4d92cbe0.zip |
performance improvements
Diffstat (limited to 'src/main/kotlin/com')
3 files changed, 4 insertions, 12 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/RenderTest.kt b/src/main/kotlin/com/dulkirfabric/features/RenderTest.kt index 6d64bac..d747b93 100644 --- a/src/main/kotlin/com/dulkirfabric/features/RenderTest.kt +++ b/src/main/kotlin/com/dulkirfabric/features/RenderTest.kt @@ -1,14 +1,10 @@ package com.dulkirfabric.features -import com.dulkirfabric.DulkirModFabric.mc import com.dulkirfabric.events.EntityLoadEvent import com.dulkirfabric.events.HudRenderEvent import com.dulkirfabric.events.WorldRenderLastEvent -import com.dulkirfabric.util.GlowingEntityInterface -import com.dulkirfabric.util.HudRenderUtil import com.dulkirfabric.util.WorldRenderUtils import meteordevelopment.orbit.EventHandler -import net.minecraft.client.gui.DrawContext import net.minecraft.text.Style import net.minecraft.text.Text import net.minecraft.util.math.Vec3d diff --git a/src/main/kotlin/com/dulkirfabric/util/GlowingEntityInterface.kt b/src/main/kotlin/com/dulkirfabric/util/GlowingEntityInterface.kt index 9b129fd..e676736 100644 --- a/src/main/kotlin/com/dulkirfabric/util/GlowingEntityInterface.kt +++ b/src/main/kotlin/com/dulkirfabric/util/GlowingEntityInterface.kt @@ -3,11 +3,9 @@ package com.dulkirfabric.util import java.awt.Color interface GlowingEntityInterface { - fun setDulkirEntityGlow(shouldGlow: Boolean = false, glowColor: Color, shouldESP: Boolean = false) + fun setDulkirEntityGlow(shouldGlow: Boolean = false, glowColor: Color) fun shouldDulkirEntityGlow() : Boolean fun getDulkirEntityGlowColor() : Color? - - fun shouldDulkirEntityESP() : Boolean }
\ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt b/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt index 40840d9..02b79f7 100644 --- a/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt +++ b/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt @@ -1,8 +1,6 @@ package com.dulkirfabric.util import com.dulkirfabric.DulkirModFabric.mc -import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext -import net.minecraft.client.font.TextRenderer import net.minecraft.client.gui.DrawContext import net.minecraft.text.Text @@ -11,11 +9,11 @@ object HudRenderUtil { val matrices = context.matrices val tr = mc.textRenderer val w = tr.getWidth(content) - val sf: Float = mc.window.scaledWidth / w.toFloat() + val sf: Float = mc.window.scaledWidth / w.toFloat() / 3 matrices.push() - matrices.translate(mc.currentScreen!!.width / 3f, mc.window.scaledHeight / 2f, - 0f) + matrices.translate(mc.window.scaledWidth / 3f, mc.window.scaledHeight / 2f, 0f) matrices.scale(sf, sf, 1f) context.drawText(tr, content, 0, -tr.fontHeight / 2, -1, true) + matrices.pop() } }
\ No newline at end of file |