Fix crash on load bars without Sodium patch

This commit is contained in:
desyncfy
2024-07-06 17:06:46 -07:00
parent 16691089d3
commit 6ae8aeb567
44 changed files with 14 additions and 13 deletions

View File

@@ -7,8 +7,13 @@ object BridgeMixins {
fun getNum0(): Int {
return num0
}
fun getNum1(): Int {
return num1
fun getStrNum0(): String {
return num0.toString()
}
fun getStrNum1(): String {
val strNum1 = num1 + 20
return strNum1.toString()
}
fun setNum0(number: Int) {

View File

@@ -28,12 +28,8 @@ class Bars {
buffer.vertex(positionMatrix, 280F, 460F, 0F).color(1f, 1f, 1f, 1f).texture(1f, 0f).next()
RenderSystem.setShader { GameRenderer.getPositionColorTexProgram() }
if (BridgeMixins.getNum1() < 10) {
RenderSystem.setShaderTexture(0, Identifier("scify", "HealthMana/Mana/Vials_000${BridgeMixins.getNum1() + 20}.png"))
}
else {
RenderSystem.setShaderTexture(0, Identifier("scify", "HealthMana/Mana/Vials_00${BridgeMixins.getNum1() + 20}.png"))
}
RenderSystem.setShaderTexture(0, Identifier("scify", "healthmana/mana/vials_00${BridgeMixins.getStrNum1()}.png"))
RenderSystem.setShaderColor(1f, 1f, 1f, 1f)
tessellator.draw()
@@ -46,9 +42,9 @@ class Bars {
RenderSystem.setShader { GameRenderer.getPositionColorTexProgram() }
if (BridgeMixins.getNum0() < 10) {
RenderSystem.setShaderTexture(0, Identifier("scify", "./HealthMana/Health/Vials_000${BridgeMixins.getNum0()}.png"))
RenderSystem.setShaderTexture(0, Identifier("scify", "healthmana/health/vials_000${BridgeMixins.getStrNum0()}.png"))
} else {
RenderSystem.setShaderTexture(0, Identifier("scify", "./HealthMana/Health/Vials_00${BridgeMixins.getNum0()}.png"))
RenderSystem.setShaderTexture(0, Identifier("scify", "healthmana/health/vials_00${BridgeMixins.getStrNum0()}.png"))
}
RenderSystem.setShaderColor(1f, 1f, 1f, 1f)

View File

@@ -5,7 +5,7 @@ import net.minecraft.client.MinecraftClient
import net.minecraft.client.gui.DrawContext
var watermarkToggle = true
class Watermark() {
class Watermark {
fun toggleWaterMark() {
watermarkToggle = !watermarkToggle
}
@@ -18,7 +18,7 @@ class Watermark() {
MinecraftClient.getInstance().networkHandler?.serverInfo?.address == "minehut.com") {
if (watermarkToggle) {
val minecraftClient = MinecraftClient.getInstance()
drawContext?.drawTextWithShadow(minecraftClient.textRenderer,"§nSciFy v0.1.2",minecraftClient.window.scaledWidth - minecraftClient.textRenderer.getWidth("SciFy v0.1.2") - 5, minecraftClient.window.scaledHeight - minecraftClient.textRenderer.fontHeight - 5, 0xff00ff)
drawContext?.drawTextWithShadow(minecraftClient.textRenderer,"§nSciFy v0.1.3",minecraftClient.window.scaledWidth - minecraftClient.textRenderer.getWidth("SciFy v0.1.3") - 5, minecraftClient.window.scaledHeight - minecraftClient.textRenderer.fontHeight - 5, 0xff00ff)
}
}
})

View File

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

View File

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 122 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 130 B

View File

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

View File

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 132 B

View File

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

View File

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 128 B

View File

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

View File

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

View File

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 130 B

View File

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 133 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 133 B

View File

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 121 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

View File

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 132 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 134 B

View File

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 134 B

View File

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 130 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View File

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View File

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 132 B

View File

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 128 B

View File

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 136 B

View File

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B