From d864792d097430d803f0d52178764821cf24c46b Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Fri, 1 May 2020 16:49:39 +0200 Subject: [PATCH] Fixes #2800 Allow to wrap OfflinePlayers in 1.15.2 --- .../java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java index dcf5570f2..41ae4dedd 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/OfflinePlayerUtil.java @@ -90,7 +90,10 @@ public class OfflinePlayerUtil { Object worldServer = getWorldServer(); Class playerInteractClass = getNmsClass("PlayerInteractManager"); 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); }