From 31fa7b02b929aa00615aec38f2c9aba766eb2e00 Mon Sep 17 00:00:00 2001 From: granny Date: Thu, 18 Apr 2024 01:27:34 -0700 Subject: [PATCH 1/2] add logs when registering services (#2) * add logs when registering services * Update YardWatch.java --- .../java/me/youhavetrouble/yardwatch/YardWatch.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/me/youhavetrouble/yardwatch/YardWatch.java b/src/main/java/me/youhavetrouble/yardwatch/YardWatch.java index ffa0ba0..6c1a37a 100644 --- a/src/main/java/me/youhavetrouble/yardwatch/YardWatch.java +++ b/src/main/java/me/youhavetrouble/yardwatch/YardWatch.java @@ -18,41 +18,53 @@ public final class YardWatch extends JavaPlugin { @Override public void onEnable() { if (shouldRegisterService("WorldGuard")) { + getLogger().info("Registering WorldGuard service."); getServer().getServicesManager().register( Protection.class, new WorldGuardProtection(this), this, ServicePriority.Normal ); } if (shouldRegisterService("GriefPrevention")) { + getLogger().info("Registering GriefPrevention service."); getServer().getServicesManager().register( Protection.class, new GriefPreventionProtection(this), this, ServicePriority.Normal ); } if (shouldRegisterService("LWC")) { + getLogger().info("Registering LWC service."); getServer().getServicesManager().register( Protection.class, new LWCXProtection(this), this, ServicePriority.Normal ); } if (shouldRegisterService("Factions")) { + getLogger().info("Registering Factions service."); getServer().getServicesManager().register( Protection.class, new FactionsUUIDProtection(this), this, ServicePriority.Normal ); } if (shouldRegisterService("SuperiorSkyblock2")) { + getLogger().info("Registering SuperiorSkyblock2 service."); getServer().getServicesManager().register( Protection.class, new SuperiorSkyBlockProtection(this), this, ServicePriority.Normal ); } if (shouldRegisterService("Towny")) { + getLogger().info("Registering Towny service."); getServer().getServicesManager().register( Protection.class, new TownyProtection(this), this, ServicePriority.Normal ); } + List> registrations = getServer().getServicesManager().getRegistrations(this); + if (registrations.isEmpty()) { + getLogger().info("Registered 0 services. This plugin can be safely removed."); + } else { + getLogger().info("Successfully registered " + registrations.size() + " services."); + } } /** From 6017feccec53b38073f15e23990e930af85edfd5 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Thu, 18 Apr 2024 10:28:29 +0200 Subject: [PATCH 2/2] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 3a2857a..b62ae30 100644 --- a/readme.md +++ b/readme.md @@ -14,7 +14,7 @@ If you're a developer looking for information how to implement YardWatchAPI in y ## Implementations for: - [GriefPrevention (v16+)](https://www.spigotmc.org/resources/griefprevention.1884/) - [WorldGuard (7.0.0+)](https://enginehub.org/worldguard#downloads) -- LWCX +- [LWCX](https://www.spigotmc.org/resources/lwc-extended.69551/) - [FactionsUUID](https://www.spigotmc.org/resources/factionsuuid.1035/) - [SuperiorSkyBlock](https://bg-software.com/superiorskyblock/) - [Towny](https://github.com/TownyAdvanced/Towny)