mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fix #504
This commit is contained in:
parent
e00bc4feca
commit
e5cf19fe55
2 changed files with 12 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue