Skip to content

Commit

Permalink
feat(projects): Samples and starters
Browse files Browse the repository at this point in the history
- Add create, add, world, info CLI commands
  • Loading branch information
mammerla committed Aug 27, 2024
1 parent 7718910 commit 9851a9e
Show file tree
Hide file tree
Showing 106 changed files with 11,030 additions and 1,882 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Builds the web app for production to the `build` folder. It correctly bundles Re

## Sample Command Lines

Once packaged, you can install the command line locally via `npx mctools-<version>.tgz`. Some sample command lines:
Once packaged, you can install the command line locally via `npm install minecraft-creator-tools-<version>.tgz`. If you'd like to make Minecraft Creator Tools available across your device, you can install it globally via `npm install -g minecraft-creator-tools-<version>.tgz`.

Some sample command lines:

`npx mct`

Expand All @@ -81,6 +83,14 @@ Loads the project folder `d:\mycontent\myprojectfolder`, validates using the 'ad

Loads the project file `d:\mycontent\packages\myaddon.mcaddon`, validates using the 'addon' suite of strict tests and shows validation results on the command line. Also displays verbose logging messages.


### New project creation

`npx mct create`

Asks a series of questions and creates a new project based on those preferences.


## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
56 changes: 56 additions & 0 deletions app/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,48 @@
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "cli (add)",
"cwd": "${workspaceRoot}/debugoutput/minecraft-gametests/",
"args": ["add", "-i", "../temp/test"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps":true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (info)",
"cwd": "${workspaceRoot}/debugoutput/gtbasicworld/",
"args": ["info"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps": true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (world)",
"cwd": "${workspaceRoot}/debugoutput/",
"args": ["world", "set", "-betaapis", "-o", "./worldtest/"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps": true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (val content1)",
"cwd": "${workspaceRoot}/../samplecontent/addon/build/content1/",
Expand Down Expand Up @@ -78,6 +120,20 @@
"runtimeArgs": ["--nolazy", "--max-old-space-size=32768"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (create)",
"cwd": "${workspaceRoot}/debugoutput/start/",
"args": ["create", "-i", "test", "custom_name", "addonStarter", "custom_creator", "florid description"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps":true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"type": "node",
"request": "launch",
Expand Down
10 changes: 2 additions & 8 deletions app/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,10 @@ function runUpdateVersions() {
return gulp
.src(versionSource, { base: "" })
.pipe(
updateVersions([
"./package.json",
"./package-lock.json",
"./jsnode/package.json",
"./src/core/Constants.ts",
])
updateVersions(["./package.json", "./package-lock.json", "./jsnode/package.json", "./src/core/Constants.ts"])
);
}


function runDownloadSamples() {
return gulp.src(mcreslistsamplesigs, { base: "" }).pipe(downloadResources("public/res/samples/microsoft/"));
}
Expand All @@ -277,7 +271,7 @@ function runDownloadVanillaResources() {
gulp.task("jsnwebbuild", gulp.series("clean-jsnwebbuild", compileJsnWebBuild, "postclean-jsnwebbuild"));

gulp.task("clean-webbuild", function () {
return del(["web"]);
return del(["out/web"]);
});

gulp.task("clean-res", function () {
Expand Down
223 changes: 110 additions & 113 deletions app/public/data/gallery.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,119 +155,6 @@
"id": "fishBowlBlock",
"type": 2
},
{
"title": "Camera Grapple",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/camera_front.png",
"id": "CameraGrapple.ts",
"codeLineStart": 18,
"tags": ["editor"],
"type": 5
},
{
"title": "Star Brush Shape",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "items/nether_star.png",
"id": "StarBrushShape.ts",
"codeLineStart": 15,
"type": 5
},
{
"title": "Dye Brush",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "items/dye_powder_red.png",
"id": "DyeBrush.ts",
"codeLineStart": 117,
"type": 5
},
{
"title": "Farm Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/farmland_wet.png",
"id": "FarmGenerator.ts",
"codeLineStart": 43,
"type": 5
},
{
"title": "Go to Mark",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "GotoMark.ts",
"codeLineStart": 100,
"type": 5
},
{
"title": "Portal Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "PortalGenerator.ts",
"codeLineStart": 322,
"type": 5
},
{
"title": "Simple Tool",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "SimpleTool.ts",
"codeLineStart": 108,
"type": 5
},
{
"title": "Locate Biome",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "LocateBiome.ts",
"codeLineStart": 94,
"type": 5
},
{
"title": "Tree Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "TreeGenerator.ts",
"codeLineStart": 43,
"type": 5
},
{
"title": "Starter Hello World GameTest",
"description": "A simple introduction to creating GameTests. See the tutorial at https://aka.ms/newgametest.",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-gametests",
"gitHubFolder": "/starterTestsTutorial",
"logoImage": "behavior_packs/starterTestsTutorial/pack_icon.png",
"id": "helloWorldGameTest",
"tags": ["gametest"],
"type": 0
},
{
"title": "Basic GameTests",
"description": "A collection of GameTests focused on exploring different facets of Mob Behavior.",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-gametests",
"gitHubFolder": "/js-gametests",
"logoImage": "behavior_packs/JsGameTests/pack_icon.png",
"id": "mobGameTest",
"tags": ["gametest"],
"type": 0
},
{
"title": "Create Explosion",
"gitHubOwner": "microsoft",
Expand Down Expand Up @@ -665,6 +552,116 @@
"/resource_pack/textures/entity/wolf/wolf_angry.png",
"/resource_pack/textures/entity/wolf/wolf_tame.tga"
]
},
{
"title": "Camera Grapple",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/camera_front.png",
"id": "camera-grapple.ts",
"codeLineStart": 19,
"tags": ["editor"],
"type": 5
},
{
"title": "Star Shape Brush",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "items/nether_star.png",
"id": "star-brush-shape.ts",
"codeLineStart": 15,
"tags": ["editor"],
"type": 5
},
{
"title": "Dye Brush",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "items/dye_powder_red.png",
"id": "dye-brush.ts",
"codeLineStart": 117,
"tags": ["editor"],
"type": 5
},
{
"title": "Farm Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/farmland_wet.png",
"id": "farm-generator.ts",
"codeLineStart": 43,
"tags": ["editor"],
"type": 5
},
{
"title": "Go to Mark",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "goto-mark.ts",
"codeLineStart": 100,
"tags": ["editor"],
"type": 5
},
{
"title": "Portal Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "portal-generator.ts",
"codeLineStart": 322,
"tags": ["editor"],
"type": 5
},
{
"title": "Locate Biome",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "locate-biome.ts",
"codeLineStart": 94,
"tags": ["editor"],
"type": 5
},
{
"title": "Tree Generator",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-scripting-samples",
"gitHubFolder": "/editor-script-box",
"localLogo": "blocks/cut_copper.png",
"id": "tree-generator.ts",
"codeLineStart": 43,
"tags": ["editor"],
"type": 5
},
{
"title": "Starter GameTest",
"description": "A simple introduction to creating GameTests. See the tutorial at https://aka.ms/newgametest.",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-gametests",
"gitHubFolder": "/starterTestsTutorial",
"logoImage": "behavior_packs/starterTestsTutorial/pack_icon.png",
"id": "helloWorldGameTest",
"tags": ["gametest"],
"type": 0
},
{
"title": "Basic GameTests",
"description": "A collection of GameTests focused on exploring different facets of Mob Behavior.",
"gitHubOwner": "microsoft",
"gitHubRepoName": "minecraft-gametests",
"gitHubFolder": "/js-gametests",
"logoImage": "behavior_packs/JsGameTests/pack_icon.png",
"id": "mobGameTest",
"tags": ["gametest"],
"type": 0
}
]
}
Loading

0 comments on commit 9851a9e

Please sign in to comment.