SPIGOT-4283: Allow setting recipe groups

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2018-08-17 20:40:54 +10:00
parent 4a4a8c110b
commit 6a88bd220a
6 changed files with 17 additions and 10 deletions

View File

@@ -26,6 +26,6 @@ public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe {
ItemStack result = this.getResult();
RecipeItemStack input = new RecipeItemStack(Stream.of(new RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(this.getInput()))));
MinecraftServer.getServer().getCraftingManager().a(new net.minecraft.server.FurnaceRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), "", input, CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime()));
MinecraftServer.getServer().getCraftingManager().a(new net.minecraft.server.FurnaceRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), input, CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime()));
}
}

View File

@@ -56,6 +56,6 @@ public class CraftShapedRecipe extends ShapedRecipe implements CraftRecipe {
}
}
MinecraftServer.getServer().getCraftingManager().a(new ShapedRecipes(CraftNamespacedKey.toMinecraft(this.getKey()), "", width, shape.length, data, CraftItemStack.asNMSCopy(this.getResult())));
MinecraftServer.getServer().getCraftingManager().a(new ShapedRecipes(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), width, shape.length, data, CraftItemStack.asNMSCopy(this.getResult())));
}
}

View File

@@ -44,6 +44,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
data.set(i, new RecipeItemStack(Stream.of(new RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(ingred.get(i))))));
}
MinecraftServer.getServer().getCraftingManager().a(new ShapelessRecipes(CraftNamespacedKey.toMinecraft(this.getKey()), "", CraftItemStack.asNMSCopy(this.getResult()), data));
MinecraftServer.getServer().getCraftingManager().a(new ShapelessRecipes(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftItemStack.asNMSCopy(this.getResult()), data));
}
}