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;
|
2021-12-01 10:50:25 +01:00
|
|
|
import net.ME1312.SubServers.Bungee.Host.Server;
|
2016-12-24 05:55:17 +01:00
|
|
|
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 Command Event
|
|
|
|
*/
|
2016-12-19 01:38:02 +01:00
|
|
|
public class SubSendCommandEvent extends Event implements SubEvent, Cancellable {
|
2016-12-05 04:21:04 +01:00
|
|
|
private boolean cancelled = false;
|
|
|
|
private UUID player;
|
2021-12-01 10:50:25 +01:00
|
|
|
private Server server;
|
2016-12-05 04:21:04 +01:00
|
|
|
private String command;
|
2021-12-01 10:50:25 +01:00
|
|
|
private UUID target;
|
2016-12-05 04:21:04 +01:00
|
|
|
|
|
|
|
/**
|
2016-12-15 22:04:39 +01:00
|
|
|
* Server Command Event
|
2016-12-05 04:21:04 +01:00
|
|
|
*
|
2021-12-01 10:50:25 +01:00
|
|
|
* @param player Player Commanding
|
|
|
|
* @param server Target Server
|
|
|
|
* @param command Command to Send
|
|
|
|
* @param target Player that will send
|
2016-12-05 04:21:04 +01:00
|
|
|
*/
|
2021-12-01 10:50:25 +01:00
|
|
|
public SubSendCommandEvent(UUID player, Server server, String command, UUID target) {
|
2021-10-24 06:14:07 +02:00
|
|
|
Util.nullpo(server, command);
|
2016-12-05 04:21:04 +01:00
|
|
|
this.player = player;
|
|
|
|
this.server = server;
|
|
|
|
this.command = command;
|
2021-12-01 10:50:25 +01:00
|
|
|
this.target = target;
|
2016-12-05 04:21:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Server Effected
|
2017-01-07 20:06:54 +01:00
|
|
|
*
|
2016-12-05 04:21:04 +01:00
|
|
|
* @return The Server Effected
|
|
|
|
*/
|
2021-12-01 10:50:25 +01:00
|
|
|
public Server getServer() { return server; }
|
2016-12-05 04:21:04 +01:00
|
|
|
|
|
|
|
/**
|
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 the Command to Send
|
|
|
|
*
|
|
|
|
* @return Command to Send
|
|
|
|
*/
|
|
|
|
public String getCommand() {
|
|
|
|
return command;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the Command to be Sent
|
|
|
|
*
|
|
|
|
* @param value Value
|
|
|
|
*/
|
|
|
|
public void setCommand(String value) {
|
2016-12-15 22:04:39 +01:00
|
|
|
command = value;
|
2016-12-05 04:21:04 +01:00
|
|
|
}
|
|
|
|
|
2021-12-01 10:50:25 +01:00
|
|
|
/**
|
|
|
|
* Gets the Player that will be forced to send the Command
|
|
|
|
*
|
|
|
|
* @return Target Player or null if Console
|
|
|
|
*/
|
|
|
|
public UUID getTarget() {
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
2016-12-05 04:21:04 +01:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
}
|