diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java b/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java index ced749de..851291c2 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/Slot.java @@ -11,9 +11,11 @@ import com.minelittlepony.unicopia.client.KeyBindingsHandler; import com.minelittlepony.unicopia.client.UnicopiaClient; import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.MutableText; +import net.minecraft.util.Arm; import net.minecraft.util.Colors; import net.minecraft.util.Formatting; import net.minecraft.util.math.MathHelper; @@ -135,7 +137,12 @@ class Slot { protected void renderContents(DrawContext context, AbilityDispatcher abilities, boolean bSwap, float tickDelta) { // contents - context.drawTexture(UHud.HUD_TEXTURE, 0, 0, foregroundU, foregroundV, size, size, 128, 128); + 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); + } } void renderLabel(DrawContext context, AbilityDispatcher abilities, float tickDelta) { diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java index 9abfdb00..328cbb1b 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/UHud.java @@ -135,7 +135,6 @@ public class UHud { RenderSystem.setShaderColor(1, 1, 1,1); RenderSystem.enableBlend(); - RenderSystem.setShaderTexture(0, HUD_TEXTURE); boolean swap = client.options.sneakKey.isPressed(); @@ -174,6 +173,10 @@ public class UHud { slots.forEach(slot -> slot.renderLabel(context, abilities, tickDelta)); + if (xDirection < 0) { + matrices.translate(-48, 0, 0); + } + //if (maxPages > 0) { DrawableUtil.drawScaledText(context, Text.literal((currentPage + 1) + "/" + (maxPages + 1)), 44, 38, 0.5F, Colors.WHITE); //down