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