From b4f1f6fc59509bb3bdd21beee8e8f4d19ed3c149 Mon Sep 17 00:00:00 2001 From: Mariell Date: Mon, 18 May 2020 19:24:06 +0200 Subject: [PATCH] Fix data version check for ItemStack serialization (#3394) The expected version should be equal to or newer than the one stored. Although Aikar claims he did this on accident (and NOT my ligatures!), I claim this is all a big conspiracy by followers of the Taco cult. --- .../Add-Raw-Byte-ItemStack-Serialization.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch b/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch index 568440a50..159b92d02 100644 --- a/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch +++ b/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch @@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ); + int dataVersion = compound.getInt("DataVersion"); + -+ Preconditions.checkArgument(dataVersion < getDataVersion(), "Newer version! Server downgrades are not supported!"); ++ Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); + Dynamic converted = DataConverterRegistry.getDataFixer().update(DataConverterTypes.ITEM_STACK, new Dynamic(DynamicOpsNBT.a, compound), -1, getDataVersion()); + return CraftItemStack.asCraftMirror(net.minecraft.server.ItemStack.fromCompound((NBTTagCompound) converted.getValue())); + } catch (IOException ex) {