fuck you matrixstack nobody ever liked you anyway

This commit is contained in:
kawaiizenbo 2023-06-08 11:25:51 -07:00
parent 6e7d77dea3
commit f41e477e28
15 changed files with 65 additions and 69 deletions

View file

@ -17,12 +17,12 @@ public class Step extends Module_
@Override
public void tick()
{
mc.player.stepHeight = (float)stepHeight.value;
mc.player.setStepHeight((float)stepHeight.value);
}
@Override
public void onDisable()
{
mc.player.stepHeight = 0.5f;
mc.player.setStepHeight(0.5f);
}
}

View file

@ -1,7 +1,6 @@
package me.kawaiizenbo.moonlight.module.settings;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
public class BooleanSetting extends Setting
@ -15,13 +14,13 @@ public class BooleanSetting extends Setting
}
@Override
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY)
public void render(DrawContext drawContext, int x, int y, int mouseX, int mouseY)
{
super.render(matrices, x, y, mouseX, mouseY);
DrawContext.drawTextWithShadow(matrices, textRenderer, Text.literal(name), x+2, y+8, 0xFFFFFF);
DrawContext.fill(matrices, x+175, y+7, x+185, y+17, 0xFFFFFFFF);
DrawContext.fill(matrices, x+176, y+8, x+184, y+16, 0xFF222222);
DrawContext.fill(matrices, x+177, y+9, x+183, y+15, value ? 0xFF55FFFF : 0xFF222222);
super.render(drawContext, x, y, mouseX, mouseY);
drawContext.drawTextWithShadow(textRenderer, Text.literal(name), x+2, y+8, 0xFFFFFF);
drawContext.fill(x+175, y+7, x+185, y+17, 0xFFFFFFFF);
drawContext.fill(x+176, y+8, x+184, y+16, 0xFF222222);
drawContext.fill(x+177, y+9, x+183, y+15, value ? 0xFF55FFFF : 0xFF222222);
}
@Override

View file

@ -1,7 +1,6 @@
package me.kawaiizenbo.moonlight.module.settings;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
public class ColorSetting extends Setting
@ -23,21 +22,21 @@ public class ColorSetting extends Setting
}
@Override
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY)
public void render(DrawContext drawContext, int x, int y, int mouseX, int mouseY)
{
super.render(matrices, x, y, mouseX, mouseY);
DrawContext.drawTextWithShadow(matrices, textRenderer, Text.literal(name), x+2, y+2, 0xFFFFFF);
super.render(drawContext, x, y, mouseX, mouseY);
drawContext.drawTextWithShadow(textRenderer, Text.literal(name), x+2, y+2, 0xFFFFFF);
int redDisplayStartColor = ((255&0x0ff)<<24)|((0&0x0ff)<<16)|((g&0x0ff)<<8)|(b&0x0ff);
int redDisplayEndColor = ((255&0x0ff)<<24)|((255&0x0ff)<<16)|((g&0x0ff)<<8)|(b&0x0ff);
int greenDisplayStartColor = ((255&0x0ff)<<24)|((r&0x0ff)<<16)|((0&0x0ff)<<8)|(b&0x0ff);
int greenDisplayEndColor = ((255&0x0ff)<<24)|((r&0x0ff)<<16)|((255&0x0ff)<<8)|(b&0x0ff);
int blueDisplayStartColor = ((255&0x0ff)<<24)|((r&0x0ff)<<16)|((g&0x0ff)<<8)|(0&0x0ff);
int blueDisplayEndColor = ((255&0x0ff)<<24)|((r&0x0ff)<<16)|((g&0x0ff)<<8)|(255&0x0ff);
DrawContext.fillGradient(matrices, x+80, y+2, x+92, y+62, redDisplayEndColor, redDisplayStartColor, 0);
DrawContext.fillGradient(matrices, x+95, y+2, x+107, y+62, greenDisplayEndColor, greenDisplayStartColor, 0);
DrawContext.fillGradient(matrices, x+110, y+2, x+122, y+62, blueDisplayEndColor, blueDisplayStartColor, 0);
textRenderer.drawWithShadow(matrices, Text.literal("Red: " + r), x+130, y+10, 0xFFFFFFFF);
textRenderer.drawWithShadow(matrices, Text.literal("Green: " + g), x+130, y+26, 0xFFFFFFFF);
textRenderer.drawWithShadow(matrices, Text.literal("Blue: " + b), x+130, y+42, 0xFFFFFFFF);
drawContext.fillGradient(x+80, y+2, x+92, y+62, redDisplayEndColor, redDisplayStartColor, 0);
drawContext.fillGradient(x+95, y+2, x+107, y+62, greenDisplayEndColor, greenDisplayStartColor, 0);
drawContext.fillGradient(x+110, y+2, x+122, y+62, blueDisplayEndColor, blueDisplayStartColor, 0);
drawContext.drawTextWithShadow(textRenderer, Text.literal("Red: " + r), x+130, y+10, 0xFFFFFFFF);
drawContext.drawTextWithShadow(textRenderer, Text.literal("Green: " + g), x+130, y+26, 0xFFFFFFFF);
drawContext.drawTextWithShadow(textRenderer, Text.literal("Blue: " + b), x+130, y+42, 0xFFFFFFFF);
}
}

View file

@ -2,7 +2,6 @@ package me.kawaiizenbo.moonlight.module.settings;
import me.kawaiizenbo.moonlight.util.MathUtils;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
public class DoubleSetting extends Setting
@ -23,10 +22,10 @@ public class DoubleSetting extends Setting
}
@Override
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY)
public void render(DrawContext drawContext, int x, int y, int mouseX, int mouseY)
{
super.render(matrices, x, y, mouseX, mouseY);
DrawContext.drawTextWithShadow(matrices, textRenderer, Text.literal(name), x+2, y+2, 0xFFFFFF);
super.render(drawContext, x, y, mouseX, mouseY);
drawContext.drawTextWithShadow(textRenderer, Text.literal(name), x+2, y+2, 0xFFFFFF);
double diff = Math.min(100, Math.max(0, (mouseX - x)/1.9));
if (sliding)
@ -43,11 +42,11 @@ public class DoubleSetting extends Setting
}
String valueString = ""+MathUtils.round(value, roundingPlace);
DrawContext.drawTextWithShadow(matrices, textRenderer, Text.literal(valueString), (x+190)-textRenderer.getWidth(valueString), y+2, 0xFFFFFF);
DrawContext.fill(matrices, x+2, y+16, x+190, y+18, 0xFF666666);
drawContext.drawTextWithShadow(textRenderer, Text.literal(valueString), (x+190)-textRenderer.getWidth(valueString), y+2, 0xFFFFFF);
drawContext.fill(x+2, y+16, x+190, y+18, 0xFF666666);
int scaledValue = (int)((value/max)*190);
DrawContext.fill(matrices, x+2, y+16, (x+2)+scaledValue, y+18, 0xFF55FFFF);
DrawContext.fill(matrices, x+2+(scaledValue-1), y+14, x+2+(scaledValue+1), y+20, 0xFFFFFFFF);
drawContext.fill(x+2, y+16, (x+2)+scaledValue, y+18, 0xFF55FFFF);
drawContext.fill(x+2+(scaledValue-1), y+14, x+2+(scaledValue+1), y+20, 0xFFFFFFFF);
}
@Override

View file

@ -3,7 +3,6 @@ package me.kawaiizenbo.moonlight.module.settings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
public class Setting
{
@ -12,11 +11,11 @@ public class Setting
public int height = 24;
int x = 0, y = 0;
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY)
public void render(DrawContext drawContext, int x, int y, int mouseX, int mouseY)
{
this.x = x;
this.y = y;
DrawContext.fill(matrices, x, y, x+192, y+height, hovered(mouseX, mouseY) ? 0xFF444444: 0xFF222222);
drawContext.fill(x, y, x+192, y+height, hovered(mouseX, mouseY) ? 0xFF444444: 0xFF222222);
}