RuntimeExceptions are not to be thrown

as a PR to be sure this still compiles and I haven't introduced a typo here by chance.

Will merge once checks say it's okay
This commit is contained in:
Ayutac 2022-03-31 19:27:39 +02:00
parent 0f9512efc5
commit 8394a9940b

View file

@ -44,7 +44,7 @@ public class RecipeManager {
public static <R extends RebornRecipe> RebornRecipeType<R> newRecipeType(RecipeSerde<R> recipeSerde, Identifier name) { public static <R extends RebornRecipe> RebornRecipeType<R> newRecipeType(RecipeSerde<R> recipeSerde, Identifier name) {
if (recipeTypes.containsKey(name)) { if (recipeTypes.containsKey(name)) {
throw new RuntimeException("RebornRecipe type with this name already registered"); throw new IllegalStateException("RebornRecipe type with this name already registered");
} }
RebornRecipeType<R> type = new RebornRecipeType<>(recipeSerde, name); RebornRecipeType<R> type = new RebornRecipeType<>(recipeSerde, name);
recipeTypes.put(name, type); recipeTypes.put(name, type);