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

@@ -11,7 +11,7 @@
public class ShapelessRecipes implements IRecipe {
@@ -20,6 +24,20 @@
@@ -20,6 +24,22 @@
this.ingredients = nonnulllist;
}
@@ -20,6 +20,8 @@
+ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() {
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this);
+ recipe.setGroup(this.b);
+
+ for (RecipeItemStack list : this.ingredients) {
+ list.buildChoices();
+ net.minecraft.server.ItemStack stack = list.choices[0];
@@ -32,7 +34,7 @@
public MinecraftKey getKey() {
return this.a;
}
@@ -127,11 +145,11 @@
@@ -127,11 +147,11 @@
packetdataserializer.a(shapelessrecipes.result);
}