mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-01 00:10:19 +01:00
fix: InventoryCloseStateTest (#111)
(cherry picked from commit aec3694a4a
)
This commit is contained in:
parent
7cec8f0bfc
commit
48d87db6e9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user