File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
balancer/src/main/java/com/jaimemartz/playerbalancer/section Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -235,22 +235,25 @@ public ServerSection getByPlayer(ProxiedPlayer player) {
235235 }
236236
237237 public void registerServer (ServerInfo server , ServerSection section ) {
238- //Checking for duplicated server on non dummy sections
239- if (servers .containsKey (server ) && !isDummy (section )) {
240- ServerSection other = servers .get (server );
241- throw new IllegalArgumentException (String .format (
242- "The server \" %s\" is already in the section \" %s\" " ,
238+ if (!isDummy (section )) {
239+ // Checking for already we already added this server to other section
240+ // This can only happen if another non dummy section registers this server
241+ if (servers .containsKey (server )) {
242+ ServerSection other = servers .get (server );
243+ throw new IllegalArgumentException (String .format (
244+ "The server \" %s\" is already in the section \" %s\" " ,
245+ server .getName (),
246+ other .getName ()
247+ ));
248+ }
249+
250+ plugin .getLogger ().info (String .format ("Registering server \" %s\" to section \" %s\" " ,
243251 server .getName (),
244- other .getName ()
252+ section .getName ()
245253 ));
246- }
247-
248- plugin .getLogger ().info (String .format ("Registering server \" %s\" to section \" %s\" " ,
249- server .getName (),
250- section .getName ()
251- ));
252254
253- servers .put (server , section );
255+ servers .put (server , section );
256+ }
254257 }
255258
256259 public void calculateServers (ServerSection section ) {
You can’t perform that action at this time.
0 commit comments