Closed jtJava closed 3 months ago
https://dump.viaversion.com/670b6b26a1f6e9641b506a73123e11b2d58632cc25012d1afd055c2aa1d3e1c5
I've debugged and found the following code to be the issue:
public class LookFixListener extends SimplePacketListenerAbstract {
private static final EnumSet<PacketType.Play.Client> DELAYED_PACKETS = EnumSet.of(PacketType.Play.Client.PLAYER_BLOCK_PLACEMENT);
private final Map<User, List<PacketWrapper<?>>> delayedActions = new HashMap<>();
@Override
public void onPacketPlayReceive(PacketPlayReceiveEvent event) {
if (!event.getUser().getClientVersion().equals(ClientVersion.V_1_8)) {
return;
}
if (DELAYED_PACKETS.contains(event.getPacketType())) {
this.delayedActions.get(event.getUser()).add(new PacketWrapper<>(event.clone()));
event.setCancelled(true);
} else if (WrapperPlayClientPlayerFlying.isFlying(event.getPacketType())){
handleFly(event.getUser());
}
}
public void handleFly(User user) {
for (PacketWrapper<?> wrapper : this.delayedActions.get(user)) {
PacketEvents.getAPI().getProtocolManager().receivePacketSilently(user.getChannel(), wrapper);
}
}
@Override
public void onUserConnect(UserConnectEvent event) {
this.delayedActions.put(event.getUser(), new ArrayList<>());
}
@Override
public void onUserDisconnect(UserDisconnectEvent event) {
super.onUserDisconnect(event);
}
}
Does this also happen with 1.9+ clients?
Does this also happen with 1.9+ clients?
Not a ViaVersion issue
/viaversion dump
Outputhttps://dump.viaversion.com/2157df1bae4938b4b7cdfc2bfc4e3c9ddc7c7d706217c864cce792eb5b2fc99f
Console Error
Bug Description
Right clicking blocks causes a netty error and kicks the player on a 1.20.4 server.
Steps to Reproduce
Login with a 1.7 or 1.8 Client and right click any block
Expected Behavior
No kick or exception
Additional Server Info
Checklist