33import com .comphenix .protocol .ProtocolLibrary ;
44import com .comphenix .protocol .ProtocolManager ;
55
6+ import org .bukkit .plugin .Plugin ;
67import org .bukkit .plugin .PluginManager ;
78import org .bukkit .plugin .java .JavaPlugin ;
89
@@ -19,8 +20,19 @@ public void onEnable() {
1920 final PluginManager pluginManager = getServer ().getPluginManager ();
2021 final ProtocolManager protocolManager = ProtocolLibrary .getProtocolManager ();
2122
22- if (pluginManager .getPlugin ("ViaRewind-Legacy-Support" ) == null || !configurationUtil .getConfiguration ("%datafolder%/ViaRewind-Legacy-Support/config.yml" ).getBoolean ("area-effect-cloud-particles" ))
23+ if (pluginManager .isPluginEnabled ("ProtocolSupport" ) || pluginManager .isPluginEnabled ("ViaRewind" )) {
24+ getLogger ().info ("ViaRewind/ProtocolSupport detected, enabling integration." );
25+ } else if (pluginManager .isPluginEnabled ("ViaBackwards" )) {
26+ getLogger ().warning ("ViaBackwards detected. In order to make ViaPotions work correctly, it is required that you have ViaRewind installed." );
27+ } else {
28+ getLogger ().severe ("No compatible plugins have been detected, disabling the plugin." );
29+ getLogger ().severe ("In order to make ViaPotions functional, ViaRewind or ProtocolSupport must be installed." );
30+ pluginManager .disablePlugin (this );
31+ }
32+
33+ if (pluginManager .getPlugin ("ViaRewind-Legacy-Support" ) == null || !configurationUtil .getConfiguration ("%datafolder%/ViaRewind-Legacy-Support/config.yml" ).getBoolean ("area-effect-cloud-particles" )) {
2334 pluginManager .registerEvents (new AreaEffectCloudListener (this , versionUtil ), this );
35+ }
2436
2537 protocolManager .addPacketListener (new SpawnEntityListener (this , versionUtil ));
2638 protocolManager .addPacketListener (new WorldEventAdapter (this , versionUtil ));
0 commit comments