mc-beta-server/server/blocks/BlockBehaviourTallGrass.ts

21 lines
588 B
TypeScript
Raw Permalink Normal View History

2023-11-11 00:14:27 +00:00
import AABB from "../AABB";
import Block from "./Block";
import BlockBehaviour from "./BlockBehaviour";
import World from "../World";
2023-11-11 00:14:27 +00:00
export default class BlockBehaviourTallGrass extends BlockBehaviour {
2023-11-11 00:14:27 +00:00
public neighborBlockChange(world:World, x:number, y:number, z:number, blockId:number) {
const block = world.getBlockId(x, y - 1, z);
if (block !== Block.grass.blockId && block !== Block.dirt.blockId) {
world.setBlockWithNotify(x, y, z, 0);
}
}
public droppedItem(blockId:number) {
return -1;
}
public getBoundingBox() {
return AABB.getAABB(0, 0, 0, 0, 0, 0);
}
}