@@ -56,22 +56,26 @@ private void renderDurationOverlay(MatrixStack matrices, CallbackInfo c) {
56
56
y += 26 ;
57
57
}
58
58
59
- String duration = getDurationAsString (statusEffectInstance );
60
- int durationLength = client .textRenderer .getWidth (duration );
61
- drawStringWithShadow (matrices , client .textRenderer , duration , x + 13 - (durationLength / 2 ), y + 14 , 0x99FFFFFF );
62
-
63
- int amplifier = statusEffectInstance .getAmplifier ();
64
- if (amplifier > 0 ) {
65
- // Most langages has "translations" for amplifier 1-5, converting to roman numerals
66
- String amplifierString = (amplifier < 6 ) ? I18n .translate ("potion.potency." + amplifier ) : "**" ;
67
- int amplifierLength = client .textRenderer .getWidth (amplifierString );
68
- drawStringWithShadow (matrices , client .textRenderer , amplifierString , x + 22 - amplifierLength , y + 3 , 0x99FFFFFF );
69
- }
59
+ drawStatusEffectOverlay (matrices , statusEffectInstance , x , y );
70
60
}
71
61
}
72
62
}
73
63
}
74
64
65
+ private void drawStatusEffectOverlay (MatrixStack matrices , StatusEffectInstance statusEffectInstance , int x , int y ) {
66
+ String duration = getDurationAsString (statusEffectInstance );
67
+ int durationLength = client .textRenderer .getWidth (duration );
68
+ drawStringWithShadow (matrices , client .textRenderer , duration , x + 13 - (durationLength / 2 ), y + 14 , 0x99FFFFFF );
69
+
70
+ int amplifier = statusEffectInstance .getAmplifier ();
71
+ if (amplifier > 0 ) {
72
+ // Most langages has "translations" for amplifier 1-5, converting to roman numerals
73
+ String amplifierString = (amplifier < 6 ) ? I18n .translate ("potion.potency." + amplifier ) : "**" ;
74
+ int amplifierLength = client .textRenderer .getWidth (amplifierString );
75
+ drawStringWithShadow (matrices , client .textRenderer , amplifierString , x + 22 - amplifierLength , y + 3 , 0x99FFFFFF );
76
+ }
77
+ }
78
+
75
79
@ NotNull
76
80
private String getDurationAsString (StatusEffectInstance statusEffectInstance ) {
77
81
int ticks = MathHelper .floor ((float ) statusEffectInstance .getDuration ());
0 commit comments