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.

Merge pull request #43 from legoraft/dev

Fixed up some warnings and added buttons. This finalizes the 1.20.6 release

authored by

Legoraft and committed by
GitHub
a8c37eb8 8aaa733f

+10 -9
-2
build.gradle
··· 39 39 mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" 40 40 modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" 41 41 42 - // include modImplementation("dev.lambdaurora:spruceui:${project.spruceui_version}") 43 - 44 42 modApi "com.terraformersmc:modmenu:${project.modmenu_version}" 45 43 46 44 // Fabric API. This is technically optional, but you probably want it anyway.
+1 -2
gradle.properties
··· 9 9 loader_version=0.15.11 10 10 11 11 # Mod Properties 12 - mod_version=1.4.2 12 + mod_version=1.4.3 13 13 maven_group=com.armorhud 14 14 archives_base_name=simple-armor-hud 15 15 16 16 # Dependency properties 17 17 fabric_version=0.99.0+1.20.6 18 18 modmenu_version=10.0.0-beta.1 19 - spruceui_version=5.0.3+1.20.4
+5 -4
src/client/java/com/armorhud/config/config.java
··· 37 37 public static void save() { 38 38 Properties properties = new Properties(); 39 39 write(properties); 40 + 40 41 if (!Files.exists(CONFIG_PATH)) { 41 42 try { 42 43 Files.createFile(CONFIG_PATH); 43 44 } catch (IOException e) { 44 45 LogManager.getLogger("Simple Survival Tweaks").error("Failed to create config file"); 45 - e.printStackTrace(); 46 46 } 47 47 } 48 + 48 49 try { 49 50 properties.store(Files.newOutputStream(CONFIG_PATH), "Simple Survival Tweaks config file"); 50 51 } catch (IOException e) { 51 52 LogManager.getLogger("Simple Survival Tweaks").error("Failed to write config"); 52 - e.printStackTrace(); 53 53 } 54 54 } 55 55 56 56 public void load() { 57 57 Properties properties = new Properties(); 58 + 58 59 if (!Files.exists(CONFIG_PATH)) { 59 60 try { 60 61 Files.createFile(CONFIG_PATH); 61 62 save(); 62 63 } catch (IOException e) { 63 64 LogManager.getLogger("Simple Survival Tweaks").error("Failed to create config file"); 64 - e.printStackTrace(); 65 65 } 66 66 } 67 + 67 68 try { 68 69 properties.load(Files.newInputStream(CONFIG_PATH)); 69 70 } catch (IOException e) { 70 71 LogManager.getLogger("Simple Survival Tweaks").error("Failed to read config"); 71 - e.printStackTrace(); 72 72 } 73 + 73 74 read(properties); 74 75 } 75 76
+4 -1
src/client/java/com/armorhud/config/fabricScreen.java
··· 2 2 3 3 import net.minecraft.client.gui.screen.Screen; 4 4 import net.minecraft.client.gui.screen.option.GameOptionsScreen; 5 - import net.minecraft.client.gui.tooltip.Tooltip; 6 5 import net.minecraft.client.gui.widget.*; 7 6 import net.minecraft.text.Text; 8 7 ··· 42 41 .build(Text.translatable("config.disablearmorbar"), ((button, value) -> config.DISABLE_ARMOR_BAR = !config.DISABLE_ARMOR_BAR)); 43 42 44 43 optionListWidget.addWidgetEntry(doubleHotbarToggle, betterMountHudToggle); 44 + optionListWidget.addWidgetEntry(armorHudToggle, rightToLeftToggle); 45 + optionListWidget.addWidgetEntry(disableArmorBar, null); 45 46 super.init(); 46 47 } 47 48 48 49 @Override 49 50 public void close() { 51 + assert this.client != null; 52 + 50 53 config.save(); 51 54 this.client.setScreen(this.parent); 52 55 }