@@ -92,11 +92,11 @@ private static int toggleEntityType(CommandContext<CommandSourceStack> context)
92
92
93
93
preferences .healthcarePrefs ().showType = allowEntityType ;
94
94
95
- context .getSource ().sendSuccess (
96
- Component .translatable ("healthcare.healthbar.toggledType" , allowEntityType )
97
- .withStyle (ChatFormatting .GREEN )
98
- .append ("\n " )
99
- .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
95
+ context .getSource ().sendSuccess (() ->
96
+ Component .translatable ("healthcare.healthbar.toggledType" , allowEntityType )
97
+ .withStyle (ChatFormatting .GREEN )
98
+ .append ("\n " )
99
+ .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
100
100
false
101
101
);
102
102
return 1 ;
@@ -107,16 +107,16 @@ private static int editHealthbarLength(CommandContext<CommandSourceStack> contex
107
107
int length = IntegerArgumentType .getInteger (context , "length" );
108
108
preferences .healthcarePrefs ().customLength = length ;
109
109
110
- context .getSource ().sendSuccess (
111
- Component .translatable ("healthcare.healthbar.customLengthSet" , length )
112
- .withStyle (ChatFormatting .GREEN )
113
- .append ("\n " )
114
- .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
110
+ context .getSource ().sendSuccess (() ->
111
+ Component .translatable ("healthcare.healthbar.customLengthSet" , length )
112
+ .withStyle (ChatFormatting .GREEN )
113
+ .append ("\n " )
114
+ .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
115
115
false
116
116
);
117
117
if (preferences .healthcarePrefs ().healthbarStyle != HealthbarStyle .CUSTOM ) {
118
- context .getSource ().sendSuccess (
119
- Component .translatable ("healthcare.healthbar.useCustomStyle" ).withStyle (ChatFormatting .GOLD ),
118
+ context .getSource ().sendSuccess (() ->
119
+ Component .translatable ("healthcare.healthbar.useCustomStyle" ).withStyle (ChatFormatting .GOLD ),
120
120
false
121
121
);
122
122
}
@@ -134,16 +134,16 @@ private static int setSymbol(CommandContext<CommandSourceStack> context, boolean
134
134
preferences .healthcarePrefs ().customEmptyChar = symbol ;
135
135
}
136
136
137
- context .getSource ().sendSuccess (
138
- Component .translatable ("healthcare.healthbar.customSymbolSet" , full ? "Full" : "Empty" , symbol )
139
- .withStyle (ChatFormatting .GREEN )
140
- .append ("\n " )
141
- .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
137
+ context .getSource ().sendSuccess (() ->
138
+ Component .translatable ("healthcare.healthbar.customSymbolSet" , full ? "Full" : "Empty" , symbol )
139
+ .withStyle (ChatFormatting .GREEN )
140
+ .append ("\n " )
141
+ .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
142
142
false
143
143
);
144
144
if (preferences .healthcarePrefs ().healthbarStyle != HealthbarStyle .CUSTOM ) {
145
- context .getSource ().sendSuccess (
146
- Component .translatable ("healthcare.healthbar.useCustomStyle" ).withStyle (ChatFormatting .GOLD ),
145
+ context .getSource ().sendSuccess (() ->
146
+ Component .translatable ("healthcare.healthbar.useCustomStyle" ).withStyle (ChatFormatting .GOLD ),
147
147
false
148
148
);
149
149
}
@@ -157,11 +157,11 @@ private static int changeVisibility(CommandContext<CommandSourceStack> context)
157
157
158
158
preferences .healthcarePrefs ().alwaysVisible = alwaysVisible ;
159
159
160
- context .getSource ().sendSuccess (
161
- Component .translatable ("healthcare.healthbar.visibilitySet" , alwaysVisible )
162
- .withStyle (ChatFormatting .GREEN )
163
- .append ("\n " )
164
- .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
160
+ context .getSource ().sendSuccess (() ->
161
+ Component .translatable ("healthcare.healthbar.visibilitySet" , alwaysVisible )
162
+ .withStyle (ChatFormatting .GREEN )
163
+ .append ("\n " )
164
+ .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
165
165
false
166
166
);
167
167
return 1 ;
@@ -173,11 +173,11 @@ private static int editHealthbarStyle(CommandContext<CommandSourceStack> context
173
173
174
174
preferences .healthcarePrefs ().healthbarStyle = style ;
175
175
176
- context .getSource ().sendSuccess (
177
- Component .translatable ("healthcare.healthbar.styleSet" , style )
178
- .withStyle (ChatFormatting .GREEN )
179
- .append ("\n " )
180
- .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
176
+ context .getSource ().sendSuccess (() ->
177
+ Component .translatable ("healthcare.healthbar.styleSet" , style )
178
+ .withStyle (ChatFormatting .GREEN )
179
+ .append ("\n " )
180
+ .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
181
181
false
182
182
);
183
183
return 1 ;
@@ -188,11 +188,11 @@ private static int toggleHealthBar(CommandContext<CommandSourceStack> context) t
188
188
boolean enabled = !preferences .healthcarePrefs ().enabled ;
189
189
preferences .healthcarePrefs ().enabled = enabled ;
190
190
191
- context .getSource ().sendSuccess (
192
- Component .translatable (enabled ? "healthcare.healthbar.healthbarEnabled" : "healthcare.healthbar.healthbarDisabled" )
193
- .withStyle (ChatFormatting .GREEN )
194
- .append ("\n " )
195
- .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
191
+ context .getSource ().sendSuccess (() ->
192
+ Component .translatable (enabled ? "healthcare.healthbar.healthbarEnabled" : "healthcare.healthbar.healthbarDisabled" )
193
+ .withStyle (ChatFormatting .GREEN )
194
+ .append ("\n " )
195
+ .append (Component .translatable ("healthcare.healthbar.reloadRequired" ).withStyle (ChatFormatting .GOLD )),
196
196
false
197
197
);
198
198
0 commit comments