本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例5: getRealInventory
import cn.nukkit.inventory.ChestInventory; //导入依赖的package包/类
public ChestInventory getRealInventory() {
return inventory;
}