From a21af04b9e48bdc199457b94016b7d42cacc7ce1 Mon Sep 17 00:00:00 2001 From: DyslexicWolf Date: Wed, 14 Aug 2024 14:44:31 +0200 Subject: [PATCH] version without npcs, levels work, everything is build --- behavior_packs/items/chainsaw.json | 18 ++++++++++ behavior_packs/items/drill.json | 18 ++++++++++ resource_packs/texts/en_US.lang | 2 ++ .../textures/blocks/cracked_glass.png | Bin 392 -> 0 bytes .../textures/blocks/redstone_lamp_off.png | Bin 107 -> 0 bytes .../textures/blocks/redstone_lamp_on.png | Bin 107 -> 0 bytes .../textures/blocks/wool_colored_blue.png | Bin 0 -> 483 bytes .../textures/blocks/wool_colored_green.png | Bin 0 -> 468 bytes .../textures/blocks/wool_colored_red.png | Bin 0 -> 623 bytes .../textures/blocks/wool_colored_yellow.png | Bin 0 -> 576 bytes resource_packs/textures/item_texture.json | 12 +++++++ resource_packs/textures/items/chainsaw.png | Bin 0 -> 339 bytes resource_packs/textures/items/drill.png | Bin 0 -> 446 bytes resource_packs/textures/terrain_texture.json | 11 ------ scripts/levels/level1/mission1.ts | 33 +++++++++++++++--- scripts/levels/level2/mission1.ts | 3 +- scripts/levels/level2/mission2.ts | 6 ++-- scripts/levels/level2/mission3.ts | 7 +++- scripts/levels/level3/mission1.ts | 5 +-- scripts/main.ts | 10 +++++- 20 files changed, 103 insertions(+), 22 deletions(-) create mode 100644 behavior_packs/items/chainsaw.json create mode 100644 behavior_packs/items/drill.json delete mode 100644 resource_packs/textures/blocks/cracked_glass.png delete mode 100644 resource_packs/textures/blocks/redstone_lamp_off.png delete mode 100644 resource_packs/textures/blocks/redstone_lamp_on.png create mode 100644 resource_packs/textures/blocks/wool_colored_blue.png create mode 100644 resource_packs/textures/blocks/wool_colored_green.png create mode 100644 resource_packs/textures/blocks/wool_colored_red.png create mode 100644 resource_packs/textures/blocks/wool_colored_yellow.png create mode 100644 resource_packs/textures/item_texture.json create mode 100644 resource_packs/textures/items/chainsaw.png create mode 100644 resource_packs/textures/items/drill.png delete mode 100644 resource_packs/textures/terrain_texture.json diff --git a/behavior_packs/items/chainsaw.json b/behavior_packs/items/chainsaw.json new file mode 100644 index 0000000..c08a203 --- /dev/null +++ b/behavior_packs/items/chainsaw.json @@ -0,0 +1,18 @@ +{ + "format_version": "1.20.13", + "minecraft:item": { + "description": { + "identifier": "cc:chainsaw", + "menu_category": { + "category": "items", + "is_hidden_in_commands": false + } + }, + "components": { + "minecraft:max_stack_size": 1, + "minecraft:icon": { + "texture": "cc.chainsaw" + } + } + } +} diff --git a/behavior_packs/items/drill.json b/behavior_packs/items/drill.json new file mode 100644 index 0000000..cb96640 --- /dev/null +++ b/behavior_packs/items/drill.json @@ -0,0 +1,18 @@ +{ + "format_version": "1.20.13", + "minecraft:item": { + "description": { + "identifier": "cc:drill", + "menu_category": { + "category": "items", + "is_hidden_in_commands": false + } + }, + "components": { + "minecraft:max_stack_size": 1, + "minecraft:icon": { + "texture": "cc.drill" + } + } + } +} diff --git a/resource_packs/texts/en_US.lang b/resource_packs/texts/en_US.lang index e41f6bb..8b77693 100644 --- a/resource_packs/texts/en_US.lang +++ b/resource_packs/texts/en_US.lang @@ -10,6 +10,8 @@ message.level.incorrect.subtext=Probeer opnieuw! message.level.outofbounds=§cOut of bounds!§b message.level.outofbounds.subtext=You can't be over water! +item.cc:chainsaw=Chainsaw +item.cc:drill=Drill ## npc names npc.name.help=Help diff --git a/resource_packs/textures/blocks/cracked_glass.png b/resource_packs/textures/blocks/cracked_glass.png deleted file mode 100644 index 942571ddf2a7dfce7964b9556266c9f021ba3d97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 392 zcmV;30eAk1P)DQax(|K@^-lu3yUt>5??5l9ZyvfM6K~e}GjQi$IE0 zHfb#EY_Ga1m9Sc*zT%Gk2@=pILC{kFz-|hC$J_fb;Dg8Q-tNrJ%sr7TR~Bd1V!eeA z0QH+|?;L_4N=y!zELR2qRIJk{t+Vz0^LtRh!K5af&Y)s#!s+a^jAI5Oh!P7x01&O= z$f{V|=ht@&K&V)!XS7$bwr}C5O%=R6)jg8jZPdI$Tbuc0oU_PPJv1L(3;Yt_lO0+U z@zwpE@v}hgnbh=q9ngEON=kW9&>D`+pxt!Xk7bCo$c_^t1(xk>fV@A{mrYsu7s~#7 zQ5A;BN&cGyf3e=?fE?8CbugcdojZKs{M*Y5=ddiuZlmU9!2ke0fn{A5a1bSyMi`sj m9@UD(X171-nW|cm0DwP^M!d*V!ofZO0000 z#WBR9H`&Bo{O@@O#)L&KpI0z0X6unMn8Cxqkg$qzQLpYDKcGSePgg&ebxsLQ09o1@ A6aWAK diff --git a/resource_packs/textures/blocks/redstone_lamp_on.png b/resource_packs/textures/blocks/redstone_lamp_on.png deleted file mode 100644 index fad4e78db3ce16500d4a7fb6c67b2e5cdec9947c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP*B#> z#WBR9H@W6V!n1ldE(T%MS?;_NrU_RX4yG_LT>H&jc|!TC4p1S3r>mdKI;Vst0A_(1 A-2eap diff --git a/resource_packs/textures/blocks/wool_colored_blue.png b/resource_packs/textures/blocks/wool_colored_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..b8ff5f68b792487b819df5db73e62f42372ba8b8 GIT binary patch literal 483 zcmV<90UZ8`P)Px$ok>JNR5*=oldo?ZF%-u?>29F1fi>br2g=6BCLPHiF%3+I7jiJep<_p)Nf|4d zbZkWfVU;3HCCxxVXe9$Pce+PLQc&4_Y4@a)PWJo0?+@FPzV8pHN+}^C02pHs5yo-E zT3gn1RVgI^M5F+6({{TpjZM=KV=TjRZ^#o~}9XYbm-F^2Ve%`glA z{QmKo{_>vrd=9{gF$U*c0p(8z*0wEQzkI-Z&-+i`3z>6{O0(uc03n28>-yI>&d*Mn z&1L|FJ*9LUVvG@MZ3#1k!0puqvv+UkFYjsFmgiMv79C(d+RUsy>k^TtdywU8aAwY6 zZLuhbG2*=^giw;dy}BsOS+>qf|5x7oqr|mmEj#Z!=Za0|+*61dtUc>D0T5$63R*-s zan4cKbz%N_{qIF!d64(MJSuA~bzMJ(C?ee4z2fHX|FU)IQv;YRm&?P8F2$;E>hqTi Z@Bkmc@AZs)0XqNy002ovPDHLkV1k|R-Esf` literal 0 HcmV?d00001 diff --git a/resource_packs/textures/blocks/wool_colored_green.png b/resource_packs/textures/blocks/wool_colored_green.png new file mode 100644 index 0000000000000000000000000000000000000000..c3308173ef7b360f72c46997e82b9aad2a7f9cad GIT binary patch literal 468 zcmV;_0W1EAP)Px$j!8s8R5*=glOd1WKoEt$o=mD)usTpTGAIlvI#d=Nz7#hkRaIn_SIW-_Yhe^x z9tD_L3Mo!hMGC2O24)L9xCPP7ZIY1;yt8lKyf?G2mdoWovPdbRssM-xs>(17gb@5J zk0PZ6fT}tmza%35-}k*2v%7_Xhhgxfb&xXyoK7bI_WM0`T_Ymr0wO|HRW2dMNJ6^3V%wE7;wFw;B^$l~LH%m$EP#A!z{^_zE|~N7^9dQDVg3U>Uj=YCif{P<0000< KMNUMnLSTaCAIx3= literal 0 HcmV?d00001 diff --git a/resource_packs/textures/blocks/wool_colored_red.png b/resource_packs/textures/blocks/wool_colored_red.png new file mode 100644 index 0000000000000000000000000000000000000000..6223d40264b19941a0a0a3b2a657f858e3056267 GIT binary patch literal 623 zcmV-#0+9WQP)Px%DM>^@R5*=old)?PQ5?rVO#%+@THhcf_N8fvDIr$sA{C_2rGp@d5FAQ7We6dI ziwN4m{t4MiDcD6(K_UoIsDrlFAT7Z{sFq@eG&D_59j@^XT8gwod5??ugM+){zVG|_ zzW2SJVzGFFZyd+L^E?2A5O|)4>$+H$W#0KG%&O^0@}r&S7+XAw8>0P8}Udw zMRoNf@e93po`;n3j6ly`=Lmqyu`o-ODw)Y?c6M6~MinFJ6pIV<##zS=Xym=l5z)jD zqhsT&tbHZkcxRB$_gW^i-w+_6l;YrTh|#feHY&@!ef6A3z0AWq*ZBSP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UVvIsoajbLw3+EJh;$D5b*pk56QCc>s=$9k$k%6@apz zV6T7d9qwprwZNYmOoqY&5SyD-3UD@;r`}aVb)}ufXv6};hYcn}VR1FK;B-2Nj zOp?v@02GBS$+5(yczomH@r{eFsgjxL6J1j!o-(9xfv;pMBp)5@v9Y?O=$b0S?NtEu z)|Rt9J;2uSUD2`MN4&ktqid=Jx|&#c?&R|3t{7uAh|SF^Cx^Q@%p|?F<;-8#;WabN zU)KTf@bdb-0f56y682~$D!TES84}G6cwhHfzj$Hg^y$Z60btZ^7h_5j|Hz;iQ<{vr o?L~+CD2uzUsZyw1a`IpG2CCqtW>wgS761SM07*qoM6N<$f;K+WCIA2c literal 0 HcmV?d00001 diff --git a/resource_packs/textures/terrain_texture.json b/resource_packs/textures/terrain_texture.json deleted file mode 100644 index 8ea89ce..0000000 --- a/resource_packs/textures/terrain_texture.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "texture_name": "atlas.terrain", - "resource_pack_name": "cc", - "padding": 8, - "num_mip_levels": 4, - "texture_data": { - "cracked_glass": { - "textures": "textures/blocks/cracked_glass" - } - } -} diff --git a/scripts/levels/level1/mission1.ts b/scripts/levels/level1/mission1.ts index af98b29..139ee9d 100644 --- a/scripts/levels/level1/mission1.ts +++ b/scripts/levels/level1/mission1.ts @@ -1,4 +1,12 @@ -import { BlockType, BlockTypes, EntityInventoryComponent, Player, Vector3, world } from "@minecraft/server"; +import { + BlockType, + BlockTypes, + BlockVolume, + EntityInventoryComponent, + Player, + Vector3, + world, +} from "@minecraft/server"; import Level from "../../Commandeer/level/level"; import pupeteer from "../../Commandeer/pupeteer"; import { teleportAgent, isAgentAt, getAgentLocation, getAgent } from "../../Commandeer/utils/agentUtils"; @@ -51,6 +59,9 @@ let toolBlocks = [ MinecraftBlockTypes.BlueWool, ]; +let noDrillYet = true; +let noChainsawYet = true; + const level1ResetCommandBlockPos: Vector3 = vector3(56, 68, 211); const level1: Level = new Level( () => { @@ -84,6 +95,20 @@ const level1: Level = new Level( } } + let drillBlock = world.getDimension("overworld").getBlock(vector3(-75, 68, 268)); + if (drillBlock?.type.id == MinecraftBlockTypes.Air && noDrillYet) { + noDrillYet = false; + let volume: BlockVolume = new BlockVolume(vector3(-70, 71, 285), vector3(-70, 71, 285)); + world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock); + } + + let chainsawBlock = world.getDimension("overworld").getBlock(vector3(-79, 68, 264)); + if (chainsawBlock?.type.id == MinecraftBlockTypes.Air && noChainsawYet) { + noChainsawYet = false; + let volume: BlockVolume = new BlockVolume(vector3(-69, 71, 285), vector3(-69, 71, 285)); + world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock); + } + for (let i = 0; i < flowerPositions.length; i++) { let block = world.getDimension("overworld").getBlock(flowerPositions[i]); if (block?.type.id == MinecraftBlockTypes.BlueOrchid) { @@ -114,11 +139,13 @@ const level1: Level = new Level( } if (isOutOfBounds) { + teleportAndFaceAgent(level1StartPosition, vector3(-84, 69, 272)); + pupeteer.sendWorldMessage("%message.level1.outOfBounds"); pupeteer.setTitleTimed("%message.level1.outOfBounds", 2.5); world.getDimension("overworld").runCommand("execute as @p run codebuilder runtime stop @s"); - world.getDimension("Overworld").runCommand("/fill -74 69 272 -83 69 259 air replace blue_orchid"); + world.getDimension("Overworld").runCommand("/fill -74 69 272 -83 69 259 air replace blue_orchid"); toolPositions = [vector3(-75, 68, 268), vector3(-77, 68, 266), vector3(-79, 68, 264), vector3(-81, 68, 262)]; for (let i = 0; i < toolPositions.length; i++) { let blockToReplace = world.getDimension("overworld").getBlock(toolPositions[i]); @@ -127,8 +154,6 @@ const level1: Level = new Level( } } - teleportAndFaceAgent(level1StartPosition, vector3(-84, 69, 272)); - return false; } else if (isComplete) { return true; diff --git a/scripts/levels/level2/mission1.ts b/scripts/levels/level2/mission1.ts index ec22f70..f275d30 100644 --- a/scripts/levels/level2/mission1.ts +++ b/scripts/levels/level2/mission1.ts @@ -49,13 +49,14 @@ const level2: Level = new Level( } if (isOutOfBounds) { + teleportAndFaceAgent(level2StartPosition, vector3(-125, 69, 272)); + pupeteer.sendWorldMessage("%message.level2.outOfBounds"); pupeteer.setTitleTimed("%message.level2.outOfBounds", 2.5); world.getDimension("overworld").runCommand("execute as @p run codebuilder runtime stop @s"); world.getDimension("Overworld").runCommand("/fill -111 69 272 -124 69 258 air replace sweet_berry_bush"); world.getDimension("Overworld").runCommand("/fill -111 69 272 -124 69 258 air replace jungle_sapling"); - teleportAndFaceAgent(level2StartPosition, vector3(-125, 69, 272)); return false; } else if (isComplete) { return true; diff --git a/scripts/levels/level2/mission2.ts b/scripts/levels/level2/mission2.ts index d9fa7b6..534de21 100644 --- a/scripts/levels/level2/mission2.ts +++ b/scripts/levels/level2/mission2.ts @@ -53,14 +53,16 @@ const level3: Level = new Level( } if (isOutOfBounds) { + teleportAndFaceAgent(level3StartPosition, vector3(-148, 68, 265)); + pupeteer.sendWorldMessage("%message.level3.outOfBounds"); pupeteer.setTitleTimed("%message.level3.outOfBounds", 2.5); world.getDimension("overworld").runCommand("execute as @p run codebuilder runtime stop @s"); world.getDimension("Overworld").runCommand("/fill -133 68 272 -148 68 258 air replace sweet_berry_bush"); world.getDimension("Overworld").runCommand("/fill -133 67 272 -148 67 258 magma replace cobblestone"); - world.getDimension("overworld").runCommand("/execute at @e[tag=KillingPandas] run kill @e[type=panda, r=10]"); + let volume: BlockVolume = new BlockVolume(vector3(-131, 69, 284), vector3(-131, 69, 284)); + world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock); - teleportAndFaceAgent(level3StartPosition, vector3(-148, 68, 265)); return false; } else if (isComplete) { return true; diff --git a/scripts/levels/level2/mission3.ts b/scripts/levels/level2/mission3.ts index a304292..8a2a84e 100644 --- a/scripts/levels/level2/mission3.ts +++ b/scripts/levels/level2/mission3.ts @@ -46,18 +46,23 @@ const level4: Level = new Level( } if (isOutOfBounds) { + teleportAndFaceAgent(level4StartPosition, vector3(-175, 62, 261)); + pupeteer.sendWorldMessage("%message.level4.outOfBounds"); pupeteer.setTitleTimed("%message.level4.outOfBounds", 2.5); world.getDimension("overworld").runCommand("execute as @p run codebuilder runtime stop @s"); let volume: BlockVolume = new BlockVolume(vector3(-163, 67, 291), vector3(-163, 67, 291)); world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock); - teleportAndFaceAgent(level4StartPosition, vector3(-175, 62, 261)); return false; } else if (isComplete) { return true; } return false; + }, + () => { + let volume: BlockVolume = new BlockVolume(vector3(-163, 67, 291), vector3(-163, 67, 291)); + world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock); } ); diff --git a/scripts/levels/level3/mission1.ts b/scripts/levels/level3/mission1.ts index 0b76fd8..c1dfba5 100644 --- a/scripts/levels/level3/mission1.ts +++ b/scripts/levels/level3/mission1.ts @@ -77,11 +77,13 @@ const level5: Level = new Level( } if (isOutOfBounds) { + teleportAndFaceAgent(level5StartPosition, vector3(-226, 65, 229)); + pupeteer.sendWorldMessage("%message.level5.outOfBounds"); pupeteer.setTitleTimed("%message.level5.outOfBounds", 2.5); world.getDimension("overworld").runCommand("execute as @p run codebuilder runtime stop @s"); - let volume: BlockVolume = new BlockVolume(vector3(-163, 67, 291), vector3(-163, 67, 291)); + let volume: BlockVolume = new BlockVolume(vector3(-255, 67, 246), vector3(-255, 67, 246)); world.getDimension("overworld").fillBlocks(volume, MinecraftBlockTypes.RedstoneBlock); for (let i = 0; i < diamondAndPickaxePositions.length; i++) { @@ -91,7 +93,6 @@ const level5: Level = new Level( } } - teleportAndFaceAgent(level5StartPosition, vector3(-226, 65, 229)); return false; } else if (isComplete) { return true; diff --git a/scripts/main.ts b/scripts/main.ts index 7057770..71ad485 100644 --- a/scripts/main.ts +++ b/scripts/main.ts @@ -126,6 +126,8 @@ system.runInterval(async () => { gateState = GateState.open; } break; + case 11: + Pupeteer.setActionBar("You completed the mission."); } } }); @@ -149,7 +151,7 @@ world.afterEvents.chatSend.subscribe(async (event: ChatSendAfterEvent) => { world.getDimension("Overworld").runCommand("/fill -128 71 255 -128 74 276 barrier replace air"); world.getDimension("Overworld").runCommand("/fill -154 69 255 -154 74 276 barrier replace air"); world.getDimension("Overworld").runCommand("/fill -182 69 255 -182 74 276 barrier replace air"); - mindKeeper.set(CURRENT_LEVEL, 8); + mindKeeper.set(CURRENT_LEVEL, 0); world.sendMessage("currentlevel = " + mindKeeper.get(CURRENT_LEVEL)); } }); @@ -269,6 +271,12 @@ triggerManager.RegisterFunctionTrigger("PastLevel4", async (event) => { } }); +triggerManager.RegisterFunctionTrigger("CompletedTheMission", async (event) => { + if (mindKeeper.get(CURRENT_LEVEL) == 10) { + mindKeeper.increment(CURRENT_LEVEL); + } +}); + Commands.register(PREFIX, "info", (arg) => { world.sendMessage("-----------------"); world.sendMessage("Current level: " + mindKeeper.get(CURRENT_LEVEL));