当前位置: 首页>>代码示例>>Java>>正文


Java Inventory类代码示例

本文整理汇总了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;
}
 
开发者ID:toddharrison,项目名称:PlayerState,代码行数:15,代码来源:PlayerStateManager.java

示例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);
    }
}
 
开发者ID:toddharrison,项目名称:PlayerState,代码行数:12,代码来源:PlayerStateManager.java

示例3: getSecondInventory

import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getSecondInventory() {
    return null;
}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:5,代码来源:MixinEntityPlayerMP.java

示例4: getEnderChestInventory

import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getEnderChestInventory() {
    return null;
}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:5,代码来源:MixinEntityPlayerMP.java

示例5: getEnderChestInventory

import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getEnderChestInventory() {
    return (Inventory) this.getEnderChest();
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:MixinEntityPlayerMP.java

示例6: getInputInventory

import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getInputInventory() {
    return (Inventory) TileEntityHopper.getHopperInventory((IHopper) this);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:MixinTileEntityHopper.java

示例7: getOutputInventory

import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public Inventory getOutputInventory() {
    return (Inventory) this.getInventoryForHopperTransfer();
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:MixinTileEntityHopper.java

示例8: openInventory

import net.canarymod.api.inventory.Inventory; //导入依赖的package包/类
@Override
public void openInventory(Inventory inventory) {

}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:5,代码来源:MixinEntityPlayerMP.java


注:本文中的net.canarymod.api.inventory.Inventory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。