mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 13:27:47 +01:00
SPIGOT-5222: Cannot get Long values from Entity memory
This commit is contained in:
parent
f0b3fe4359
commit
104b3831f8
@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity.memory;
|
|||||||
|
|
||||||
import net.minecraft.server.BlockPosition;
|
import net.minecraft.server.BlockPosition;
|
||||||
import net.minecraft.server.GlobalPos;
|
import net.minecraft.server.GlobalPos;
|
||||||
|
import net.minecraft.server.MinecraftSerializableLong;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
@ -14,8 +15,8 @@ public final class CraftMemoryMapper {
|
|||||||
public static Object fromNms(Object object) {
|
public static Object fromNms(Object object) {
|
||||||
if (object instanceof GlobalPos) {
|
if (object instanceof GlobalPos) {
|
||||||
return fromNms((GlobalPos) object);
|
return fromNms((GlobalPos) object);
|
||||||
} else if (object instanceof Long) {
|
} else if (object instanceof MinecraftSerializableLong) {
|
||||||
return object;
|
return ((MinecraftSerializableLong) object).a();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new UnsupportedOperationException("Do not know how to map " + object);
|
throw new UnsupportedOperationException("Do not know how to map " + object);
|
||||||
@ -27,7 +28,7 @@ public final class CraftMemoryMapper {
|
|||||||
} else if (object instanceof Location) {
|
} else if (object instanceof Location) {
|
||||||
return toNms((Location) object);
|
return toNms((Location) object);
|
||||||
} else if (object instanceof Long) {
|
} else if (object instanceof Long) {
|
||||||
return object;
|
return MinecraftSerializableLong.a((Long) object);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new UnsupportedOperationException("Do not know how to map " + object);
|
throw new UnsupportedOperationException("Do not know how to map " + object);
|
||||||
|
Loading…
Reference in New Issue
Block a user