File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -361,7 +361,7 @@ public BestRecipeResult getCookRecipeFull() {
361361 return result ;
362362 } else {
363363 RecipeEvaluation eval = found .eval ();
364- eval .fatal (new BrewDefect .CookTimeMismatch ( cookedTime , 0 ));
364+ eval .fatal (new BrewDefect .CookingNotNeeded ( ));
365365 return new BestRecipeResult .Error (found .recipe (), eval );
366366 }
367367 }
Original file line number Diff line number Diff line change @@ -107,6 +107,18 @@ public String toString() {
107107 }
108108 }
109109
110+ record CookingNotNeeded () implements BrewDefect {
111+ @ Override
112+ public List <String > getMessages (Lang lang ) {
113+ return lang .getEntries ("Defect_Overcooked" );
114+ }
115+
116+ @ Override
117+ public String toString () {
118+ return "CookingNotNeeded{}" ;
119+ }
120+ }
121+
110122 record CookTimeMismatch (int actual , int needed ) implements BrewDefect {
111123 public CookTimeMismatch {
112124 if (actual == needed ) {
Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ public Status parse(String arg) {
271271
272272 case COOK -> {
273273 int cookedTime = BUtil .parseInt (arg ).orElse (-1 );
274- if (cookedTime <= 0 ) {
274+ if (cookedTime < 0 ) {
275275 return new Status .Error (ErrorType .COOK , arg );
276276 }
277277 this .cookedTime = cookedTime ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ CMD_Distilled: '&aDistilled brew &v1 times'
4242CMD_Aged : ' &aAged brew for &v1 years'
4343CMD_Invalid_Option : ' &c"&v1" is not a valid option'
4444CMD_Duplicate_Option : ' &cDuplicate option "&v1"'
45- CMD_Invalid_Cook_Time : ' &cCook time "&v1" must be a positive integer'
45+ CMD_Invalid_Cook_Time : ' &cCook time "&v1" must be a non-negative integer'
4646CMD_Invalid_Distill_Runs : ' &cDistill runs "&v1" must be a positive integer'
4747CMD_Invalid_Wood_Type : ' &cInvalid barrel type "&v1"'
4848CMD_Invalid_Age_Time : ' &cAge time "&v1" must be a positive number'
You can’t perform that action at this time.
0 commit comments