Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-4646: Test + fix InventoryWrapper.getContents
Dieser Commit ist enthalten in:
Ursprung
faa6226959
Commit
1dbe87c8cc
@ -128,7 +128,7 @@ public class InventoryWrapper implements IInventory {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>(size);
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
items.set(i, getItem(i));
|
||||
items.add(getItem(i));
|
||||
}
|
||||
|
||||
return items;
|
||||
|
@ -0,0 +1,23 @@
|
||||
package org.bukkit.craftbukkit.inventory;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.junit.Test;
|
||||
|
||||
public class InventoryWrapperTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
Inventory raw = new CraftInventoryCustom(null, 9);
|
||||
raw.addItem(new ItemStack(Material.STONE));
|
||||
|
||||
Assert.assertTrue(raw.contains(Material.STONE));
|
||||
|
||||
InventoryWrapper wrapper = new InventoryWrapper(raw);
|
||||
CraftInventory proxy = new CraftInventory(wrapper);
|
||||
|
||||
Assert.assertTrue(proxy.contains(Material.STONE));
|
||||
}
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren