mirror of
https://github.com/ME1312/SubServers-2.git
synced 2025-01-25 09:01:23 +01:00
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
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2017 ME1312
|
||||
Copyright (C) 2015-2019 ME1312
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (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
|
||||
public YAMLSection generate() {
|
||||
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());
|
||||
return json;
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ public class PacketLinkServer implements PacketIn, PacketOut {
|
||||
@Override
|
||||
public YAMLSection generate() {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user