Проверка

Версия Minecraft
1.7.10
929
30
66
Всем привет.
Как примерно выглядит проверка на контейнер ?(кастомный инвентарь | Слот)
 
Решение
Привет.
Как примерно выглядит проверка на контейнер ?
Java:
        if (event.entityPlayer.openContainer instanceof ContainerItemStorage) {
            ContainerItemStorage con = (ContainerItemStorage)event.entityPlayer.openContainer;
            for (Object o : con.inventorySlots) {
                if (o instanceof Slot) {
                    Slot slot = (Slot)o;
                    if (slot.getHasStack()) {
                        
                    }
                }
                
            }
        }

timaxa007

Модератор
5,831
409
672
Привет.
Как примерно выглядит проверка на контейнер ?
Java:
        if (event.entityPlayer.openContainer instanceof ContainerItemStorage) {
            ContainerItemStorage con = (ContainerItemStorage)event.entityPlayer.openContainer;
            for (Object o : con.inventorySlots) {
                if (o instanceof Slot) {
                    Slot slot = (Slot)o;
                    if (slot.getHasStack()) {
                        
                    }
                }
                
            }
        }
 
Сверху