This commit is contained in:
Sollace 2024-10-29 16:50:28 +00:00
parent e00bc4feca
commit e5cf19fe55
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 12 additions and 2 deletions

View file

@ -11,9 +11,11 @@ import com.minelittlepony.unicopia.client.KeyBindingsHandler;
import com.minelittlepony.unicopia.client.UnicopiaClient; import com.minelittlepony.unicopia.client.UnicopiaClient;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.MutableText; import net.minecraft.text.MutableText;
import net.minecraft.util.Arm;
import net.minecraft.util.Colors; import net.minecraft.util.Colors;
import net.minecraft.util.Formatting; import net.minecraft.util.Formatting;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
@ -135,8 +137,13 @@ class Slot {
protected void renderContents(DrawContext context, AbilityDispatcher abilities, boolean bSwap, float tickDelta) { protected void renderContents(DrawContext context, AbilityDispatcher abilities, boolean bSwap, float tickDelta) {
// contents // contents
boolean flip = MinecraftClient.getInstance().player.getMainArm() == Arm.LEFT;
if (flip) {
context.drawTexture(UHud.HUD_TEXTURE, 0, 0, size, size, foregroundU + size, foregroundV, -size, size, 128, 128);
} else {
context.drawTexture(UHud.HUD_TEXTURE, 0, 0, foregroundU, foregroundV, size, size, 128, 128); context.drawTexture(UHud.HUD_TEXTURE, 0, 0, foregroundU, foregroundV, size, size, 128, 128);
} }
}
void renderLabel(DrawContext context, AbilityDispatcher abilities, float tickDelta) { void renderLabel(DrawContext context, AbilityDispatcher abilities, float tickDelta) {

View file

@ -135,7 +135,6 @@ public class UHud {
RenderSystem.setShaderColor(1, 1, 1,1); RenderSystem.setShaderColor(1, 1, 1,1);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.setShaderTexture(0, HUD_TEXTURE);
boolean swap = client.options.sneakKey.isPressed(); boolean swap = client.options.sneakKey.isPressed();
@ -174,6 +173,10 @@ public class UHud {
slots.forEach(slot -> slot.renderLabel(context, abilities, tickDelta)); slots.forEach(slot -> slot.renderLabel(context, abilities, tickDelta));
if (xDirection < 0) {
matrices.translate(-48, 0, 0);
}
//if (maxPages > 0) { //if (maxPages > 0) {
DrawableUtil.drawScaledText(context, Text.literal((currentPage + 1) + "/" + (maxPages + 1)), 44, 38, 0.5F, Colors.WHITE); DrawableUtil.drawScaledText(context, Text.literal((currentPage + 1) + "/" + (maxPages + 1)), 44, 38, 0.5F, Colors.WHITE);
//down //down