Skip to content

Commit

Permalink
Work on quickstart guide
Browse files Browse the repository at this point in the history
  • Loading branch information
FluxCapacitor2 committed Jan 7, 2024
1 parent 0bd37f7 commit 85ad458
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 5 deletions.
4 changes: 2 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
},
{
Expand Down
8 changes: 7 additions & 1 deletion src/content/docs/guides/dev-env.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
{/*
Expand Down
28 changes: 28 additions & 0 deletions src/content/docs/intro/example-game.mdx
Original file line number Diff line number Diff line change
@@ -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";

<LinkCard
title="Example Game GitHub Repository"
description="Click here to explore the code of our sample game."
href="https://github.com/BlueDragonMC/ExampleGame"
/>

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
71 changes: 71 additions & 0 deletions src/content/docs/intro/quickstart.md
Original file line number Diff line number Diff line change
@@ -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.
-
4 changes: 4 additions & 0 deletions src/content/docs/reference/worlds-folder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Worlds Folder
description: The file structure and required files in the server's worlds directory.
---

0 comments on commit 85ad458

Please sign in to comment.