本文整理汇总了Java中net.canarymod.api.inventory.Inventory类的典型用法代码示例。如果您正苦于以下问题:Java Inventory类的具体用法?Java Inventory怎么用?Java Inventory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Inventory类属于net.canarymod.api.inventory包,在下文中一共展示了Inventory类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serializeInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
private List<String> serializeInventory(final Inventory inventory) {
final List<String> list = new ArrayList<String>();
final Item[] contents = inventory.getContents();
for (int i = 0; i < contents.length; i++) {
final Item item = contents[i];
if (item != null) {
final CompoundTag tag = NBT_FACTORY.newCompoundTag(null);
item.writeToTag(tag);
tag.put("slot", i);
list.add(Canary.jsonNBT().baseTagToJSON(tag));
}
}
return list;
}
示例2: restoreInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
private void restoreInventory(final List<String> list, final Inventory inventory) {
inventory.clearContents();
for (final String s : list) {
final CompoundTag tag = (CompoundTag) Canary.jsonNBT().jsonToNBT(s);
final Item item = ITEM_FACTORY.newItem(ItemType.Tnt);
item.readFromTag(tag);
final int slot = tag.getInt("slot");
item.setSlot(slot);
inventory.setSlot(item);
}
}
示例3: getSecondInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getSecondInventory() {
return null;
}
示例4: getEnderChestInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getEnderChestInventory() {
return null;
}
示例5: getEnderChestInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getEnderChestInventory() {
return (Inventory) this.getEnderChest();
}
示例6: getInputInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getInputInventory() {
return (Inventory) TileEntityHopper.getHopperInventory((IHopper) this);
}
示例7: getOutputInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getOutputInventory() {
return (Inventory) this.getInventoryForHopperTransfer();
}
示例8: openInventory
import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public void openInventory(Inventory inventory) {
}