Don't create ack task when already disabled

Fixes #3373
This commit is contained in:
Nassim Jahnke 2023-07-02 13:29:07 +02:00
parent 7edb43844c
commit 1aee8a7a6c
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -39,7 +39,10 @@ public final class BukkitAckSequenceProvider extends AckSequenceProvider {
if (previousSequence == -1) { if (previousSequence == -1) {
final int serverProtocolVersion = connection.getProtocolInfo().getServerProtocolVersion(); final int serverProtocolVersion = connection.getProtocolInfo().getServerProtocolVersion();
final long delay = serverProtocolVersion > ProtocolVersion.v1_8.getVersion() && serverProtocolVersion < ProtocolVersion.v1_14.getVersion() ? 2 : 1; final long delay = serverProtocolVersion > ProtocolVersion.v1_8.getVersion() && serverProtocolVersion < ProtocolVersion.v1_14.getVersion() ? 2 : 1;
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new AckSequenceTask(connection, sequenceStorage), delay);
if (plugin.isEnabled()) {
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new AckSequenceTask(connection, sequenceStorage), delay);
}
} }
} }
} }