Skip to content

Commit 6331fa2

Browse files
committed
queues.ymlから最低人数を変更できるように
1 parent 9e6eb8e commit 6331fa2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/main/java/com/github/elic0de/thejpspit/spigot/config/Queues.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
@YamlFile
1010
public 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
}

src/main/java/com/github/elic0de/thejpspit/spigot/queue/QueueManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.github.elic0de.thejpspit.spigot.queue;
22

3+
import com.github.elic0de.thejpspit.spigot.TheJpsPit;
34
import com.github.elic0de.thejpspit.spigot.network.PluginMessageReceiver;
45
import com.github.elic0de.thejpspit.spigot.player.PitPlayer;
56
import 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
}

0 commit comments

Comments
 (0)