1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Even more fixes!

This commit is contained in:
TheBusyBiscuit 2021-02-06 01:14:23 +01:00
parent 1e9e8be82a
commit 340005109b
2 changed files with 7 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@ -147,6 +148,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy
if (craft(inv, recipe)) {
// We are done crafting!
b.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, b.getLocation(), 16);
removeCharge(b.getLocation(), getEnergyConsumption());
}
}
@ -279,7 +281,7 @@ public abstract class AbstractAutoCrafter extends SlimefunItem implements Energy
}
// All Predicates have found a match
return true;
return inv.addItem(recipe.getResult().clone()).isEmpty();
}
return false;

View File

@ -42,8 +42,11 @@ class EnhancedRecipe extends AbstractRecipe {
for (int i = 0; i < 9; i++) {
ItemStack ingredient = item.getRecipe()[i];
if (ingredient != null && !ingredient.getType().isAir()) {
predicates.add(stack -> SlimefunUtils.isItemSimilar(stack, ingredient, true));
}
}
return predicates;
}