Fixes #2800 Allow to wrap OfflinePlayers in 1.15.2

This commit is contained in:
MeFisto94 2020-05-01 16:49:39 +02:00 committed by dordsor21
parent ed2e9a80ed
commit d864792d09

View file

@ -90,7 +90,10 @@ public class OfflinePlayerUtil {
Object worldServer = getWorldServer(); Object worldServer = getWorldServer();
Class<?> playerInteractClass = getNmsClass("PlayerInteractManager"); Class<?> playerInteractClass = getNmsClass("PlayerInteractManager");
Class<?> worldClass = getNmsClass("World"); Class<?> worldClass = getNmsClass("World");
Constructor c = makeConstructor(playerInteractClass, worldClass); Constructor<?> c = makeConstructor(playerInteractClass, worldClass);
if (c == null) {
c = makeConstructor(playerInteractClass, getNmsClass("WorldServer"));
}
return callConstructor(c, worldServer); return callConstructor(c, worldServer);
} }