2015-05-25 18:37:24 +08:00
|
|
|
--- a/net/minecraft/server/ShapelessRecipes.java
|
|
|
|
+++ b/net/minecraft/server/ShapelessRecipes.java
|
2018-07-15 08:00:00 +08:00
|
|
|
@@ -5,6 +5,10 @@
|
2017-05-19 19:00:13 +08:00
|
|
|
import com.google.gson.JsonParseException;
|
2018-07-15 08:00:00 +08:00
|
|
|
import it.unimi.dsi.fastutil.ints.IntList;
|
2016-11-17 09:41:03 +08:00
|
|
|
import java.util.Iterator;
|
2014-11-26 05:32:16 +08:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
|
|
|
|
+// CraftBukkit end
|
2017-05-14 10:00:00 +08:00
|
|
|
|
2017-05-30 19:25:59 +08:00
|
|
|
public class ShapelessRecipes implements IRecipe {
|
2014-11-26 05:32:16 +08:00
|
|
|
|
2018-07-15 08:00:00 +08:00
|
|
|
@@ -20,6 +24,20 @@
|
2017-05-14 10:00:00 +08:00
|
|
|
this.ingredients = nonnulllist;
|
2014-11-26 05:32:16 +08:00
|
|
|
}
|
2015-02-27 06:41:06 +08:00
|
|
|
|
2014-11-26 05:32:16 +08:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
|
+ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() {
|
|
|
|
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
|
|
|
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this);
|
2017-05-14 10:00:00 +08:00
|
|
|
+ for (RecipeItemStack list : this.ingredients) {
|
2018-07-15 08:00:00 +08:00
|
|
|
+ list.buildChoices();
|
|
|
|
+ net.minecraft.server.ItemStack stack = list.choices[0];
|
|
|
|
+ recipe.addIngredient(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(stack.getItem()), (list.choices.length) > 1 ? 32767 : 0);
|
2014-11-26 05:32:16 +08:00
|
|
|
+ }
|
|
|
|
+ return recipe;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2015-02-27 06:41:06 +08:00
|
|
|
+
|
2018-07-15 08:00:00 +08:00
|
|
|
public MinecraftKey getKey() {
|
|
|
|
return this.a;
|
|
|
|
}
|
|
|
|
@@ -127,11 +145,11 @@
|
|
|
|
packetdataserializer.a(shapelessrecipes.result);
|
|
|
|
}
|
|
|
|
|
|
|
|
- public IRecipe a(MinecraftKey minecraftkey, PacketDataSerializer packetdataserializer) {
|
|
|
|
+ public ShapelessRecipes a(MinecraftKey minecraftkey, PacketDataSerializer packetdataserializer) { // CraftBukkit - decompile error
|
|
|
|
return this.b(minecraftkey, packetdataserializer);
|
|
|
|
}
|
|
|
|
|
|
|
|
- public IRecipe a(MinecraftKey minecraftkey, JsonObject jsonobject) {
|
|
|
|
+ public ShapelessRecipes a(MinecraftKey minecraftkey, JsonObject jsonobject) { // CraftBukkit - decompile error
|
|
|
|
return this.b(minecraftkey, jsonobject);
|
|
|
|
}
|
2016-11-17 09:41:03 +08:00
|
|
|
}
|