From 212fd0f230cb8eebe43e977f171e147c9d85ac71 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 28 Jul 2018 14:39:35 +1000 Subject: SPIGOT-4166: Fix Tags being corrupted by early access (and not reflecting reloads) --- nms-patches/TagRegistry.patch | 14 ++++++++++++++ nms-patches/TagsServer.patch | 28 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 nms-patches/TagRegistry.patch create mode 100644 nms-patches/TagsServer.patch (limited to 'nms-patches') diff --git a/nms-patches/TagRegistry.patch b/nms-patches/TagRegistry.patch new file mode 100644 index 00000000..e4dafa6a --- /dev/null +++ b/nms-patches/TagRegistry.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/server/TagRegistry.java ++++ b/net/minecraft/server/TagRegistry.java +@@ -38,6 +38,11 @@ + TagsBlock.a((Tags) this.a); + TagsItem.a((Tags) this.b); + TagsFluid.a((Tags) this.c); ++ // CraftBukkit start ++ this.a.version++; ++ this.b.version++; ++ this.c.version++; ++ // CraftBukkit end + } + + public void a(PacketDataSerializer packetdataserializer) { diff --git a/nms-patches/TagsServer.patch b/nms-patches/TagsServer.patch new file mode 100644 index 00000000..b5ed85d1 --- /dev/null +++ b/nms-patches/TagsServer.patch @@ -0,0 +1,28 @@ +--- a/net/minecraft/server/TagsServer.java ++++ b/net/minecraft/server/TagsServer.java +@@ -11,6 +11,7 @@ + public class TagsServer extends Tags { + + private final RegistryMaterials a; ++ public int version; // CraftBukkit + + public TagsServer(RegistryMaterials registrymaterials, String s, String s1) { + super(registrymaterials::d, registrymaterials::get, s, false, s1); +@@ -31,7 +32,7 @@ + while (iterator1.hasNext()) { + Object object = iterator1.next(); + +- packetdataserializer.d(this.a.a(object)); ++ packetdataserializer.d(this.a.a((T) object)); // CraftBukkit - decompile error + } + } + +@@ -49,7 +50,7 @@ + arraylist.add(this.a.getId(packetdataserializer.g())); + } + +- this.c().put(minecraftkey, Tag.a.a().a((Collection) arraylist).b(minecraftkey)); ++ this.c().put(minecraftkey, (Tag) Tag.a.a().a((Collection) arraylist).b(minecraftkey)); // CraftBukkit - decompile error + } + + } -- cgit v1.2.3