mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-05 17:07:06 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user