From 104b3831f885f8929a999c185fa283de0b509fac Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 29 Jul 2019 16:37:40 +1000 Subject: [PATCH] SPIGOT-5222: Cannot get Long values from Entity memory --- .../craftbukkit/entity/memory/CraftMemoryMapper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java index 65470e7ec3..e7eacfc74c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/memory/CraftMemoryMapper.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity.memory; import net.minecraft.server.BlockPosition; import net.minecraft.server.GlobalPos; +import net.minecraft.server.MinecraftSerializableLong; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; @@ -14,8 +15,8 @@ public final class CraftMemoryMapper { public static Object fromNms(Object object) { if (object instanceof GlobalPos) { return fromNms((GlobalPos) object); - } else if (object instanceof Long) { - return object; + } else if (object instanceof MinecraftSerializableLong) { + return ((MinecraftSerializableLong) object).a(); } throw new UnsupportedOperationException("Do not know how to map " + object); @@ -27,7 +28,7 @@ public final class CraftMemoryMapper { } else if (object instanceof Location) { return toNms((Location) object); } else if (object instanceof Long) { - return object; + return MinecraftSerializableLong.a((Long) object); } throw new UnsupportedOperationException("Do not know how to map " + object);