Closed PedroMPagani closed 1 year ago
You can use ApplicationServer#getStartupManager
, and then from the StartupManager, you can use ServerStartupManager#setStartupCommand
. This is a PteroAction, so it will need to be executed.
Hey matt, it worked good, thanks for the help!
If you could take a look at this. I run a Minecraft Network and we currently have about 25 instances of game that need to be synced, is there anyway the pterodactyl allows through the api to update files?
I found Directory, now I wonder if i can listen to a startup action so that I sync what i want before it starts.
Yeah! In Directory
, it provides a bunch of methods that you can use to upload files and stuff like that. https://ci.mattmalec.com/job/Pterodactyl4J/javadoc/com/mattmalec/pterodactyl4j/client/entities/Directory.html
You could then listen to the StatusUpdateEvent to perform actions depending on the UtilizationState
.
You could then listen to the StatusUpdateEvent to perform actions depending on the
UtilizationState
.
I guess if i wanted to sync every time the instance starts i would need to stop it when it starts and sync my stuff, and then start it back up again but making sure the event doesnt endup in loop?
Is there a way to update a specific container startup commands with this wrapper? I am looking for some helper class but I can't seem to find.