diff options
author | md_5 <git@md-5.net> | 2017-05-16 21:22:07 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-05-16 21:22:07 +1000 |
commit | 45102fcf284d3c713d3f161123e0771396475b21 (patch) | |
tree | 53efb9a181964dfc5aa6482ec1bfa803db310c31 /nms-patches/IRecipe.patch | |
parent | c4102405677265a3369ea42b20c9061b858e4f59 (diff) | |
download | craftbukkit-45102fcf284d3c713d3f161123e0771396475b21.tar craftbukkit-45102fcf284d3c713d3f161123e0771396475b21.tar.gz craftbukkit-45102fcf284d3c713d3f161123e0771396475b21.tar.lz craftbukkit-45102fcf284d3c713d3f161123e0771396475b21.tar.xz craftbukkit-45102fcf284d3c713d3f161123e0771396475b21.zip |
Misc advancement / recipe reload fixes including SPIGOT-3240
Diffstat (limited to 'nms-patches/IRecipe.patch')
-rw-r--r-- | nms-patches/IRecipe.patch | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/nms-patches/IRecipe.patch b/nms-patches/IRecipe.patch index d4840d72..48c1ebc4 100644 --- a/nms-patches/IRecipe.patch +++ b/nms-patches/IRecipe.patch @@ -1,13 +1,37 @@ --- a/net/minecraft/server/IRecipe.java +++ b/net/minecraft/server/IRecipe.java -@@ -28,7 +28,9 @@ - return ((MinecraftKey) CraftingManager.recipes.b(this)).a((MinecraftKey) CraftingManager.recipes.b(irecipe)); +@@ -3,6 +3,7 @@ + public abstract class IRecipe implements Comparable<IRecipe> { + + protected String a; ++ public MinecraftKey key; // CraftBukkit + + public IRecipe() { + this(""); +@@ -25,10 +26,24 @@ + } + + public int a(IRecipe irecipe) { +- return ((MinecraftKey) CraftingManager.recipes.b(this)).a((MinecraftKey) CraftingManager.recipes.b(irecipe)); ++ return this.key.a(irecipe.key); // CraftBukkit } - public int compareTo(Object object) { -+ public int compareTo(IRecipe object) { // CraftBukkit = decompile error ++ public int compareTo(IRecipe object) { // CraftBukkit - decompile error return this.a((IRecipe) object); } + -+ public abstract org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit ++ // CraftBukkit start ++ @Override ++ public boolean equals(Object obj) { ++ return obj instanceof IRecipe && key.equals(((IRecipe) obj).key); ++ } ++ ++ @Override ++ public int hashCode() { ++ return key.hashCode(); ++ } ++ ++ public abstract org.bukkit.inventory.Recipe toBukkitRecipe(); ++ // CraftBukkit end } |