fix: InventoryCloseStateTest (#111)

(cherry picked from commit aec3694a4a)
This commit is contained in:
mworzala 2024-01-26 02:15:48 -05:00 committed by Matt Worzala
parent 7cec8f0bfc
commit 48d87db6e9

View File

@ -2,7 +2,6 @@ package net.minestom.server.inventory;
import net.kyori.adventure.text.Component;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.network.ConnectionState;
import net.minestom.server.network.packet.client.play.ClientCloseWindowPacket;
import net.minestom.server.network.packet.server.play.CloseWindowPacket;
import net.minestom.testing.Env;
@ -28,7 +27,7 @@ public class InventoryCloseStateTest {
player.closeInventory(); // Closes the inventory server-side, should send a CloseWindowPacket
player.openInventory(inventory);
// Send the close window packet
player.addPacketToQueue(ConnectionState.PLAY, new ClientCloseWindowPacket(inventory.getWindowId()));
player.addPacketToQueue(new ClientCloseWindowPacket(inventory.getWindowId()));
player.interpretPacketQueue();
packetTracker.assertSingle(closeWindowPacket -> assertEquals(inventory.getWindowId(), closeWindowPacket.windowId()));
packetTracker.assertCount(1); // Assert we only get 1 close window packet from the closeInventory(); call