use of knightminer.ceramics.recipe.KilnRecipe in project Ceramics by KnightMiner.
the class JEIPlugin method registerRecipes.
@Override
public void registerRecipes(IRecipeRegistration registration) {
ClientWorld world = Minecraft.getInstance().world;
assert world != null;
RecipeManager recipeManager = world.getRecipeManager();
List<KilnRecipe> results = new ArrayList<>();
for (IRecipe<IInventory> recipe : recipeManager.getRecipes(Registration.KILN_RECIPE).values()) {
// ignore dynamic
if (recipe.isDynamic()) {
continue;
}
// validate output
ItemStack output = recipe.getRecipeOutput();
if (output.isEmpty()) {
Ceramics.LOG.error("Invalid kiln recipe {}, no output", recipe.getId());
continue;
}
List<Ingredient> ingredients = recipe.getIngredients();
if (ingredients.size() != 1) {
Ceramics.LOG.error("Invalid kiln recipe {}, wrong number of inputs", recipe.getId());
continue;
}
// recipe type
if (!(recipe instanceof KilnRecipe)) {
Ceramics.LOG.error("Invalid kiln recipe {}, wrong class", recipe.getId());
continue;
}
// add to list
results.add((KilnRecipe) recipe);
}
registration.addRecipes(results, KilnCategory.UID);
// clay repair info
List<ItemStack> clayRepair = CeramicsTags.Items.TERRACOTTA_CRACK_REPAIR.getAllElements().stream().map(ItemStack::new).collect(Collectors.toList());
registration.addIngredientInfo(clayRepair, VanillaTypes.ITEM, Ceramics.lang("jei", "clay_repair"));
}
Aggregations