mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-23 02:25:19 +01:00
Merge pull request #283 from Matsv/slpfix
Woops the new api broke ServerListPlus custom outdated message again …
This commit is contained in:
commit
e61f56b2e0
@ -40,14 +40,14 @@ public class BaseProtocol extends Protocol {
|
|||||||
try {
|
try {
|
||||||
JSONObject json = (JSONObject) new JSONParser().parse(originalStatus);
|
JSONObject json = (JSONObject) new JSONParser().parse(originalStatus);
|
||||||
JSONObject version = (JSONObject) json.get("version");
|
JSONObject version = (JSONObject) json.get("version");
|
||||||
|
|
||||||
if (ProtocolRegistry.SERVER_PROTOCOL == -1) {
|
if (ProtocolRegistry.SERVER_PROTOCOL == -1) {
|
||||||
Long original = (Long) version.get("protocol");
|
Long original = (Long) version.get("protocol");
|
||||||
ProtocolRegistry.SERVER_PROTOCOL = original.intValue();
|
ProtocolRegistry.SERVER_PROTOCOL = original.intValue();
|
||||||
}
|
}
|
||||||
List<Pair<Integer, Protocol>> protocols = ProtocolRegistry.getProtocolPath(info.getProtocolVersion(), ProtocolRegistry.SERVER_PROTOCOL);
|
List<Pair<Integer, Protocol>> protocols = ProtocolRegistry.getProtocolPath(info.getProtocolVersion(), ProtocolRegistry.SERVER_PROTOCOL);
|
||||||
if (protocols != null) {
|
if (protocols != null) {
|
||||||
version.put("protocol", info.getProtocolVersion());
|
if ((long) version.get("protocol") != 9999) //Fix serverlistplus
|
||||||
|
version.put("protocol", info.getProtocolVersion());
|
||||||
} else {
|
} else {
|
||||||
// not compatible :(, *plays very sad violin*
|
// not compatible :(, *plays very sad violin*
|
||||||
wrapper.user().setActive(false);
|
wrapper.user().setActive(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user