28 lines
No EOL
688 B
TypeScript
28 lines
No EOL
688 B
TypeScript
import Block from "../blocks/Block";
|
|
import TileEntityType from "../enums/TileEntityType";
|
|
import TileEntity from "./TileEntity";
|
|
import Vec3 from "../Vec3";
|
|
import { IReader, IWriter } from "bufferstuff";
|
|
import Inventory from "../inventories/Inventory";
|
|
|
|
export default class TileEntityChest extends TileEntity {
|
|
public inventory:Inventory;
|
|
|
|
public constructor(position: Vec3) {
|
|
super(TileEntityType.Chest, Block.chest, position);
|
|
|
|
this.inventory = new Inventory(9 * 3, "Chest");
|
|
}
|
|
|
|
public fromSave(reader:IReader) {
|
|
super.fromSave(reader);
|
|
|
|
this.inventory.fromSave(reader);
|
|
}
|
|
|
|
public toSave(writer:IWriter) {
|
|
super.toSave(writer);
|
|
|
|
this.inventory.toSave(writer);
|
|
}
|
|
} |