This commit is contained in:
2024-08-05 12:06:10 +02:00
parent d41fefe098
commit 7259b53176
9 changed files with 61 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
import { BlockType, MinecraftBlockTypes, Vector3, world } from "@minecraft/server";
import { BlockType, BlockVolume, MinecraftBlockTypes, Vector3, world } from "@minecraft/server";
type Wall = {
startPos: Vector3;
@@ -6,11 +6,13 @@ type Wall = {
};
function clearWall(wall: Wall) {
world.getDimension("overworld").fillBlocks(wall.startPos, wall.endPos, MinecraftBlockTypes.air);
let volume: BlockVolume = new BlockVolume(wall.startPos, wall.endPos);
world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.air);
}
function fillWall(wall: Wall, block: BlockType) {
world.getDimension("overworld").fillBlocks(wall.startPos, wall.endPos, block);
let volume: BlockVolume = new BlockVolume(wall.startPos, wall.endPos);
world.getDimension("overworld").fillBlocks(volume, block);
}
function startLevel(commandBlockPos: Vector3) {