2024-11-22 23:51:27 +00:00
|
|
|
import { IReader, IWriter } from "bufferstuff";
|
2024-11-17 08:26:35 +00:00
|
|
|
import Block from "../blocks/Block";
|
|
|
|
import TileEntityType from "../enums/TileEntityType";
|
|
|
|
import Vec3 from "../Vec3";
|
|
|
|
|
2024-11-25 22:28:33 +00:00
|
|
|
export default abstract class TileEntity {
|
2024-11-25 02:30:27 +00:00
|
|
|
public readonly type: TileEntityType;
|
|
|
|
public readonly forBlock: Block;
|
|
|
|
public readonly pos: Vec3;
|
2024-11-17 08:26:35 +00:00
|
|
|
|
2024-11-25 02:30:27 +00:00
|
|
|
public constructor(type: TileEntityType, forBlock: Block, pos: Vec3) {
|
2024-11-17 08:26:35 +00:00
|
|
|
this.type = type;
|
2024-11-25 02:30:27 +00:00
|
|
|
this.forBlock = forBlock;
|
|
|
|
this.pos = pos;
|
2024-11-17 08:26:35 +00:00
|
|
|
}
|
2024-11-22 23:51:27 +00:00
|
|
|
|
2024-11-25 02:30:27 +00:00
|
|
|
public fromSave(reader:IReader) {}
|
2024-11-22 23:51:27 +00:00
|
|
|
|
|
|
|
public toSave(writer:IWriter) {
|
2024-11-25 02:30:27 +00:00
|
|
|
writer.writeUByte(this.type);
|
|
|
|
writer.writeUByte(this.pos.x).writeUByte(this.pos.y).writeUByte(this.pos.z);
|
2024-11-22 23:51:27 +00:00
|
|
|
}
|
2024-11-17 08:26:35 +00:00
|
|
|
}
|