mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
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.
This commit is contained in:
parent
7f4b4fb32b
commit
b4f1f6fc59
1 changed files with 1 additions and 1 deletions
|
@ -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<NBTBase> converted = DataConverterRegistry.getDataFixer().update(DataConverterTypes.ITEM_STACK, new Dynamic<NBTBase>(DynamicOpsNBT.a, compound), -1, getDataVersion());
|
||||
+ return CraftItemStack.asCraftMirror(net.minecraft.server.ItemStack.fromCompound((NBTTagCompound) converted.getValue()));
|
||||
+ } catch (IOException ex) {
|
||||
|
|
Loading…
Add table
Reference in a new issue