mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 20:46:31 +01:00
Yeah, kind of screwed that before :P
This commit is contained in:
parent
ac7a14cab8
commit
a5728dc2d0
@ -85,13 +85,17 @@ public class InventoryUtil {
|
||||
public static boolean fits(ItemStack item, Inventory inventory) {
|
||||
int left = item.getAmount();
|
||||
|
||||
if (inventory.getMaxStackSize() == Integer.MAX_VALUE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (ItemStack iStack : inventory.getContents()) {
|
||||
if (left <= 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (MaterialUtil.isEmpty(iStack)) {
|
||||
left -= inventory.getMaxStackSize();
|
||||
left -= item.getMaxStackSize();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class ItemManager implements Listener {
|
||||
|
||||
private static void addItems(Inventory inventory, ItemStack[] items) {
|
||||
for (ItemStack item : items) {
|
||||
inventory.addItem(item.clone());
|
||||
InventoryUtil.add(item, inventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ name: ChestShop
|
||||
|
||||
main: com.Acrobot.ChestShop.ChestShop
|
||||
|
||||
version: 3.50t0034
|
||||
version: 3.50t0035
|
||||
|
||||
#for CButD
|
||||
dev-url: http://dev.bukkit.org/server-mods/chestshop/
|
||||
|
Loading…
Reference in New Issue
Block a user