3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-28 09:00:09 +01:00

Fix confirmation id encoding, remove old send methods

Dieser Commit ist enthalten in:
KennyTV 2021-06-02 12:44:49 +02:00
Ursprung d7e3aa7143
Commit 6839334c1a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 1 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -205,15 +205,6 @@ public interface PacketWrapper {
*/ */
void scheduleSend(Class<? extends Protocol> protocol, boolean skipCurrentPipeline) throws Exception; void scheduleSend(Class<? extends Protocol> protocol, boolean skipCurrentPipeline) throws Exception;
@Deprecated
default void send(Class<? extends Protocol> protocol, boolean skipCurrentPipeline, boolean currentThread) throws Exception {
if (currentThread) {
send(protocol, skipCurrentPipeline);
} else {
scheduleSend(protocol, skipCurrentPipeline);
}
}
/** /**
* Send this packet to the associated user. * Send this packet to the associated user.
* Be careful not to send packets twice. * Be careful not to send packets twice.
@ -366,15 +357,6 @@ public interface PacketWrapper {
*/ */
void scheduleSendToServer(Class<? extends Protocol> protocol, boolean skipCurrentPipeline) throws Exception; void scheduleSendToServer(Class<? extends Protocol> protocol, boolean skipCurrentPipeline) throws Exception;
@Deprecated
default void sendToServer(Class<? extends Protocol> protocol, boolean skipCurrentPipeline, boolean currentThread) throws Exception {
if (currentThread) {
sendToServer(protocol, skipCurrentPipeline);
} else {
scheduleSendToServer(protocol, skipCurrentPipeline);
}
}
/** /**
* Returns the packet id. * Returns the packet id.
* *

Datei anzeigen

@ -100,7 +100,7 @@ public class InventoryPackets {
if (!accepted) { if (!accepted) {
// Use the new ping packet to replace the removed acknowledgement, extra bit for fast dismissal // Use the new ping packet to replace the removed acknowledgement, extra bit for fast dismissal
// Hope the client actually answers it /shrug // Hope the client actually answers it /shrug
int id = (1 << 30) | (inventoryId << 16) | confirmationId; int id = (1 << 30) | (inventoryId << 16) | (confirmationId & 0xFFF);
wrapper.user().get(InventoryAcknowledgements.class).addId(id); wrapper.user().get(InventoryAcknowledgements.class).addId(id);
PacketWrapper pingPacket = wrapper.create(ClientboundPackets1_17.PING); PacketWrapper pingPacket = wrapper.create(ClientboundPackets1_17.PING);