use of cn.nukkit.inventory.BrewingInventory in project Nukkit by Nukkit.
the class BlockEntityBrewingStand method initBlockEntity.
@Override
protected void initBlockEntity() {
inventory = new BrewingInventory(this);
if (!namedTag.contains("Items") || !(namedTag.get("Items") instanceof ListTag)) {
namedTag.putList(new ListTag<CompoundTag>("Items"));
}
for (int i = 0; i < getSize(); i++) {
inventory.setItem(i, this.getItem(i));
}
if (!namedTag.contains("CookTime") || namedTag.getShort("CookTime") > MAX_BREW_TIME) {
this.brewTime = MAX_BREW_TIME;
} else {
this.brewTime = namedTag.getShort("CookTime");
}
this.fuelAmount = namedTag.getShort("FuelAmount");
this.fuelTotal = namedTag.getShort("FuelTotal");
if (brewTime < MAX_BREW_TIME) {
this.scheduleUpdate();
}
super.initBlockEntity();
}
Aggregations