From 85ad45865da37dc9e08be03f0cddf88f476b43e0 Mon Sep 17 00:00:00 2001 From: FluxCapacitor2 <31071265+FluxCapacitor2@users.noreply.github.com> Date: Sun, 7 Jan 2024 16:04:06 -0500 Subject: [PATCH] Work on quickstart guide --- astro.config.mjs | 4 +- src/content/docs/guides/dev-env.md | 8 ++- src/content/docs/index.mdx | 4 +- src/content/docs/intro/example-game.mdx | 28 ++++++++ src/content/docs/intro/quickstart.md | 71 +++++++++++++++++++++ src/content/docs/reference/worlds-folder.md | 4 ++ 6 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 src/content/docs/intro/example-game.mdx create mode 100644 src/content/docs/reference/worlds-folder.md diff --git a/astro.config.mjs b/astro.config.mjs index 91d2154..27a441f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -15,12 +15,12 @@ export default defineConfig({ baseUrl: "https://github.com/BlueDragonMC/Docs/edit/main/", }, social: { - github: "https://github.com/BlueDragonMC/", + github: "https://github.com/BlueDragonMC", discord: "https://bluedragonmc.com/discord", }, sidebar: [ { - label: "Start Here", + label: "Introduction", autogenerate: { directory: "intro" }, }, { diff --git a/src/content/docs/guides/dev-env.md b/src/content/docs/guides/dev-env.md index dbdb34a..7f6da45 100644 --- a/src/content/docs/guides/dev-env.md +++ b/src/content/docs/guides/dev-env.md @@ -1,4 +1,10 @@ --- title: Development Environment Setup -description: A guide in my new Starlight docs site. +description: How to work on BlueDragon in development mode --- + +## Limitations + +Working in development mode means that you cannot use or test any features that rely on messaging, like parties and matchmaking. + +## Setup diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index b7a209e..dfa52ca 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -8,11 +8,11 @@ hero: file: ../../assets/logo.png actions: - text: Get Started - link: /guides/getting-started/ + link: /intro/quickstart icon: right-arrow variant: primary - text: Check out our GitHub - link: https://bluedragonmc.com/github + link: https://github.com/BlueDragonMC icon: external --- {/* diff --git a/src/content/docs/intro/example-game.mdx b/src/content/docs/intro/example-game.mdx new file mode 100644 index 0000000..1703b39 --- /dev/null +++ b/src/content/docs/intro/example-game.mdx @@ -0,0 +1,28 @@ +--- +title: Example Game +description: Explore the code of BlueDragon's example game and use it to build your own. +--- + +import { LinkCard } from "@astrojs/starlight/components"; + + + +Exploring the example game is the best way to get started with BlueDragon software. +This guide will break down the [main class](https://github.com/BlueDragonMC/ExampleGame/blob/main/src/main/kotlin/com/bluedragonmc/games/examplegame/ExampleGame.kt) +and the necessary [configuration file](https://github.com/BlueDragonMC/ExampleGame/blob/main/src/main/resources/game.properties). + +## Configuration File + +```properties +# The game.properties file defines the game's main class (which extends com.bluedragonmc.server.Game) +# It is used by the plugin loader to determine which class to instantiate when a game is requested. +# The name is also used to populate menus and command completion. +name=ExampleGame +main-class=com.bluedragonmc.games.examplegame.ExampleGame +``` + +## Main Class \ No newline at end of file diff --git a/src/content/docs/intro/quickstart.md b/src/content/docs/intro/quickstart.md index ffa57bd..7085999 100644 --- a/src/content/docs/intro/quickstart.md +++ b/src/content/docs/intro/quickstart.md @@ -1,4 +1,75 @@ --- title: Quickstart description: A guide in my new Starlight docs site. +sidebar: + order: 0 --- + +## Requirements + +1. You must have Java 17 or later installed. +2. This guide assumes you're using a Bash-like shell. Use Linux for best results; on Windows, you can modify the scripts or use [WSL](https://learn.microsoft.com/en-us/windows/wsl/). +3. [Docker](https://docs.docker.com/desktop/) is recommended to quickly run the required MongoDB and LuckPerms services. + +## Setup + +1. Clone the `Server` and `ExampleGame` repositories: + +```sh +git clone https://github.com/BlueDragonMC/Server +git clone https://github.com/BlueDragonMC/ExampleGame +``` + +2. Build the `Server` project: + +```sh +cd Server +./gradlew build +``` + +3. Build the example game: + +```sh +cd ../ExampleGame +./gradlew build +``` + +4. Copy the JARs into their appropriate places: + +```sh +cd .. +mkdir -p ./run/games +cp Server/build/libs/Server-1.0-SNAPSHOT-all.jar run/server.jar +cp ExampleGame/build/libs/ExampleGame-1.0-SNAPSHOT.jar run/games/ExampleGame.jar +``` + +5. Copy a world folder: + +_You will need a Minecraft world that was saved on the same version as BlueDragon's Minestom dependency. At the time of writing, this is 1.20.1._ + +```sh +mkdir -p ./run/worlds +cp YOUR_WORLD_FOLDER run/worlds/ExampleGame/ExampleMap +``` + +6. Run dependencies: + +```sh +docker run -d -p 27017:27017 mongo +docker run -d -p 8080:8080 ghcr.io/luckperms/rest-api +``` + +7. Start the server: + +```sh +cd ./run +BLUEDRAGON_DEFAULT_GAME=ExampleGame java -jar server.jar +``` + +_The BLUEDRAGON_DEFAULT_GAME environment variable tells the server to send players into the ExampleGame instead of looking for a game called `Lobby`_ + +## Further Reading + +- Learn more about [the `worlds` folder](/reference/worlds-folder). +- Explore the code of [the example game](/intro/example-game/) and [create your own](/guides/creating-a-game/) from scratch. +- diff --git a/src/content/docs/reference/worlds-folder.md b/src/content/docs/reference/worlds-folder.md new file mode 100644 index 0000000..8f6de06 --- /dev/null +++ b/src/content/docs/reference/worlds-folder.md @@ -0,0 +1,4 @@ +--- +title: Worlds Folder +description: The file structure and required files in the server's worlds directory. +---