Skip to content

Commit 57f0431

Browse files
committed
Add Spigot to service seeder
1 parent 551b73b commit 57f0431

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

database/seeds/MinecraftServiceTableSeeder.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ private function addCoreOptions()
7676
'executable' => null,
7777
'startup' => null
7878
]);
79+
80+
$this->option['spigot'] = Models\ServiceOptions::create([
81+
'parent_service' => $this->service->id,
82+
'name' => 'Spigot',
83+
'description' => 'Spigot is the most widely-used modded Minecraft server software in the world. It powers many of the top Minecraft server networks around to ensure they can cope with their huge player base and ensure the satisfaction of their players. Spigot works by reducing and eliminating many causes of lag, as well as adding in handy features and settings that help make your job of server administration easier.',
84+
'tag' => 'spigot',
85+
'docker_image' => 'quay.io/pterodactyl/minecraft:spigot',
86+
'executable' => null,
87+
'startup' => '-Xms128M -Xmx{{SERVER_MEMORY}}M -Djline.terminal=jline.UnsupportedTerminal -jar {{SERVER_JARFILE}}'
88+
]);
7989
}
8090

8191
private function addVariables()
@@ -103,5 +113,41 @@ private function addVariables()
103113
'required' => 1,
104114
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'
105115
]);
116+
117+
Models\ServiceVariables::create([
118+
'option_id' => $this->option['spigot']->id,
119+
'name' => 'Server Jar File',
120+
'description' => 'The name of the server jarfile to run the server with.',
121+
'env_variable' => 'SERVER_JARFILE',
122+
'default_value' => 'server.jar',
123+
'user_viewable' => 1,
124+
'user_editable' => 1,
125+
'required' => 1,
126+
'regex' => '/^([\w\d._-]+)(\.jar)$/'
127+
]);
128+
129+
Models\ServiceVariables::create([
130+
'option_id' => $this->option['spigot']->id,
131+
'name' => 'Spigot Version',
132+
'description' => 'The version of Spigot to download (using the --rev tag). Use "latest" for latest.',
133+
'env_variable' => 'DL_VERSION',
134+
'default_value' => 'latest',
135+
'user_viewable' => 1,
136+
'user_editable' => 1,
137+
'required' => 1,
138+
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'
139+
]);
140+
141+
Models\ServiceVariables::create([
142+
'option_id' => $this->option['spigot']->id,
143+
'name' => 'Download Path',
144+
'description' => 'A URL to use to download Spigot rather than building it on the server. This is not user viewable. Use <code>{{DL_VERSION}}</code> in the URL to automatically insert the assigned version into the URL. If you do not enter a URL Spigot will build directly in the container (this will fail on low memory containers).',
145+
'env_variable' => 'DL_PATH',
146+
'default_value' => '',
147+
'user_viewable' => 0,
148+
'user_editable' => 0,
149+
'required' => 0,
150+
'regex' => '/^(.*)$/'
151+
]);
106152
}
107153
}

0 commit comments

Comments
 (0)