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.

removed and optimized some code

authored by

LegoRaft and committed by
GitHub
0e51b012 32f40b0a

+6 -8
+6 -8
src/main/java/net/legoraft/armorhud/mixin/hudMixin.java
··· 26 26 assert this.client.player != null; 27 27 28 28 int i = this.scaledHeight - 55; 29 + int h = 63; 29 30 30 31 // Moves armorhud up if player is under water 31 - if (!client.player.isSubmergedInWater() && !client.player.isCreative()) { 32 - i = this.scaledHeight - 55; 33 - } 34 32 if (client.player.isSubmergedInWater() && !client.player.isCreative()) { 35 33 i = this.scaledHeight - 65; 36 34 } 35 + // Moves armorhud down if player is in creative 37 36 if (client.player.isCreative()) { 38 37 i = this.scaledHeight - 39; 39 38 } 40 39 41 40 // Render all armor items from player 42 - this.renderHotbarItem(this.scaledWidth / 2 + 18, i, tickDelta, client.player, this.client.player.getInventory().getArmorStack(3), 1); 43 - this.renderHotbarItem(this.scaledWidth / 2 + 33, i, tickDelta, client.player, this.client.player.getInventory().getArmorStack(2), 1); 44 - this.renderHotbarItem(this.scaledWidth / 2 + 48, i, tickDelta, client.player, this.client.player.getInventory().getArmorStack(1), 1); 45 - this.renderHotbarItem(this.scaledWidth / 2 + 63, i, tickDelta, client.player, this.client.player.getInventory().getArmorStack(0), 1); 46 - 41 + for (int j = 0; j < 4; j++) { 42 + this.renderHotbarItem(this.scaledWidth / 2 + h, i, tickDelta, client.player, this.client.player.getInventory().getArmorStack(j), 1); 43 + h = h - 15; 44 + } 47 45 } 48 46 49 47 @ModifyVariable(at = @At("STORE"), method = "renderHeldItemTooltip", ordinal = 2)