Envanter Boş Mu?

java10

kız çava bana kahve yap
Mesajlar
513
En iyi cevaplar
0
Beğeniler
586
Puanları
1,090
Ruh hali
selam, bi kod buldum paylaşıyım dedim;
PHP:
public static boolean checkInventory(Player p, ItemStack item) {
        if (p.getInventory().firstEmpty() >= 0 && item.getAmount() <= item.getMaxStackSize()) {
            return true;
        }
        Map<Integer, ? extends ItemStack> items = p.getInventory().all(item.getType());
        int amount = item.getAmount();
        for (ItemStack i : items.values()) {
            amount -= i.getMaxStackSize() - i.getAmount();
        }
        return amount <= 0;
    }
"envanterinizin belirlenen item i içine alabiliyor mu" boolean ı .-. umarım yararlı olmuıştur
 


Drakula61

Sudan Çıkmış
Mesajlar
8
En iyi cevaplar
0
Beğeniler
0
Puanları
0
selam, bi kod buldum paylaşıyım dedim;
PHP:
public static boolean checkInventory(Player p, ItemStack item) {
        if (p.getInventory().firstEmpty() >= 0 && item.getAmount() <= item.getMaxStackSize()) {
            return true;
        }
        Map<Integer, ? extends ItemStack> items = p.getInventory().all(item.getType());
        int amount = item.getAmount();
        for (ItemStack i : items.values()) {
            amount -= i.getMaxStackSize() - i.getAmount();
        }
        return amount <= 0;
    }
"envanterinizin belirlenen item i içine alabiliyor mu" boolean ı .-. umarım yararlı olmuıştur
Belirlenen itemi içine almak ne anlama geliyor :)

LG-H818 cihazımdan Tapatalk kullanılarak gönderildi
 

Üst