Fix confirmation id encoding, remove old send methods

This commit is contained in:
KennyTV 2021-06-02 12:44:49 +02:00
parent d7e3aa7143
commit 6839334c1a
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 1 additions and 19 deletions

View File

@ -205,15 +205,6 @@ public interface PacketWrapper {
*/
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.
* Be careful not to send packets twice.
@ -366,15 +357,6 @@ public interface PacketWrapper {
*/
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.
*

View File

@ -100,7 +100,7 @@ public class InventoryPackets {
if (!accepted) {
// Use the new ping packet to replace the removed acknowledgement, extra bit for fast dismissal
// 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);
PacketWrapper pingPacket = wrapper.create(ClientboundPackets1_17.PING);