A mod that adds your armor to the hud modrinth.com/mod/simple-armor-hud
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: fixed some screen issues

legoraft 2697aadf 18ba0526

+20 -4
+20 -4
src/client/java/com/armorhud/config/configScreen.java
··· 1 1 package com.armorhud.config; 2 2 3 + import net.fabricmc.api.EnvType; 4 + import net.fabricmc.api.Environment; 5 + import net.minecraft.client.MinecraftClient; 3 6 import net.minecraft.client.gui.DrawContext; 4 7 import net.minecraft.client.gui.screen.Screen; 8 + import net.minecraft.client.gui.screen.option.GameOptionsScreen; 5 9 import net.minecraft.client.gui.widget.*; 6 10 import net.minecraft.text.Text; 7 11 8 - public class configScreen extends Screen { 12 + @Environment(EnvType.CLIENT) 13 + public class configScreen extends GameOptionsScreen { 9 14 private final Screen parent; 10 15 11 16 public configScreen(Screen parent) { 12 - super(Text.translatable("config.title")); 17 + super(parent, MinecraftClient.getInstance().options, Text.translatable("config.title")); 13 18 this.parent = parent; 14 19 } 15 20 ··· 51 56 .dimensions(width / 2 - 100, height - 25, 200, 20) 52 57 .build(); 53 58 59 + OptionListWidget optionListWidget = this.addDrawableChild(new OptionListWidget(this.client, this.width, this)); 60 + optionListWidget.addWidgetEntry(armorHudToggle, disableArmorBar); 61 + 62 + optionListWidget.addWidgetEntry(betterMountHudToggle, doubleHotbarToggle); 63 + 64 + optionListWidget.addWidgetEntry(armorPosition, rightToLeftToggle); 65 + optionListWidget.addWidgetEntry(trimEmptySlots, null); 66 + 54 67 addDrawableChild(doneButton); 55 68 } 56 69 70 + @Override 71 + protected void addOptions() { } 72 + 73 + @Override 57 74 public void render(DrawContext context, int mouseX, int mouseY, float delta) { 75 + context.drawCenteredTextWithShadow(this.textRenderer, Text.translatable("config.title"), this.width / 2, 12, 0xffffff); 58 76 super.render(context, mouseX, mouseY, delta); 59 - context.drawCenteredTextWithShadow(textRenderer, super.title, width / 2, 12, 0xffffff); 60 - super.init(); 61 77 } 62 78 63 79 @Override