Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Aug 3, 2023
2 parents b9d1587 + 6fa0a89 commit 0860ea3
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
import com.shanebeestudios.skbee.SkBee;
import com.shanebeestudios.skbee.config.Config;
import com.shanebeestudios.skbee.api.recipe.RecipeUtil;
import com.shanebeestudios.skbee.config.Config;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
Expand Down Expand Up @@ -85,15 +85,15 @@ protected void execute(Event event) {
RecipeUtil.error("Current Item: §6" + this.toString(event, true));
return;
}
if (ingredients == null) {
RecipeUtil.error("Error registering crafting recipe - ingredient is null");
// Ingredients can't be null, however length can be '0'
if (ingredients.length == 0) {
RecipeUtil.error("Error registering crafting recipe - a minimum of at least 1 ingredient needs to be defined");
RecipeUtil.error("Current Item: §6" + this.toString(event, true));
return;
}

if (ingredients.length != 4 && ingredients.length != 9) {
RecipeUtil.error("Error registering crafting recipe - requires 4 or 9 ingredients");
RecipeUtil.error("Current Item: §6" + this.toString(event, true));
if (ingredients.length > 9) {
RecipeUtil.error("Error registering crafting recipe - a maximum of 9 ingredients can be defined");
RecipeUtil.error("Current Item: &6" + this.toString(event, true));
return;
}

Expand Down

0 comments on commit 0860ea3

Please sign in to comment.