feat: Add cracked glass block and texture
Added the cracked glass block and its corresponding texture to the resource packs. Also made changes to the maker.ts file to include a save operation. Additionally, added a new behavior pack for the cracked glass block with specific properties. Updated the vectorUtils.ts file to include a new function for converting a Vector3 object to a command string. Finally, made changes to the triggers.ts file to register new triggers and update existing ones.
This commit is contained in:
46
scripts/levels/levelIntro.ts
Normal file
46
scripts/levels/levelIntro.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { Vector3, world } from "@minecraft/server";
|
||||
import Level from "../Commandeer/level/level";
|
||||
import { leverOn } from "../Commandeer/level/levelTypes";
|
||||
import { teleportAgent, isAgentAt } from "../Commandeer/utils/agentUtils";
|
||||
import { startLevel } from "../Commandeer/utils/levelUtils";
|
||||
import { vector3 } from "../Commandeer/utils/vectorUtils";
|
||||
import { levelIntroConditions } from "../levelConditions/levelIntro";
|
||||
import { CURRENT_LEVEL, mindKeeper } from "../main";
|
||||
import Pupeteer from "../Commandeer/pupeteer";
|
||||
|
||||
// const levelIntroCommandBlockPos: Vector3 = vector3(58, 66, 276);
|
||||
// const levelIntroStartPosition: Vector3 = vector3(28, 70, 269);
|
||||
// const levelIntroEndPosition: Vector3 = vector3(39, 70, 269);
|
||||
const levelIntro: Level = new Level(
|
||||
() => {
|
||||
Pupeteer.sendWorldMessage("%message.intro.started");
|
||||
Pupeteer.setTitleTimed("%message.intro.started", 2.5);
|
||||
// startLevel(levelIntroCommandBlockPos);
|
||||
// teleportAgent(levelIntroStartPosition);
|
||||
},
|
||||
() => {
|
||||
Pupeteer.setActionBar("%message.intro.make");
|
||||
},
|
||||
() => {
|
||||
Pupeteer.clearActionBar();
|
||||
world.sendMessage("%message.intro.done");
|
||||
Pupeteer.setTitleTimed("%message.intro.done", 2.5);
|
||||
|
||||
mindKeeper.increment(CURRENT_LEVEL);
|
||||
},
|
||||
() => {
|
||||
let isComplete = true;
|
||||
levelIntroConditions.conditions.forEach((condition) => {
|
||||
let blockInworld = world.getDimension("overworld").getBlock(condition.position);
|
||||
if (blockInworld?.type !== condition.block) {
|
||||
isComplete = false;
|
||||
}
|
||||
});
|
||||
if (isComplete) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
export default levelIntro;
|
||||
Reference in New Issue
Block a user