Compare commits

..

4 Commits

Author SHA1 Message Date
Gabriel Dumitru
882b7c5965
Merge pull request #1046 from PlaceholderAPI/feature/add-plugin-authors
Add Plugin Authors to /papi dump
2024-03-07 22:59:42 +02:00
Gabriel Dumitru
7a0be5edf8
Merge pull request #1040 from DevCyntrix/fix-class-cast-exception
Use the OfflinePlayer$getPlayer method instead of casting to Player class
2024-03-07 22:59:24 +02:00
Andre601
e94328935d
Add Plugin Authors to /papi dump 2024-02-25 14:42:48 +01:00
Ricardo Borutta
403622d205 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.
2024-01-29 10:21:24 +01:00
2 changed files with 4 additions and 2 deletions

@ -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);

@ -200,7 +200,9 @@ public final class CommandDump extends PlaceholderCommand {
for (final Plugin other : plugins) { for (final Plugin other : plugins) {
builder.append(" ") builder.append(" ")
.append(String.format("%-" + size + "s", other.getName())) .append(String.format("%-" + size + "s", other.getName()))
.append(" [Version: ") .append(" [Authors: [")
.append(String.join(", ", other.getDescription().getAuthors()))
.append("], Version: ")
.append(other.getDescription().getVersion()) .append(other.getDescription().getVersion())
.append("]") .append("]")
.append("\n"); .append("\n");