inventory_mock tests #17

Merged
erns6604 merged 16 commits from inventory_mocks into main 2025-10-30 07:52:55 +01:00
2 changed files with 3 additions and 4 deletions
Showing only changes of commit 7dc1fb7edd - Show all commits

View File

@@ -1,6 +1,5 @@
package Inventory;
import Item.Item;
import Item.ItemStack;
import java.util.ArrayList;
@@ -27,12 +26,11 @@ public class Inventory {
public void addItem(ItemStack stack) {
if (stack.getWeight() + getCurrentWeight() > maxWeight) {
if(stack.isSingleItem()) return;
trySubstack(stack);
return;
}
} else {
items.add(stack);
}
}
private void trySubstack(ItemStack stack) {
int stackSize = getMaxStackSize(stack);

View File

@@ -41,6 +41,7 @@ public class LootTable<T> {
return entry.item();
}
}
// Unreachable code. entries always have an entry or the class cant be instantiated.
return null;
}