@@ -104,9 +104,13 @@ public static DialogBody lineCityNotation(City city, String weekStr) {
104104 Component base = Component .empty ();
105105
106106 if (notation != null ) {
107- String activity = String .format ("%.2f/" + NotationNote .NOTE_ACTIVITY .getMaxNote (), Math .round (notation .getNoteActivity () * 100.0 ) / 100.0 );
108- String eco = String .format ("%.2f/" + NotationNote .NOTE_PIB .getMaxNote (), Math .round (notation .getNoteEconomy () * 100.0 ) / 100.0 );
109- String military = String .format ("%.2f/" + NotationNote .NOTE_MILITARY .getMaxNote (), Math .round (notation .getNoteMilitary () * 100.0 ) / 100.0 );
107+ double noteActivity = notation .getNoteActivity () != null ? notation .getNoteActivity () : 0 ;
108+ double noteEconomy = notation .getNoteEconomy () != null ? notation .getNoteEconomy () : 0 ;
109+ double noteMilitary = notation .getNoteMilitary () != null ? notation .getNoteMilitary () : 0 ;
110+
111+ String activity = String .format ("%.2f/" + NotationNote .NOTE_ACTIVITY .getMaxNote (), Math .round (noteActivity * 100.0 ) / 100.0 );
112+ String eco = String .format ("%.2f/" + NotationNote .NOTE_PIB .getMaxNote (), Math .round (noteEconomy * 100.0 ) / 100.0 );
113+ String military = String .format ("%.2f/" + NotationNote .NOTE_MILITARY .getMaxNote (), Math .round (noteMilitary * 100.0 ) / 100.0 );
110114 String arch = String .format ("%.2f/" + NotationNote .NOTE_ARCHITECTURAL .getMaxNote (), Math .round (notation .getNoteArchitectural () * 100.0 ) / 100.0 );
111115 String coh = String .format ("%.2f/" + NotationNote .NOTE_COHERENCE .getMaxNote (), Math .round (notation .getNoteCoherence () * 100.0 ) / 100.0 );
112116 String total = String .format ("%.2f/%.0f" , Math .round (notation .getTotalNote () * 100.0 ) / 100.0 , NotationNote .getMaxTotalNote ());
@@ -150,13 +154,18 @@ public static Component getHoverTotal(CityNotation notation) {
150154 return Component .text ("Aucun total pour vous" );
151155 }
152156
157+
158+ double noteActivity = notation .getNoteActivity () != null ? notation .getNoteActivity () : 0 ;
159+ double noteEconomy = notation .getNoteEconomy () != null ? notation .getNoteEconomy () : 0 ;
160+ double noteMilitary = notation .getNoteMilitary () != null ? notation .getNoteMilitary () : 0 ;
161+
153162 return Component .text ("§6§lDétails" )
154163 .appendNewline ()
155- .append (Component .text ("§8Activité " + notation . getNoteActivity () ))
164+ .append (Component .text ("§8Activité " + noteActivity ))
156165 .appendNewline ()
157- .append (Component .text ("§8Économie " + notation . getNoteEconomy () ))
166+ .append (Component .text ("§8Économie " + noteEconomy ))
158167 .appendNewline ()
159- .append (Component .text ("§8Militaire " + notation . getNoteMilitary () ))
168+ .append (Component .text ("§8Militaire " + noteMilitary ))
160169 .appendNewline ()
161170 .append (Component .text ("§8Architecture " + notation .getNoteArchitectural ()))
162171 .appendNewline ()
0 commit comments