Correct LinkServer packets & server autodetection
This commit is contained in:
parent
32cd201697
commit
4ca476c1fa
2
LICENSE
2
LICENSE
|
@ -186,7 +186,7 @@
|
||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2017 ME1312
|
Copyright (C) 2015-2019 ME1312
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class PacketLinkServer implements PacketIn, PacketOut {
|
||||||
@Override
|
@Override
|
||||||
public YAMLSection generate() {
|
public YAMLSection generate() {
|
||||||
YAMLSection json = new YAMLSection();
|
YAMLSection json = new YAMLSection();
|
||||||
json.set("name", plugin.subdata.getName());
|
if (plugin.subdata.getName() != null) json.set("name", plugin.subdata.getName());
|
||||||
json.set("port", Bukkit.getServer().getPort());
|
json.set("port", Bukkit.getServer().getPort());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,8 @@ public class PacketLinkServer implements PacketIn, PacketOut {
|
||||||
@Override
|
@Override
|
||||||
public YAMLSection generate() {
|
public YAMLSection generate() {
|
||||||
YAMLSection json = new YAMLSection();
|
YAMLSection json = new YAMLSection();
|
||||||
json.set("name", plugin.subdata.getName());
|
if (plugin.subdata.getName() != null) json.set("name", plugin.subdata.getName());
|
||||||
|
if (plugin.game.getServer().getBoundAddress().isPresent()) json.set("port", plugin.game.getServer().getBoundAddress().get());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue