Replace version constants with methods to prevent compiler inlining

This commit is contained in:
md_5
2018-12-30 16:00:31 +11:00
parent a5b9c7b3ee
commit 5be2ddcbd5
4 changed files with 9 additions and 6 deletions

View File

@@ -40,7 +40,7 @@
+
+ NBTTagCompound savedStack = new NBTTagCompound();
+ this.save(savedStack);
+ savedStack = (NBTTagCompound) MinecraftServer.getServer().dataConverterManager.update(DataConverterTypes.ITEM_STACK, new Dynamic(DynamicOpsNBT.a, savedStack), -1, CraftMagicNumbers.DATA_VERSION).getValue();
+ savedStack = (NBTTagCompound) MinecraftServer.getServer().dataConverterManager.update(DataConverterTypes.ITEM_STACK, new Dynamic(DynamicOpsNBT.a, savedStack), -1, CraftMagicNumbers.INSTANCE.getDataVersion()).getValue();
+ this.load(savedStack);
+ }
+ }

View File

@@ -24,7 +24,7 @@
nbttagcompound2.setBoolean("Snapshot", false);
nbttagcompound.set("Version", nbttagcompound2);
nbttagcompound.setInt("DataVersion", 1631);
+ if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1631) throw new AssertionError(); // CraftBukkit - sentinel
+ if (org.bukkit.craftbukkit.util.CraftMagicNumbers.INSTANCE.getDataVersion() != 1631) throw new AssertionError(); // CraftBukkit - sentinel
nbttagcompound.setLong("RandomSeed", this.e);
nbttagcompound.setString("generatorName", this.f.b());
nbttagcompound.setInt("generatorVersion", this.f.getVersion());