Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit dd907c3

Browse files
committed
[PP-2]: Add note in readme about waiting for plugins to load before changing state
1 parent c96c640 commit dd907c3

5 files changed

Lines changed: 24 additions & 21 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
![ServerPersistence Header](https://i.imgur.com/5zPJx7X.png)
1+
![ServerReady Header](https://i.imgur.com/MzyOhS2.png)
22

33
[![Build Plugin](https://github.com/PlexPrison/ServerPersistence/actions/workflows/build.yml/badge.svg)](https://github.com/PlexPrison/ServerPersistence/actions/workflows/build.yml)
44

5-
ServerPersistence is a plugin for infinitely running Mineplex Studio project instances until they are killed by external
5+
ServerReady is a plugin for infinitely running Mineplex Studio project instances until they are killed by external
66
factors. This permanently sets the project into `PRE_START` phase (meaning it will last forever, until killed).
77

8+
The plugin will ensure all other plugins are done with their load process before marking the server as `PRE_START`. It
9+
will fire the default Mineplex events to signify that everything is ready, so these are also suitable to listen to.
10+
811
It's a very simple plugin, with no configuration.
912

1013
## Installation
1114

12-
1. Head to the [latest release](https://github.com/PlexPrison/ServerPersistence/releases) of the plugin
15+
1. Head to the [latest release](https://github.com/PlexPrison/ServerReady/releases) of the plugin
1316
2. Download the Jar file from the latest release
14-
3. Plop `ServerPersistence.jar` into a folder within your Mineplex Project called `external-plugins`
15-
4. Start your server, and profit.
17+
3. Plop `ServerReady-1.0.0.jar` into a folder within your Mineplex Project called `external-plugins`
18+
4. Start your server, and profit.

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id("net.minecrell.plugin-yml.paper") version "0.6.0"
88
}
99

10-
group = "com.plexprison.serverpersistence"
10+
group = "com.plexprison.serverready"
1111
version = "1.0.0"
1212

1313
tasks {
@@ -17,9 +17,9 @@ tasks {
1717
}
1818

1919
paper {
20-
name = "ServerPersistence"
20+
name = "ServerReady"
2121
version = project.version.toString()
22-
main = "com.plexprison.serverpersistence.ServerPersistence"
22+
main = "com.plexprison.serverready.ServerReady"
2323
apiVersion = "1.20"
2424

2525
serverDependencies {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rootProject.name = "ServerPersistence"
1+
rootProject.name = "ServerReady"
22

33
pluginManagement {
44
repositories {

src/main/java/com/plexprison/serverpersistence/ServerPersistence.java renamed to src/main/java/com/plexprison/serverready/ServerReady.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.plexprison.serverpersistence;
1+
package com.plexprison.serverready;
22

3-
import com.plexprison.serverpersistence.game.EmptyGame;
3+
import com.plexprison.serverready.game.EmptyGame;
44
import lombok.Getter;
55
import org.bukkit.event.Listener;
66
import org.bukkit.plugin.Plugin;
@@ -14,11 +14,11 @@
1414
import java.util.Map;
1515

1616
/**
17-
* Main plugin class for ServerPersistence.
17+
* Main plugin class for ServerReady.
1818
* Handles plugin loading coordination and game state initialization.
1919
*/
2020
@Getter
21-
public class ServerPersistence extends JavaPlugin implements Listener {
21+
public class ServerReady extends JavaPlugin implements Listener {
2222

2323
private static final int REQUIRED_STABLE_TICKS = 20; // 1 second of stable state
2424

@@ -67,13 +67,13 @@ public void run() {
6767
* @return PluginStateSnapshot containing current plugin information
6868
*/
6969
private PluginStateSnapshot createPluginStateSnapshot() {
70-
final PluginManager pluginManager = ServerPersistence.this.getServer().getPluginManager();
70+
final PluginManager pluginManager = ServerReady.this.getServer().getPluginManager();
7171
final Map<String, Boolean> currentStates = new HashMap<>();
7272
final List<String> failedPlugins = new ArrayList<>();
7373
boolean allPluginsFinished = true;
7474

7575
for (final Plugin plugin : pluginManager.getPlugins()) {
76-
if (!plugin.equals(ServerPersistence.this)) {
76+
if (!plugin.equals(ServerReady.this)) {
7777
final boolean isEnabled = plugin.isEnabled();
7878
currentStates.put(plugin.getName(), isEnabled);
7979

@@ -116,7 +116,7 @@ private void updatePluginStates(final Map<String, Boolean> currentStates) {
116116
private void warnAboutFailedPlugins(final List<String> failedPlugins) {
117117
for (final String failedPlugin : failedPlugins) {
118118
if (!this.warnedPlugins.contains(failedPlugin)) {
119-
ServerPersistence.this.getLogger().warning(
119+
ServerReady.this.getLogger().warning(
120120
"Plugin '" + failedPlugin + "' failed to load but continuing with game state setup."
121121
);
122122
this.warnedPlugins.add(failedPlugin);
@@ -131,24 +131,24 @@ private void warnAboutFailedPlugins(final List<String> failedPlugins) {
131131
* @return true if you should proceed, false otherwise
132132
*/
133133
private boolean shouldProceedToGameState(final boolean allPluginsFinished) {
134-
return this.stableTicks >= ServerPersistence.REQUIRED_STABLE_TICKS && allPluginsFinished;
134+
return this.stableTicks >= ServerReady.REQUIRED_STABLE_TICKS && allPluginsFinished;
135135
}
136136

137137
/**
138138
* Proceeds to game state initialization and logs the status.
139139
*/
140140
private void proceedToGameState() {
141141
if (!this.warnedPlugins.isEmpty()) {
142-
ServerPersistence.this.getLogger().info(
142+
ServerReady.this.getLogger().info(
143143
"All plugins have finished loading. Setting up game state with " +
144144
this.warnedPlugins.size() + " failed plugin(s)."
145145
);
146146
} else {
147-
ServerPersistence.this.getLogger().info(
147+
ServerReady.this.getLogger().info(
148148
"All plugins have finished loading successfully. Setting up game state."
149149
);
150150
}
151-
ServerPersistence.setState();
151+
ServerReady.setState();
152152
this.cancel();
153153
}
154154
}

src/main/java/com/plexprison/serverpersistence/game/EmptyGame.java renamed to src/main/java/com/plexprison/serverready/game/EmptyGame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.plexprison.serverpersistence.game;
1+
package com.plexprison.serverready.game;
22

33
import com.mineplex.studio.sdk.modules.MineplexModuleManager;
44
import com.mineplex.studio.sdk.modules.game.*;

0 commit comments

Comments
 (0)