From 27033e909604e06f39af6179bdce0ccbcbf3b9dd Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Sun, 15 Sep 2024 21:52:32 +0200 Subject: [PATCH] Remove transaction tracking (and cancelling) in 1.16.4->1.17 (#4140) --- .../v1_16_4to1_17/Protocol1_16_4To1_17.java | 2 -- .../rewriter/ItemPacketRewriter1_17.java | 4 +-- .../storage/InventoryAcknowledgements.java | 34 ------------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/storage/InventoryAcknowledgements.java diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java index fe692871b..41004b37d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java @@ -37,7 +37,6 @@ import com.viaversion.viaversion.protocols.v1_16_4to1_17.packet.ServerboundPacke import com.viaversion.viaversion.protocols.v1_16_4to1_17.rewriter.EntityPacketRewriter1_17; import com.viaversion.viaversion.protocols.v1_16_4to1_17.rewriter.ItemPacketRewriter1_17; import com.viaversion.viaversion.protocols.v1_16_4to1_17.rewriter.WorldPacketRewriter1_17; -import com.viaversion.viaversion.protocols.v1_16_4to1_17.storage.InventoryAcknowledgements; import com.viaversion.viaversion.rewriter.SoundRewriter; import com.viaversion.viaversion.rewriter.StatisticsRewriter; import com.viaversion.viaversion.rewriter.TagRewriter; @@ -192,7 +191,6 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol { int id = wrapper.read(Types.INT); // Check extra bit for fast dismissal - if ((id & (1 << 30)) != 0 && wrapper.user().get(InventoryAcknowledgements.class).removeId(id)) { + if ((id & (1 << 30)) != 0) { // Decode our requested inventory acknowledgement short inventoryId = (short) ((id >> 16) & 0xFF); short confirmationId = (short) (id & 0xFFFF); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/storage/InventoryAcknowledgements.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/storage/InventoryAcknowledgements.java deleted file mode 100644 index b07d4dee7..000000000 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/storage/InventoryAcknowledgements.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2024 ViaVersion and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.viaversion.viaversion.protocols.v1_16_4to1_17.storage; - -import com.viaversion.viaversion.api.connection.StorableObject; -import it.unimi.dsi.fastutil.ints.IntArrayList; -import it.unimi.dsi.fastutil.ints.IntList; - -public final class InventoryAcknowledgements implements StorableObject { - private final IntList ids = new IntArrayList(); - - public void addId(int id) { - ids.add(id); - } - - public boolean removeId(int id) { - return ids.rem(id); - } -}