File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/java/com/github/elic0de/thejpspit/spigot Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 99@ YamlFile
1010public class Queues {
1111
12+ @ YamlKey ("min_players" )
13+ private Map <String , Integer > minPlayers = Map .of ("serverName" , 6 );
14+
1215 private List <String > menuLayout = List .of (
1316 " " ,
1417 " x y z " ,
@@ -33,4 +36,8 @@ public List<String> getMenuLayout() {
3336 public Map <String , List <String >> getServers () {
3437 return servers ;
3538 }
39+
40+ public Map <String , Integer > getMinPlayers () {
41+ return minPlayers ;
42+ }
3643}
Original file line number Diff line number Diff line change 11package com .github .elic0de .thejpspit .spigot .queue ;
22
3+ import com .github .elic0de .thejpspit .spigot .TheJpsPit ;
34import com .github .elic0de .thejpspit .spigot .network .PluginMessageReceiver ;
45import com .github .elic0de .thejpspit .spigot .player .PitPlayer ;
56import java .util .HashMap ;
@@ -13,8 +14,6 @@ public class QueueManager {
1314
1415 private final Map <PitPlayer , String > commands = new HashMap <>();
1516
16- private final int MIN_PLAYER_SIZE = 2 ;
17-
1817 public void checkQueue () {
1918 PluginMessageReceiver .sendServerPlayerCount ();
2019 if (servers .isEmpty ()) return ;
@@ -56,6 +55,7 @@ private void executeCommand(String serverName) {
5655 }
5756
5857 public int getNeededPlayer (String serverName ) {
58+ final int MIN_PLAYER_SIZE = TheJpsPit .getInstance ().getQueues ().getMinPlayers ().getOrDefault (serverName , 6 );
5959 if (servers .isEmpty ()) {
6060 return MIN_PLAYER_SIZE ;
6161 }
You can’t perform that action at this time.
0 commit comments