inventory_mock tests #17
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user