mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-25 11:35:18 +01:00
parent
494bf62535
commit
087bbdce1f
@ -19,6 +19,7 @@ package com.viaversion.viaversion.bukkit.providers;
|
|||||||
|
|
||||||
import com.viaversion.viaversion.ViaVersionPlugin;
|
import com.viaversion.viaversion.ViaVersionPlugin;
|
||||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||||
|
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||||
import com.viaversion.viaversion.bukkit.tasks.protocol1_19to1_18_2.AckSequenceTask;
|
import com.viaversion.viaversion.bukkit.tasks.protocol1_19to1_18_2.AckSequenceTask;
|
||||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.provider.AckSequenceProvider;
|
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.provider.AckSequenceProvider;
|
||||||
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage.SequenceStorage;
|
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage.SequenceStorage;
|
||||||
@ -36,7 +37,9 @@ public final class BukkitAckSequenceProvider extends AckSequenceProvider {
|
|||||||
final SequenceStorage sequenceStorage = connection.get(SequenceStorage.class);
|
final SequenceStorage sequenceStorage = connection.get(SequenceStorage.class);
|
||||||
final int previousSequence = sequenceStorage.setSequenceId(sequence);
|
final int previousSequence = sequenceStorage.setSequenceId(sequence);
|
||||||
if (previousSequence == -1) {
|
if (previousSequence == -1) {
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new AckSequenceTask(connection, sequenceStorage), 1);
|
final int serverProtocolVersion = connection.getProtocolInfo().getServerProtocolVersion();
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user