From 403622d205386597127f17495e104a56671e3436 Mon Sep 17 00:00:00 2001 From: Ricardo Borutta Date: Mon, 29 Jan 2024 10:21:24 +0100 Subject: [PATCH] Use the OfflinePlayer$getPlayer method instead of casting to Player class You should use this to avoid a class cast exception if some other plugins uses an own Implementation of the offline player. --- src/main/java/me/clip/placeholderapi/PlaceholderHook.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderHook.java b/src/main/java/me/clip/placeholderapi/PlaceholderHook.java index 622260f..9e7478f 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderHook.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderHook.java @@ -29,7 +29,7 @@ public abstract class PlaceholderHook { @Nullable public String onRequest(final OfflinePlayer player, @NotNull final String params) { if (player != null && player.isOnline()) { - return onPlaceholderRequest((Player) player, params); + return onPlaceholderRequest(player.getPlayer(), params); } return onPlaceholderRequest(null, params);