mirror of
https://github.com/kaboomserver/extras.git
synced 2024-06-13 23:51:20 +00:00
Update ping info to 1.16.1
This commit is contained in:
parent
e184b0c3bf
commit
55e588aa9f
|
@ -120,6 +120,9 @@ public final class Main extends JavaPlugin {
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (Bukkit.isStopping()) {
|
if (Bukkit.isStopping()) {
|
||||||
|
/* This should never be done in a critical environment, as it can lead to data corruption.
|
||||||
|
We are not too concerned with data corruption, as the server resets daily. In our case, it's
|
||||||
|
more important to ensure that the server never hangs. */
|
||||||
Runtime.getRuntime().halt(0);
|
Runtime.getRuntime().halt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,6 +111,11 @@ public final class ServerCommand implements Listener {
|
||||||
} catch (NumberFormatException exception) {
|
} catch (NumberFormatException exception) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (command.contains("[distance=")) {
|
||||||
|
return command.replace("[distance=", "[");
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@ public final class ServerPing implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
void onServerListPing(final PaperServerListPingEvent event) {
|
void onServerListPing(final PaperServerListPingEvent event) {
|
||||||
if (event.getClient().getProtocolVersion() == -1) {
|
if (event.getClient().getProtocolVersion() == -1) {
|
||||||
final int protocol = 578;
|
final int protocol = 736;
|
||||||
event.setProtocolVersion(protocol);
|
event.setProtocolVersion(protocol);
|
||||||
} else {
|
} else {
|
||||||
event.setProtocolVersion(event.getClient().getProtocolVersion());
|
event.setProtocolVersion(event.getClient().getProtocolVersion());
|
||||||
}
|
}
|
||||||
event.setVersion("1.15.2");
|
event.setVersion("1.16.1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue