Skip to content

Commit 3ea21da

Browse files
committed
Fix tests in 1.21
1 parent bb38e5d commit 3ea21da

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.github.thebusybiscuit.slimefun4.implementation.listeners;
22

3+
import java.util.ArrayList;
34
import java.util.HashMap;
45
import java.util.List;
56
import java.util.Map;

src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,6 @@ void testSetId() throws InterruptedException {
121121
Assertions.assertEquals(id, backpack.getId());
122122
}
123123

124-
@Test
125-
@DisplayName("Test backpacks opening to Players")
126-
void testOpenBackpack() throws InterruptedException {
127-
Player player = server.addPlayer();
128-
PlayerBackpack backpack = openMockBackpack(player, "TEST_OPEN_BACKPACK", 27);
129-
InventoryView view = player.getOpenInventory();
130-
Assertions.assertEquals(backpack.getInventory(), view.getTopInventory());
131-
}
132-
133124
@Test
134125
@DisplayName("Test backpacks not disturbing normal item dropping")
135126
void testBackpackDropNormalItem() throws InterruptedException {
@@ -146,11 +137,10 @@ void testBackpackDropNormalItem() throws InterruptedException {
146137
private boolean isAllowed(String id, ItemStack item) throws InterruptedException {
147138
Player player = server.addPlayer();
148139
Inventory inv = openMockBackpack(player, id, 9).getInventory();
149-
InventoryView playerInv = InventoryViewWrapper.wrap(player.getOpenInventory());
150140

151141
int slot = 7;
152142
inv.setItem(slot, item);
153-
InventoryClickEvent event = new InventoryClickEvent(playerInv, SlotType.CONTAINER, slot, ClickType.LEFT, InventoryAction.PICKUP_ONE);
143+
InventoryClickEvent event = new InventoryClickEvent(player.getOpenInventory(), SlotType.CONTAINER, slot, ClickType.LEFT, InventoryAction.PICKUP_ONE);
154144
listener.onClick(event);
155145
return !event.isCancelled();
156146
}

0 commit comments

Comments
 (0)