2016-12-24 05:55:17 +01:00
|
|
|
package net.ME1312.SubServers.Bungee.Event;
|
2016-12-05 04:21:04 +01:00
|
|
|
|
2020-11-16 21:34:59 +01:00
|
|
|
import net.ME1312.Galaxi.Library.Util;
|
2016-12-24 05:55:17 +01:00
|
|
|
import net.ME1312.SubServers.Bungee.Host.SubServer;
|
|
|
|
import net.ME1312.SubServers.Bungee.Library.SubEvent;
|
2020-11-16 21:34:59 +01:00
|
|
|
|
2016-12-19 01:38:02 +01:00
|
|
|
import net.md_5.bungee.api.plugin.Cancellable;
|
2016-12-05 04:21:04 +01:00
|
|
|
import net.md_5.bungee.api.plugin.Event;
|
|
|
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2017-01-07 20:06:54 +01:00
|
|
|
/**
|
|
|
|
* Server Stop Event
|
|
|
|
*/
|
2016-12-19 01:38:02 +01:00
|
|
|
public class SubStopEvent extends Event implements SubEvent, Cancellable {
|
2016-12-05 04:21:04 +01:00
|
|
|
private boolean cancelled = false;
|
|
|
|
private UUID player;
|
|
|
|
private SubServer server;
|
|
|
|
private boolean force;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Server Stop Event
|
|
|
|
*
|
|
|
|
* @param player Player Stopping Server
|
2016-12-15 22:04:39 +01:00
|
|
|
* @param server Server Stopping
|
2016-12-05 04:21:04 +01:00
|
|
|
* @param force If it was a Forced Shutdown
|
|
|
|
*/
|
2016-12-15 22:04:39 +01:00
|
|
|
public SubStopEvent(UUID player, SubServer server, boolean force) {
|
2021-10-24 06:14:07 +02:00
|
|
|
Util.nullpo(server, force);
|
2016-12-05 04:21:04 +01:00
|
|
|
this.player = player;
|
|
|
|
this.server = server;
|
|
|
|
this.force = force;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Server Effected
|
2017-01-07 20:06:54 +01:00
|
|
|
*
|
2016-12-05 04:21:04 +01:00
|
|
|
* @return The Server Effected
|
|
|
|
*/
|
|
|
|
public SubServer getServer() { return server; }
|
|
|
|
|
|
|
|
/**
|
2016-12-15 22:04:39 +01:00
|
|
|
* Gets the player that triggered the Event
|
2017-01-07 20:06:54 +01:00
|
|
|
*
|
2016-12-15 22:04:39 +01:00
|
|
|
* @return The Player that triggered this Event or null if Console
|
2016-12-05 04:21:04 +01:00
|
|
|
*/
|
|
|
|
public UUID getPlayer() { return player; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets if it was a forced shutdown
|
|
|
|
*
|
|
|
|
* @return Forced Shutdown Status
|
|
|
|
*/
|
|
|
|
public boolean isForced() {
|
|
|
|
return force;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Cancelled Status
|
2017-01-07 20:06:54 +01:00
|
|
|
*
|
2016-12-05 04:21:04 +01:00
|
|
|
* @return Cancelled Status
|
|
|
|
*/
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the Cancelled Status
|
|
|
|
*/
|
|
|
|
public void setCancelled(boolean value) {
|
|
|
|
cancelled = value;
|
|
|
|
}
|
|
|
|
}
|