mc-beta-server/server/tileentities/TileEntity.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

23 lines
No EOL
640 B
TypeScript

import { IReader, IWriter } from "bufferstuff";
import Block from "../blocks/Block";
import TileEntityType from "../enums/TileEntityType";
import Vec3 from "../Vec3";
export default abstract class TileEntity {
public readonly type: TileEntityType;
public readonly forBlock: Block;
public readonly pos: Vec3;
public constructor(type: TileEntityType, forBlock: Block, pos: Vec3) {
this.type = type;
this.forBlock = forBlock;
this.pos = pos;
}
public fromSave(reader:IReader) {}
public toSave(writer:IWriter) {
writer.writeUByte(this.type);
writer.writeUByte(this.pos.x).writeUByte(this.pos.y).writeUByte(this.pos.z);
}
}