Skip to content

Commit

Permalink
Add info about service providers to debugpaste
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell committed Nov 3, 2023
1 parent e689337 commit 881c7fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
Expand Down Expand Up @@ -1178,6 +1179,17 @@ public void setGenerator(final @NonNull String worldName) {
.append(" • Load Before: ").append(p.getDescription().getLoadBefore()).append("\n")
.append(" • Dependencies: ").append(p.getDescription().getDepend()).append("\n")
.append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n");
List<RegisteredServiceProvider<?>> providers = Bukkit.getServicesManager().getRegistrations(p);
if (!providers.isEmpty()) {
msg.append(" • Provided Services: \n");
for (RegisteredServiceProvider<?> provider : providers) {
msg.append(" • ")
.append(provider.getService().getName()).append(" = ")
.append(provider.getProvider().getClass().getName())
.append(" (priority: ").append(provider.getPriority()).append(")")
.append("\n");
}
}
}
return msg.toString();
}
Expand Down

0 comments on commit 881c7fc

Please sign in to comment.