mirror of
https://github.com/ME1312/SubServers-2.git
synced 2025-01-10 09:57:45 +01:00
#80 Bring creation event handling up to spec
This commit is contained in:
parent
41dd2d69d0
commit
36f2821524
@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiBase</artifactId>
|
||||
<version>22w16a</version>
|
||||
<version>22w24a</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -36,7 +36,7 @@ public class SubCreateEvent extends Event implements SubEvent, Cancellable {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreateEvent(UUID player, Host host, String name, SubCreator.ServerTemplate template, Version version, int port) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.host = host;
|
||||
this.name = name;
|
||||
|
@ -39,7 +39,7 @@ public class SubCreatedEvent extends Event implements SubEvent {
|
||||
* @param success Success Status
|
||||
*/
|
||||
public SubCreatedEvent(UUID player, Host host, String name, SubCreator.ServerTemplate template, Version version, int port, SubServer server, boolean update, boolean success) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.host = host;
|
||||
this.name = name;
|
||||
|
@ -37,7 +37,7 @@ public class SubCreateEvent extends Event implements SubEvent {
|
||||
*/
|
||||
public SubCreateEvent(UUID player, String host, String name, String template, Version version, int port, boolean update) {
|
||||
super(true);
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.update = update;
|
||||
this.host = host;
|
||||
|
@ -38,7 +38,7 @@ public class SubCreatedEvent extends Event implements SubEvent {
|
||||
*/
|
||||
public SubCreatedEvent(UUID player, String host, String name, String template, Version version, int port, boolean update, boolean success) {
|
||||
super(true);
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.success = success;
|
||||
this.update = update;
|
||||
|
@ -58,7 +58,7 @@ public class PacketInExRunEvent implements PacketObjectIn<Integer> {
|
||||
public void accept(ObjectMap<String> data) {
|
||||
if (plugin.isEnabled()) {
|
||||
Bukkit.getPluginManager().callEvent(new SubCreateEvent((data.contains("player"))?data.getUUID("player"):null, data.getString("host"), data.getString("name"),
|
||||
data.getString("template"), (data.contains("version"))?new Version(data.getString("version")):null, data.getInt("port"), data.getBoolean("update")));
|
||||
data.getString("template"), data.getVersion("version"), data.getInt("port"), data.getBoolean("update")));
|
||||
callback("SubCreateEvent", this);
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class PacketInExRunEvent implements PacketObjectIn<Integer> {
|
||||
public void accept(ObjectMap<String> data) {
|
||||
if (plugin.isEnabled()) {
|
||||
Bukkit.getPluginManager().callEvent(new SubCreatedEvent((data.contains("player"))?data.getUUID("player"):null, data.getString("host"), data.getString("name"),
|
||||
data.getString("template"), (data.contains("version"))?new Version(data.getString("version")):null, data.getInt("port"), data.getBoolean("update"), data.getBoolean("success")));
|
||||
data.getString("template"), data.getVersion("version"), data.getInt("port"), data.getBoolean("update"), data.getBoolean("success")));
|
||||
callback("SubCreatedEvent", this);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiBase</artifactId>
|
||||
<version>22w16a</version>
|
||||
<version>22w24a</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -36,7 +36,7 @@ public class SubCreateEvent extends AbstractEvent implements SubEvent {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreateEvent(UUID player, String host, String name, String template, Version version, int port, boolean update) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.update = update;
|
||||
this.host = host;
|
||||
|
@ -37,7 +37,7 @@ public class SubCreatedEvent extends AbstractEvent implements SubEvent {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreatedEvent(UUID player, String host, String name, String template, Version version, int port, boolean update, boolean success) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.success = success;
|
||||
this.update = update;
|
||||
|
@ -51,7 +51,7 @@ public class PacketInExRunEvent implements PacketObjectIn<Integer> {
|
||||
@Override
|
||||
public void accept(ObjectMap<String> data) {
|
||||
Sponge.getEventManager().post(new SubCreateEvent((data.contains("player"))?data.getUUID("player"):null, data.getString("host"), data.getString("name"),
|
||||
data.getString("template"), new Version(data.getString("version")), data.getInt("port"), data.getBoolean("update")));
|
||||
data.getString("template"), data.getVersion("version"), data.getInt("port"), data.getBoolean("update")));
|
||||
callback("SubCreateEvent", this);
|
||||
}
|
||||
});
|
||||
@ -59,7 +59,7 @@ public class PacketInExRunEvent implements PacketObjectIn<Integer> {
|
||||
@Override
|
||||
public void accept(ObjectMap<String> data) {
|
||||
Sponge.getEventManager().post(new SubCreatedEvent((data.contains("player"))?data.getUUID("player"):null, data.getString("host"), data.getString("name"),
|
||||
data.getString("template"), new Version(data.getString("version")), data.getInt("port"), data.getBoolean("update"), data.getBoolean("success")));
|
||||
data.getString("template"), data.getVersion("version"), data.getInt("port"), data.getBoolean("update"), data.getBoolean("success")));
|
||||
callback("SubCreatedEvent", this);
|
||||
}
|
||||
});
|
||||
|
@ -30,13 +30,13 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiEngine</artifactId>
|
||||
<version>22w16a</version>
|
||||
<version>22w24a</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUI</artifactId>
|
||||
<version>22w16a</version>
|
||||
<version>22w24a</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -33,7 +33,7 @@ public class SubCreateEvent extends Event {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreateEvent(UUID player, String host, String name, String template, Version version, int port, boolean update) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.update = update;
|
||||
this.host = host;
|
||||
|
@ -34,7 +34,7 @@ public class SubCreatedEvent extends Event {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreatedEvent(UUID player, String host, String name, String template, Version version, int port, boolean update, boolean success) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.success = success;
|
||||
this.update = update;
|
||||
|
@ -35,7 +35,7 @@ public class SubCreateEvent extends Event implements SubEvent {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreateEvent(UUID player, String host, String name, String template, Version version, int port, boolean update) {
|
||||
Util.nullpo(host, name, template, version, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.update = update;
|
||||
this.host = host;
|
||||
|
@ -36,7 +36,7 @@ public class SubCreatedEvent extends Event implements SubEvent {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreatedEvent(UUID player, String host, String name, String template, Version version, int port, boolean update, boolean success) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.success = success;
|
||||
this.update = update;
|
||||
|
@ -33,7 +33,7 @@ public class SubCreateEvent implements SubEvent {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreateEvent(UUID player, String host, String name, String template, Version version, int port, boolean update) {
|
||||
Util.nullpo(host, name, template, version, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.update = update;
|
||||
this.host = host;
|
||||
|
@ -34,7 +34,7 @@ public class SubCreatedEvent implements SubEvent {
|
||||
* @param port Server Port Number
|
||||
*/
|
||||
public SubCreatedEvent(UUID player, String host, String name, String template, Version version, int port, boolean update, boolean success) {
|
||||
Util.nullpo(host, name, template, port);
|
||||
Util.nullpo(host, name, template);
|
||||
this.player = player;
|
||||
this.success = success;
|
||||
this.update = update;
|
||||
|
Loading…
Reference in New Issue
Block a user