mc-beta-server/server/blocks/BlockBehaviourChest.ts
Holly 6492f7c363
All checks were successful
Node.js Build / build (20.x) (push) Successful in 5m16s
make the chest gui work sorta kinda, yeah.
2024-11-26 19:24:08 +00:00

20 lines
No EOL
625 B
TypeScript

import TileEntityChest from "../tileentities/TileEntityChest";
import Vec3 from "../Vec3";
import World from "../World";
import BlockBehaviour from "./BlockBehaviour";
export default class BlockBehaviourChest extends BlockBehaviour {
public placed(world:World, x:number, y:number, z:number) {
const chunk = world.getChunk(x >> 4, z >> 4);
chunk.setTileEntity(new TileEntityChest(new Vec3(x & 0xf, y, z & 0xf)), x, y, z);
}
public destroyed(world:World, x:number, y:number, z:number) {
const chunk = world.getChunk(x >> 4, z >> 4);
chunk.removeTileEntity(x, y, z);
}
public interactable() {
return true;
}
}