mc-beta-server/server/tileentities/TileEntityChest.ts

28 lines
688 B
TypeScript
Raw Normal View History

2024-11-22 23:51:27 +00:00
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";
2024-11-22 23:51:27 +00:00
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);
2024-11-22 23:51:27 +00:00
}
}