mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 06:36:44 +01:00
Add info about service providers to debugpaste (#4226)
This commit is contained in:
parent
e689337188
commit
e3bfd9b8bf
@ -135,6 +135,7 @@ import org.bukkit.generator.ChunkGenerator;
|
||||
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;
|
||||
@ -1178,6 +1179,17 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
.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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user