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 ;
44import lombok .Getter ;
55import org .bukkit .event .Listener ;
66import org .bukkit .plugin .Plugin ;
1414import 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 }
0 commit comments