mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-09-24 19:42:40 +02:00
110 lines
2.4 KiB
Java
110 lines
2.4 KiB
Java
package net.ME1312.SubServers.Host.API.Event;
|
|
|
|
import net.ME1312.SubServers.Host.Library.Event.Event;
|
|
import net.ME1312.SubServers.Host.Library.Util;
|
|
import net.ME1312.SubServers.Host.Library.Version.Version;
|
|
|
|
import java.util.UUID;
|
|
|
|
/**
|
|
* Server Create Event
|
|
*/
|
|
public class SubCreateEvent extends Event {
|
|
private UUID player;
|
|
private String host;
|
|
private String name;
|
|
private String template;
|
|
private Version version;
|
|
private int port;
|
|
|
|
/**
|
|
* Server Create Event
|
|
*
|
|
* @param player Player Creating
|
|
* @param host Potential Host
|
|
* @param name Server Name
|
|
* @param template Server Template
|
|
* @param version Server Version
|
|
* @param port Server Port Number
|
|
*/
|
|
public SubCreateEvent(UUID player, String host, String name, String template, Version version, int port) {
|
|
if (Util.isNull(host, name, template, version, port)) throw new NullPointerException();
|
|
this.player = player;
|
|
this.host = host;
|
|
this.name = name;
|
|
this.template = template;
|
|
this.version = version;
|
|
this.port = port;
|
|
}
|
|
|
|
/**
|
|
* Get the Host the SubServer will run on
|
|
*
|
|
* @return Potential Host
|
|
*/
|
|
public String getHost() {
|
|
return host;
|
|
}
|
|
|
|
/**
|
|
* Get the name the SubServer will use
|
|
*
|
|
* @return SubServer Name
|
|
*/
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
/**
|
|
* Get the Template to Use
|
|
*
|
|
* @return Server Template
|
|
*/
|
|
public String getTemplate() {
|
|
return template;
|
|
}
|
|
|
|
/**
|
|
* Set the Template to Use
|
|
*
|
|
* @param value Value
|
|
*/
|
|
public void getTemplate(String value) {
|
|
this.template = value;
|
|
}
|
|
|
|
/**
|
|
* Get the Version the Server will use
|
|
*
|
|
* @return Server Version
|
|
*/
|
|
public Version getVersion() {
|
|
return version;
|
|
}
|
|
|
|
/**
|
|
* Set the Version the Server will use
|
|
*
|
|
* @param value Value
|
|
*/
|
|
public void setVersion(Version value) {
|
|
this.version = value;
|
|
}
|
|
|
|
/**
|
|
* Get the Port the Server will use
|
|
*
|
|
* @return Port Number
|
|
*/
|
|
public int getPort() {
|
|
return port;
|
|
}
|
|
|
|
/**
|
|
* Gets the player that triggered the Event
|
|
*
|
|
* @return The Player that triggered this Event or null if Console
|
|
*/
|
|
public UUID getPlayer() { return player; }
|
|
}
|