summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-28 14:39:35 +1000
committermd_5 <git@md-5.net>2018-07-28 15:00:12 +1000
commit212fd0f230cb8eebe43e977f171e147c9d85ac71 (patch)
treee8a531f5841600c5d10871f13b5bb6687c615567 /nms-patches
parente3c21decb0bff39ec2e4bb3c95a6554ea3755609 (diff)
downloadcraftbukkit-212fd0f230cb8eebe43e977f171e147c9d85ac71.tar
craftbukkit-212fd0f230cb8eebe43e977f171e147c9d85ac71.tar.gz
craftbukkit-212fd0f230cb8eebe43e977f171e147c9d85ac71.tar.lz
craftbukkit-212fd0f230cb8eebe43e977f171e147c9d85ac71.tar.xz
craftbukkit-212fd0f230cb8eebe43e977f171e147c9d85ac71.zip
SPIGOT-4166: Fix Tags being corrupted by early access (and not reflecting reloads)
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/TagRegistry.patch14
-rw-r--r--nms-patches/TagsServer.patch28
2 files changed, 42 insertions, 0 deletions
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<T> extends Tags<T> {
+
+ private final RegistryMaterials<MinecraftKey, T> a;
++ public int version; // CraftBukkit
+
+ public TagsServer(RegistryMaterials<MinecraftKey, T> 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<T>) Tag.a.a().a((Collection) arraylist).b(minecraftkey)); // CraftBukkit - decompile error
+ }
+
+ }