本文整理汇总了Java中org.rev317.min.accessors.Interface类的典型用法代码示例。如果您正苦于以下问题:Java Interface类的具体用法?Java Interface怎么用?Java Interface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Interface类属于org.rev317.min.accessors包,在下文中一共展示了Interface类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCount
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
* Gets the amount of items in inventory
*
* @param includeStack - true for including stack sizes to the counting
*
* @return amount of items
*/
public static int getCount(final boolean includeStack) {
final Interface inventory = getInterface();
if (inventory == null) {
return -1;
}
int count = 0;
final int[] items = inventory.getItems();
final int[] stackSizes = includeStack ? inventory.getStackSizes() : null;
for (int i = 0; i < items.length; i++) {
if (items[i] > 0) {
count += includeStack ? stackSizes[i] : 1;
}
}
return count;
}
示例2: getItems
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
* Gets all items accepted by filter
*
* @param filter
*
* @return items
*/
public static Item[] getItems(final Filter<Item> filter) {
final Interface inventory = getInterface();
if (inventory == null) {
return null;
}
final int[] items = inventory.getItems();
final int[] stackSizes = inventory.getStackSizes();
final ArrayList<Item> invItems = new ArrayList<>(28);
for (int i = 0; i < items.length; i++) {
final int itemId = items[i];
if (itemId < 1) {
continue;
}
final int stackSize = stackSizes[i];
final Item item = new Item(itemId, stackSize, i);
if (filter.accept(item)) {
invItems.add(item);
}
}
return invItems.toArray(new Item[invItems.size()]);
}
示例3: getItemIDs
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
private static int[] getItemIDs(int interfaceID) {
Interface i;
if ((i = Interfaces.getInterfaces()[interfaceID]) != null) {
int[] items;
if ((items = i.getItems()) != null && items.length > 0) {
return items;
}
}
return new int[0];
}
示例4: getItemStacks
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
private static int[] getItemStacks(int interfaceID) {
Interface i;
if ((i = Interfaces.getInterfaces()[interfaceID]) != null) {
int[] stacks;
if ((stacks = i.getStackSizes()) != null && stacks.length > 0) {
return stacks;
}
}
return new int[0];
}
示例5: getInterfaces
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
* Get's the interfaces loaded in the interface Cache.
*
* @return Interfaces in the Interface Cache.
*/
public static Interface[] getInterfaces() {
return Loader.getClient().getInterfaceCache();
}
示例6: getInterface
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
* Get's the Interface from the Interface Cache using the given ID.
*
* @param id Interface ID.
*
* @return Interface from the cache by the given ID.
*/
public static Interface getInterface(int id) {
return getInterfaces()[id];
}
示例7: getInterface
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
* Gets inventory interface
*
* @return interface of inventory
*/
public static Interface getInterface() {
return Loader.getClient().getInterfaceCache()[settings.get("inventory_index")];
}
示例8: getInterface
import org.rev317.min.accessors.Interface; //导入依赖的package包/类
/**
* Gets inventory interface
*
* @return interface of inventory
*/
public static Interface getInterface() {
return Loader.getClient().getInterfaceCache()[Settings.getActionByName("inventory_index")];
}