|
39 | 39 | import org.bukkit.plugin.Plugin; |
40 | 40 | import com.skyblockexp.ezrtp.teleport.ChunkyProvider; |
41 | 41 | import com.skyblockexp.ezrtp.teleport.ChunkyRuntimeProvider; |
| 42 | +import com.skyblockexp.ezrtp.pvptag.PvpTagService; |
42 | 43 | // Chunky API is optional; use runtime loader via ChunkyRuntimeProvider |
43 | 44 |
|
44 | 45 | import java.io.File; |
@@ -86,6 +87,7 @@ public final class EzRtpPluginBootstrap { |
86 | 87 | private UsageResetScheduler usageResetScheduler; |
87 | 88 | private final HeatmapSimulationStore heatmapSimulationStore = new HeatmapSimulationStore(); |
88 | 89 | private com.skyblockexp.ezrtp.teleport.ChunkyWarmupCoordinator chunkyWarmupCoordinator; |
| 90 | + private PvpTagService pvpTagService; |
89 | 91 |
|
90 | 92 | public EzRtpPluginBootstrap(EzRtpPlugin plugin) { |
91 | 93 | this.plugin = plugin; |
@@ -238,6 +240,24 @@ public void reloadPluginConfiguration() { |
238 | 240 | plugin.getLogger().info("Chunky integration disabled in configuration."); |
239 | 241 | chunkyAPI = null; |
240 | 242 | } |
| 243 | + |
| 244 | + // Initialize PvP tag providers once; registered only when the corresponding plugin is present. |
| 245 | + if (pvpTagService == null) { |
| 246 | + pvpTagService = new PvpTagService(); |
| 247 | + if (plugin.getServer().getPluginManager().isPluginEnabled("CombatLogX")) { |
| 248 | + pvpTagService.registerProvider(new com.skyblockexp.ezrtp.pvptag.CombatLogXPvpTagProvider()); |
| 249 | + plugin.getLogger().info("PvP tag integration: CombatLogX detected."); |
| 250 | + } |
| 251 | + if (plugin.getServer().getPluginManager().isPluginEnabled("PvPManager")) { |
| 252 | + pvpTagService.registerProvider(new com.skyblockexp.ezrtp.pvptag.PvpManagerPvpTagProvider()); |
| 253 | + plugin.getLogger().info("PvP tag integration: PvPManager detected."); |
| 254 | + } |
| 255 | + if (plugin.getServer().getPluginManager().isPluginEnabled("CombatLog")) { |
| 256 | + pvpTagService.registerProvider(new com.skyblockexp.ezrtp.pvptag.SimpleCombatLogPvpTagProvider()); |
| 257 | + plugin.getLogger().info("PvP tag integration: Simple Combat Log detected."); |
| 258 | + } |
| 259 | + } |
| 260 | + |
241 | 261 | messageProvider = configurationService.getMessageProvider(); |
242 | 262 | // Initialize text rendering settings (force legacy conversion for older clients) |
243 | 263 | boolean forceLegacy = configurationService.getEffectiveBaseConfiguration().getBoolean("messages.force-legacy-colors", false); |
@@ -272,7 +292,7 @@ public void reloadPluginConfiguration() { |
272 | 292 | teleportService = new RandomTeleportService(plugin, defaultSettings, |
273 | 293 | configuration.getQueueSettings(), economyService, |
274 | 294 | (player, settings) -> configuration.resolveTeleportCost(player, settings), |
275 | | - protectionRegistry, messageProvider, ChunkLoadStrategyRegistry.get(), PlatformRuntimeRegistry.get(), chunkyAPI, chunkyWarmupCoordinator); |
| 295 | + protectionRegistry, messageProvider, ChunkLoadStrategyRegistry.get(), PlatformRuntimeRegistry.get(), chunkyAPI, chunkyWarmupCoordinator, pvpTagService); |
276 | 296 | try { EzRtpAPI.registerProvider(plugin, teleportService); } catch (Throwable ignored) {} |
277 | 297 | } else { |
278 | 298 | teleportService.reload(defaultSettings, configuration.getQueueSettings()); |
|
0 commit comments