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:
parent
1e9e8be82a
commit
340005109b
@ -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;
|
||||
|
@ -42,7 +42,10 @@ class EnhancedRecipe extends AbstractRecipe {
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack ingredient = item.getRecipe()[i];
|
||||
predicates.add(stack -> SlimefunUtils.isItemSimilar(stack, ingredient, true));
|
||||
|
||||
if (ingredient != null && !ingredient.getType().isAir()) {
|
||||
predicates.add(stack -> SlimefunUtils.isItemSimilar(stack, ingredient, true));
|
||||
}
|
||||
}
|
||||
|
||||
return predicates;
|
||||
|
Loading…
Reference in New Issue
Block a user