diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-11 05:32:05 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-11 06:05:54 -0600 |
commit | 4e91fbd0dbcc3a56b5b61e287a87e91079edec33 (patch) | |
tree | b3029219fa7a5f13ebb4768ae85a092c617cce02 /src/main/java/net/minecraft/server/Entity.java | |
parent | 39fdb56200d18756111cf3bb271c0a4f5adb82d8 (diff) | |
download | craftbukkit-4e91fbd0dbcc3a56b5b61e287a87e91079edec33.tar craftbukkit-4e91fbd0dbcc3a56b5b61e287a87e91079edec33.tar.gz craftbukkit-4e91fbd0dbcc3a56b5b61e287a87e91079edec33.tar.lz craftbukkit-4e91fbd0dbcc3a56b5b61e287a87e91079edec33.tar.xz craftbukkit-4e91fbd0dbcc3a56b5b61e287a87e91079edec33.zip |
Fix players not being able to pickup items due to default values.
The old flag for picking up loot was default to false, making existing players not able to pickup items. We now use this flag for Players, which gives us the problem we had in 48b46f83.
To fix this, we add an incremental flag that will be cross-examined to check if the data was saved before or after the flag level was introduced.
Addresses BUKKIT-3143
Diffstat (limited to 'src/main/java/net/minecraft/server/Entity.java')
-rw-r--r-- | src/main/java/net/minecraft/server/Entity.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 9471fcf1..ba09ace7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -29,6 +29,13 @@ import org.bukkit.plugin.PluginManager; public abstract class Entity { + // CraftBukkit start + private static final int CURRENT_LEVEL = 1; + static boolean isLevelAtLeast(NBTTagCompound tag, int level) { + return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; + } + // CraftBukkit end + private static int entityCount = 0; public int id; public double l; @@ -1087,6 +1094,7 @@ public abstract class Entity { nbttagcompound.setLong("WorldUUIDMost", this.world.getDataManager().getUUID().getMostSignificantBits()); nbttagcompound.setLong("UUIDLeast", this.uniqueId.getLeastSignificantBits()); nbttagcompound.setLong("UUIDMost", this.uniqueId.getMostSignificantBits()); + nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL); // CraftBukkit end this.b(nbttagcompound); } catch (Throwable throwable) { |