File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_2to1_21/task Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 22
22
import com .viaversion .viabackwards .protocol .v1_21_2to1_21 .storage .PlayerStorage ;
23
23
import com .viaversion .viaversion .api .connection .ProtocolInfo ;
24
24
import com .viaversion .viaversion .api .connection .UserConnection ;
25
+ import com .viaversion .viaversion .api .data .entity .EntityTracker ;
25
26
import com .viaversion .viaversion .api .protocol .packet .PacketWrapper ;
26
27
import com .viaversion .viaversion .api .protocol .packet .State ;
27
28
import com .viaversion .viaversion .protocol .ProtocolRunnable ;
@@ -39,13 +40,14 @@ public PlayerPacketsTickTask() {
39
40
@ Override
40
41
public void run (final UserConnection connection ) {
41
42
final ProtocolInfo protocolInfo = connection .getProtocolInfo ();
42
- if (protocolInfo .getClientState () != State .PLAY || protocolInfo .getServerState () != State .PLAY ) {
43
+ final EntityTracker entityTracker = connection .getEntityTracker (Protocol1_21_2To1_21 .class );
44
+ if (protocolInfo .getClientState () != State .PLAY || protocolInfo .getServerState () != State .PLAY || !entityTracker .hasClientEntityId ()) {
43
45
return ;
44
46
}
45
47
46
48
final Channel channel = connection .getChannel ();
47
49
channel .eventLoop ().submit (() -> {
48
- if (!channel .isActive () || protocolInfo .getClientState () != State .PLAY || protocolInfo .getServerState () != State .PLAY ) {
50
+ if (!channel .isActive () || protocolInfo .getClientState () != State .PLAY || protocolInfo .getServerState () != State .PLAY || ! entityTracker . hasClientEntityId () ) {
49
51
return ;
50
52
}
51
53
try {
You can’t perform that action at this time.
0 commit comments