use of cn.nukkit.inventory.HopperInventory in project Nukkit by Nukkit.
the class BlockEntityHopper method initBlockEntity.
@Override
protected void initBlockEntity() {
if (this.namedTag.contains("TransferCooldown")) {
this.transferCooldown = this.namedTag.getInt("TransferCooldown");
}
this.inventory = new HopperInventory(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));
}
this.pickupArea = new SimpleAxisAlignedBB(this.x, this.y, this.z, this.x + 1, this.y + 2, this.z + 1);
this.scheduleUpdate();
super.initBlockEntity();
}
Aggregations