Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Ursprung
a613edcb42
Commit
58e7455cd9
@ -7,17 +7,19 @@ import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmit
|
|||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.MovementTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.MovementTracker;
|
||||||
|
|
||||||
public class ViaIdleThread implements Runnable {
|
public class ViaIdleThread implements Runnable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (UserConnection info : Via.getManager().getConnections()) {
|
for (UserConnection info : Via.getManager().getConnections()) {
|
||||||
ProtocolInfo protocolInfo = info.getProtocolInfo();
|
ProtocolInfo protocolInfo = info.getProtocolInfo();
|
||||||
if (protocolInfo != null && protocolInfo.getPipeline().contains(Protocol1_9To1_8.class)) {
|
if (protocolInfo == null || !protocolInfo.getPipeline().contains(Protocol1_9To1_8.class)) continue;
|
||||||
long nextIdleUpdate = info.get(MovementTracker.class).getNextIdlePacket();
|
|
||||||
if (nextIdleUpdate <= System.currentTimeMillis()) {
|
MovementTracker movementTracker = info.get(MovementTracker.class);
|
||||||
if (info.getChannel().isOpen()) {
|
if (movementTracker == null) continue;
|
||||||
Via.getManager().getProviders().get(MovementTransmitterProvider.class).sendPlayer(info);
|
|
||||||
}
|
long nextIdleUpdate = movementTracker.getNextIdlePacket();
|
||||||
}
|
if (nextIdleUpdate <= System.currentTimeMillis() && info.getChannel().isOpen()) {
|
||||||
|
Via.getManager().getProviders().get(MovementTransmitterProvider.class).sendPlayer(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren