Java 类net.minecraft.item.ItemSoup 实例源码

项目:Wurst-MC-1.12    文件:AutoSoupMod.java   
private int findSoup(int startSlot, int endSlot)
{
    for(int i = startSlot; i < endSlot; i++)
    {
        ItemStack stack =
            WMinecraft.getPlayer().inventory.getStackInSlot(i);

        if(stack != null && stack.getItem() instanceof ItemSoup)
            return i;
    }

    return -1;
}
项目:SerenityCE    文件:AutoSoup.java   
private boolean hotbarHasSoups() {
    for (int index = 36; index < 45; index++) {
        ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(index).getStack();
        if (itemStack != null) {
            if (itemStack.getItem() instanceof ItemSoup) {
                return true;
            }
        }
    }

    return false;
}
项目:SerenityCE    文件:AutoSoup.java   
private int countSoups() {
    int items = 0;
    for (int index = 9; index < 45; index++) {
        ItemStack itemStack = mc.thePlayer.inventoryContainer.getSlot(index).getStack();
        if (itemStack != null) {
            if (itemStack.getItem() instanceof ItemSoup) {
                items += itemStack.stackSize;
            }
        }
    }

    return items;
}