mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-02-05 03:45:28 +01: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:
parent
1cd4d93f7f
commit
403622d205
@ -29,7 +29,7 @@ public abstract class PlaceholderHook {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public String onRequest(final OfflinePlayer player, @NotNull final String params) {
|
public String onRequest(final OfflinePlayer player, @NotNull final String params) {
|
||||||
if (player != null && player.isOnline()) {
|
if (player != null && player.isOnline()) {
|
||||||
return onPlaceholderRequest((Player) player, params);
|
return onPlaceholderRequest(player.getPlayer(), params);
|
||||||
}
|
}
|
||||||
|
|
||||||
return onPlaceholderRequest(null, params);
|
return onPlaceholderRequest(null, params);
|
||||||
|
Loading…
Reference in New Issue
Block a user