Only accept square recipes in /condense

Fixes #1194.
This commit is contained in:
md678685 2019-06-16 13:28:02 +01:00
parent 9b77c0802b
commit dbd86155fb

View file

@ -135,6 +135,10 @@ public class Commandcondense extends EssentialsCommand {
if (recipe instanceof ShapedRecipe) {
ShapedRecipe sRecipe = (ShapedRecipe) recipe;
if (sRecipe.getShape().length != sRecipe.getShape()[0].length()) {
// Only accept square recipes
return null;
}
inputList = sRecipe.getIngredientMap().values();
} else if (recipe instanceof ShapelessRecipe) {
ShapelessRecipe slRecipe = (ShapelessRecipe) recipe;