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


Java ChestInventory类代码示例

本文整理汇总了Java中cn.nukkit.inventory.ChestInventory的典型用法代码示例。如果您正苦于以下问题:Java ChestInventory类的具体用法?Java ChestInventory怎么用?Java ChestInventory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ChestInventory类属于cn.nukkit.inventory包,在下文中一共展示了ChestInventory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BlockEntityChest

import cn.nukkit.inventory.ChestInventory; //导入依赖的package包/类
public BlockEntityChest(FullChunk chunk, CompoundTag nbt) {
    super(chunk, nbt);
    this.inventory = new ChestInventory(this);

    if (!this.namedTag.contains("Items") || !(this.namedTag.get("Items") instanceof ListTag)) {
        this.namedTag.putList(new ListTag<CompoundTag>("Items"));
    }

    /* for (int i = 0; i < this.getSize(); i++) {
        this.inventory.setItem(i, this.getItem(i));
    } */

    ListTag<CompoundTag> list = (ListTag<CompoundTag>) this.namedTag.getList("Items");
    for (CompoundTag compound : list.getAll()) {
        Item item = NBTIO.getItemHelper(compound);
        this.inventory.slots.put(compound.getByte("Slot"), item);
    }
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:19,代码来源:BlockEntityChest.java

示例2: BlockEntityChest

import cn.nukkit.inventory.ChestInventory; //导入依赖的package包/类
public BlockEntityChest(FullChunk chunk, CompoundTag nbt) {
    super(chunk, nbt);
    this.inventory = new ChestInventory(this);

    if (!this.namedTag.contains("Items") || !(this.namedTag.get("Items") instanceof ListTag)) {
        this.namedTag.putList(new ListTag<CompoundTag>("Items"));
    }

    /* for (int i = 0; i < this.getSize(); i++) {
        this.inventory.setItem(i, this.getItem(i));
    } */

    ListTag<CompoundTag> list = this.namedTag.getList("Items", CompoundTag.class);
    for (CompoundTag compound : list.getAll()) {
        Item item = NBTIO.getItemHelper(compound);
        this.inventory.slots.put(compound.getByte("Slot"), item);
    }
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:19,代码来源:BlockEntityChest.java

示例3: BlockEntityChest

import cn.nukkit.inventory.ChestInventory; //导入依赖的package包/类
public BlockEntityChest(FullChunk chunk, CompoundTag nbt) {
    super(chunk, nbt);
    this.inventory = new ChestInventory(this);

    if (!this.namedTag.contains("Items") || !(this.namedTag.get("Items") instanceof ListTag)) {
        this.namedTag.putList(new ListTag<CompoundTag>("Items"));
    }

    /* for (int i = 0; i < this.getSize(); i++) {
        this.inventory.setItem(i, this.getItem(i));
    } */
    
    ListTag<CompoundTag> list = (ListTag<CompoundTag>) this.namedTag.getList("Items");
    for (CompoundTag compound : list.getAll()) {
        Item item = NBTIO.getItemHelper(compound);
        this.inventory.slots.put(compound.getByte("Slot"), item);
    }
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:19,代码来源:BlockEntityChest.java

示例4: BlockEntityChest

import cn.nukkit.inventory.ChestInventory; //导入依赖的package包/类
public BlockEntityChest(FullChunk chunk, CompoundTag nbt) {
    super(chunk, nbt);
    this.inventory = new ChestInventory(this);

    if (!this.namedTag.contains("Items") || !(this.namedTag.get("Items") instanceof ListTag)) {
        this.namedTag.putList(new ListTag<CompoundTag>("Items"));
    }

    for (int i = 0; i < this.getSize(); i++) {
        this.inventory.setItem(i, this.getItem(i));
    }
}
 
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:13,代码来源:BlockEntityChest.java

示例5: getRealInventory

import cn.nukkit.inventory.ChestInventory; //导入依赖的package包/类
public ChestInventory getRealInventory() {
    return inventory;
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:4,代码来源:BlockEntityChest.java


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