mc-beta-server/server/tileentities/TileEntityChest.ts
Holly d82b86546a
All checks were successful
Node.js Build / build (20.x) (push) Successful in 5m18s
implement tile entity add + remove, and make loading more robust.
2024-11-25 22:28:33 +00:00

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);
}
}