Adds comments to the plugin event listener
This commit is contained in:
parent
889a9d2cbc
commit
1da0f4eddc
@ -28,6 +28,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* This listener listens to any player-related events related to stargates
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class PlayerEventsListener implements Listener {
|
||||
|
||||
private static long eventTime;
|
||||
|
@ -7,26 +7,47 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
|
||||
/**
|
||||
* This listener listens for any plugins being enabled or disabled to catch the loading of vault
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class PluginEventListener implements Listener {
|
||||
|
||||
private final Stargate stargate;
|
||||
|
||||
/**
|
||||
* Instantiates a new plugin event listener
|
||||
*
|
||||
* @param stargate <p>A reference to the stargate plugin to </p>
|
||||
*/
|
||||
public PluginEventListener(Stargate stargate) {
|
||||
this.stargate = stargate;
|
||||
}
|
||||
|
||||
/**
|
||||
* This event listens for and announces that the vault plugin was detected and enabled
|
||||
*
|
||||
* <p>Each time this event is called, the economy handler will try to enable vault</p>
|
||||
* @param ignored <p>The actual event called. This is currently not used</p>
|
||||
*/
|
||||
@EventHandler
|
||||
public void onPluginEnable(PluginEnableEvent event) {
|
||||
public void onPluginEnable(PluginEnableEvent ignored) {
|
||||
if (EconomyHandler.setupEconomy(stargate.getServer().getPluginManager())) {
|
||||
String vaultVersion = EconomyHandler.vault.getDescription().getVersion();
|
||||
Stargate.log.info(Stargate.getString("prefix") +
|
||||
stargate.getLogger().info(Stargate.getString("prefix") +
|
||||
Stargate.replaceVars(Stargate.getString("vaultLoaded"), "%version%", vaultVersion));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This event listens for the vault plugin being disabled and notifies the console
|
||||
*
|
||||
* @param event <p>The event caused by disabling a plugin</p>
|
||||
*/
|
||||
@EventHandler
|
||||
public void onPluginDisable(PluginDisableEvent event) {
|
||||
if (event.getPlugin().equals(EconomyHandler.vault)) {
|
||||
Stargate.log.info(Stargate.getString("prefix") + "Vault plugin lost.");
|
||||
stargate.getLogger().info(Stargate.getString("prefix") + "Vault plugin lost.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user