cleanup: replace anonymous inner class with lambda
This commit is contained in:
@@ -45,23 +45,20 @@ public class ServerAddChannelCommand extends Command {
|
||||
|
||||
final int worldid = Integer.parseInt(params[0]);
|
||||
|
||||
ThreadManager.getInstance().newTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int chid = Server.getInstance().addChannel(worldid);
|
||||
if(player.isLoggedinWorld()) {
|
||||
if(chid >= 0) {
|
||||
player.dropMessage(5, "NEW Channel " + chid + " successfully deployed on world " + worldid + ".");
|
||||
ThreadManager.getInstance().newTask(() -> {
|
||||
int chid = Server.getInstance().addChannel(worldid);
|
||||
if(player.isLoggedinWorld()) {
|
||||
if(chid >= 0) {
|
||||
player.dropMessage(5, "NEW Channel " + chid + " successfully deployed on world " + worldid + ".");
|
||||
} else {
|
||||
if(chid == -3) {
|
||||
player.dropMessage(5, "Invalid worldid detected. Channel creation aborted.");
|
||||
} else if(chid == -2) {
|
||||
player.dropMessage(5, "Reached channel limit on worldid " + worldid + ". Channel creation aborted.");
|
||||
} else if(chid == -1) {
|
||||
player.dropMessage(5, "Error detected when loading the 'world.ini' file. Channel creation aborted.");
|
||||
} else {
|
||||
if(chid == -3) {
|
||||
player.dropMessage(5, "Invalid worldid detected. Channel creation aborted.");
|
||||
} else if(chid == -2) {
|
||||
player.dropMessage(5, "Reached channel limit on worldid " + worldid + ". Channel creation aborted.");
|
||||
} else if(chid == -1) {
|
||||
player.dropMessage(5, "Error detected when loading the 'world.ini' file. Channel creation aborted.");
|
||||
} else {
|
||||
player.dropMessage(5, "NEW Channel failed to be deployed. Check if the needed port is already in use or other limitations are taking place.");
|
||||
}
|
||||
player.dropMessage(5, "NEW Channel failed to be deployed. Check if the needed port is already in use or other limitations are taking place.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user