mc-beta-server/server/blocks/BlockBehaviourFlower.ts
2023-08-20 01:17:05 +01:00

12 lines
No EOL
434 B
TypeScript

import { World } from "../World";
import { Block } from "./Block";
import { BlockBehaviour } from "./BlockBehaviour";
export class BlockBehaviourFlower extends BlockBehaviour {
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);
}
}
}