Fix PlayerLookTargetProvider, apparently this packet is written in two different places (#3301)

This commit is contained in:
Joseph Burton 2023-04-19 13:43:39 +01:00 committed by GitHub
parent 74cc42fecf
commit a2daa9c989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -637,7 +637,8 @@ public class Protocol1_13To1_12_2 extends AbstractProtocol<ClientboundPackets1_1
// Fake the end of the packet
handler(wrapper -> {
wrapper.write(Type.BOOLEAN, false);
wrapper.write(Type.OPTIONAL_POSITION, null);
final Position playerLookTarget = Via.getManager().getProviders().get(PlayerLookTargetProvider.class).getPlayerLookTarget(wrapper.user());
wrapper.write(Type.OPTIONAL_POSITION, playerLookTarget);
if (!wrapper.isCancelled() && Via.getConfig().get1_13TabCompleteDelay() > 0) {
TabCompleteTracker tracker = wrapper.user().get(TabCompleteTracker.class);
wrapper.cancel();