Skip to content

Commit

Permalink
patch air slots in item recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 14, 2020
1 parent 733fe25 commit 19188d1
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -82,6 +82,9 @@ else if (c == '/' && !brackets) {
}

public ItemStack[] textToItemArray(ItemScriptContainer container, String text) {
if (CoreUtilities.toLowerCase(text).equals("air")) {
return new ItemStack[0];
}
List<String> ingredientText = splitByNonBracketedSlashes(text);
ItemStack[] outputItems = new ItemStack[ingredientText.size()];
for (int i = 0; i < outputItems.length; i++) {
Expand Down Expand Up @@ -144,7 +147,9 @@ else if (recipeList.size() == 2) {
recipe = recipe.shape(shape1);
}
for (int i = 0; i < ingredients.size(); i++) {
NMSHandler.getItemHelper().setShapedRecipeIngredient(recipe, itemChars.charAt(i), ingredients.get(i), exacts.get(i));
if (ingredients.get(i).length != 0) {
NMSHandler.getItemHelper().setShapedRecipeIngredient(recipe, itemChars.charAt(i), ingredients.get(i), exacts.get(i));
}
}
Bukkit.addRecipe(recipe);
}
Expand Down

0 comments on commit 19188d1

Please sign in to comment.