Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions minecraft/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ComposeConfig } from "../compose";
import { resolveSettings } from "../settings";
import { buildMinecraftCompose, dockerImage } from "./install";
import { buildMinecraftCompose } from "./install";
import { minecraftSettings } from "./settings";

const buildCompose = (config: ComposeConfig, raw: unknown): string =>
Expand All @@ -9,7 +9,7 @@ const buildCompose = (config: ComposeConfig, raw: unknown): string =>
export const minecraft = {
buildCompose,
description: "Minecraft is a sandbox game where you can build your own world.",
dockerImage,
dockerImage: minecraftSettings.dockerImage,
enabled: true,
gamedigId: "minecraft",
id: "minecraft",
Expand Down
12 changes: 1 addition & 11 deletions minecraft/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ import type { ComposeConfig } from "../compose";
import { escapeComposeValue } from "../compose";
import type { MinecraftSettings } from "./settings";

export const dockerImage = {
"Java 25": "ghcr.io/pterodactyl/yolks:java_25",
"Java 22": "ghcr.io/pterodactyl/yolks:java_22",
"Java 21": "ghcr.io/pterodactyl/yolks:java_21",
"Java 17": "ghcr.io/pterodactyl/yolks:java_17",
"Java 16": "ghcr.io/pterodactyl/yolks:java_16",
"Java 11": "ghcr.io/pterodactyl/yolks:java_11",
"Java 8": "ghcr.io/pterodactyl/yolks:java_8",
};

export const buildMinecraftCompose = (
config: ComposeConfig,
settings: MinecraftSettings,
Expand All @@ -23,7 +13,7 @@ export const buildMinecraftCompose = (

return `services:
minecraft:
image: ${dockerImage}
image: ${settings.dockerImage}
container_name: nodebyte-game
ports:
- "25565:25565"
Expand Down
14 changes: 14 additions & 0 deletions minecraft/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ import { defineSettings } from "../settings";
import type { SettingsValues } from "../settings";

export const minecraftSettings = defineSettings({
dockerImage: {
default: "ghcr.io/pterodactyl/yolks:java_25",
label: "Docker Image",
options: [
{ value: "ghcr.io/pterodactyl/yolks:java_25" },
{ value: "ghcr.io/pterodactyl/yolks:java_22" },
{ value: "ghcr.io/pterodactyl/yolks:java_21" },
{ value: "ghcr.io/pterodactyl/yolks:java_17" },
{ value: "ghcr.io/pterodactyl/yolks:java_16" },
{ value: "ghcr.io/pterodactyl/yolks:java_11" },
{ value: "ghcr.io/pterodactyl/yolks:java_8" },
],
type: "select",
},
allowNether: {
default: true,
label: "Allow Nether",
Expand Down
Loading