Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.0.0
version=2.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private void checkGoodShapedRecipe(ItemRecipe itemRecipe, PrepareItemCraftEvent
* @param event the event
*/
private void checkGoodShapelessRecipe(ItemRecipe itemRecipe, PrepareItemCraftEvent event) {
List<ItemStack> matrix = Arrays.stream(event.getInventory().getMatrix()).filter(Objects::nonNull).toList();
List<ItemStack> matrix = Arrays.stream(event.getInventory().getMatrix()).filter(Objects::nonNull).filter(it -> it.getType() != Material.AIR).toList();
Ingredient[] itemIngredients = itemRecipe.ingredients();

AtomicBoolean isSimilar = new AtomicBoolean(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class ItemsAdderIngredient extends Ingredient {
*/
public ItemsAdderIngredient(String data, Character sign) {
super(sign);
if(!CustomStack.isInRegistry(data)) {
this.customStack = CustomStack.getInstance(data);
if(this.customStack == null) {
throw new IllegalArgumentException("The item " + data + " is not registered in ItemsAdder.");
}
this.customStack = CustomStack.getInstance(data);
}

/**
Expand All @@ -42,7 +42,10 @@ public ItemsAdderIngredient(String data) {
*/
@Override
public boolean isSimilar(ItemStack ingredient) {
return this.customStack.getItemStack().isSimilar(ingredient);
CustomStack item = CustomStack.byItemStack(ingredient);
if (item == null) return false;
if (!item.getNamespacedID().equals(this.customStack.getNamespacedID())) return false;
return true;
}

/**
Expand All @@ -53,4 +56,8 @@ public RecipeChoice choice() {
return new RecipeChoice.MaterialChoice(this.customStack.getItemStack().getType());
}

@Override
public String toString() {
return this.customStack.getNamespacedID();
}
}
2 changes: 1 addition & 1 deletion src/main/resources/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.0.0
version=2.0.1
Loading