use of net.modificationstation.stationapi.api.util.exception.MissingModException in project StationAPI by ModificationStation.
the class JsonRecipesLoader method registerRecipe.
private static void registerRecipe(URL recipe) {
try {
String rawId = new Gson().fromJson(new InputStreamReader(recipe.openStream()), JsonRecipeType.class).getType();
Identifier recipeId;
try {
recipeId = Identifier.of(rawId);
} catch (MissingModException e) {
LOGGER.warn("Found an unknown recipe type " + rawId + ". Ignoring.");
return;
}
JsonRecipesRegistry.INSTANCE.computeIfAbsent(recipeId, identifier -> new HashSet<>()).add(recipe);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations