summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/configuration
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/configuration')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java19
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java47
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java6
3 files changed, 64 insertions, 8 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java
index 9fc7009..8a71903 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java
@@ -62,8 +62,12 @@ public class Config {
allowNaturalCauses,
saveInventory,
delayedRespawn,
+ dontRewardQuit,
spawnPatch,
dropItems,
+ respawnAsSpectator,
+ waitTillNoneLeft,
+ gameOverTitle,
regenHealth;
public static int
@@ -82,7 +86,9 @@ public class Config {
lobbyItemStartPosition,
flightToggleItemPosition,
teleportItemPosition,
- delayedRespawnDelay;
+ startingSeekerCount,
+ delayedRespawnDelay,
+ endGameDelay;
public static float
seekerPingLeadingVolume,
@@ -154,7 +160,9 @@ public class Config {
}
//Lobby
- minPlayers = Math.max(2, config.getInt("minPlayers"));
+ startingSeekerCount = Math.max(1, config.getInt("startingSeekerCount"));
+ waitTillNoneLeft = config.getBoolean("waitTillNoneLeft");
+ minPlayers = Math.max(1 + startingSeekerCount + (waitTillNoneLeft ? 0 : 1), config.getInt("minPlayers"));
countdown = Math.max(10, config.getInt("lobby.countdown"));
changeCountdown = Math.max(minPlayers, config.getInt("lobby.changeCountdown"));
lobbyMin = Math.max(minPlayers, config.getInt("lobby.min"));
@@ -188,6 +196,11 @@ public class Config {
placeholderError = config.getString("placeholder.incorrect");
placeholderNoData = config.getString("placeholder.noData");
saveInventory = config.getBoolean("saveInventory");
+ respawnAsSpectator = config.getBoolean("respawnAsSpectator");
+ dontRewardQuit = config.getBoolean("dontRewardQuit");
+ endGameDelay = Math.max(0,config.getInt("endGameDelay"));
+ gameOverTitle = config.getBoolean("gameOverTitle");
+
try {
countdownDisplay = CountdownDisplay.valueOf(config.getString("hideCountdownDisplay"));
} catch (IllegalArgumentException e) {
@@ -271,4 +284,4 @@ public class Config {
return temp;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java
index e5f970b..8b4cddc 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Items.java
@@ -16,6 +16,12 @@ import java.util.List;
public class Items {
public static List<ItemStack> HIDER_ITEMS, SEEKER_ITEMS;
+ public static ItemStack
+ HIDER_HELM, SEEKER_HELM,
+ HIDER_CHEST, SEEKER_CHEST,
+ HIDER_LEGS, SEEKER_LEGS,
+ HIDER_BOOTS, SEEKER_BOOTS;
+
public static List<PotionEffect> HIDER_EFFECTS, SEEKER_EFFECTS;
public static void loadItems() {
@@ -23,24 +29,60 @@ public class Items {
ConfigManager manager = ConfigManager.create("items.yml");
SEEKER_ITEMS = new ArrayList<>();
+ SEEKER_HELM = null;
+ SEEKER_CHEST = null;
+ SEEKER_LEGS = null;
+ SEEKER_BOOTS = null;
ConfigurationSection SeekerItems = manager.getConfigurationSection("items.seeker");
int i = 1;
while (true) {
ConfigurationSection section = SeekerItems.getConfigurationSection(String.valueOf(i));
if (section == null) break;
ItemStack item = createItem(section);
- if (item != null) SEEKER_ITEMS.add(item);
+ if (item == null) continue;
+ String loc = section.getString("location");
+ if (loc == null) {
+ SEEKER_ITEMS.add(item);
+ } else if (loc.equals("helmet")) {
+ SEEKER_HELM = item;
+ } else if (loc.equals("chestplate")) {
+ SEEKER_CHEST = item;
+ } else if (loc.equals("leggings")) {
+ SEEKER_LEGS = item;
+ } else if (loc.equals("boots")) {
+ SEEKER_BOOTS = item;
+ } else {
+ SEEKER_ITEMS.add(item);
+ }
i++;
}
HIDER_ITEMS = new ArrayList<>();
+ HIDER_HELM = null;
+ HIDER_CHEST = null;
+ HIDER_LEGS = null;
+ HIDER_BOOTS = null;
ConfigurationSection HiderItems = manager.getConfigurationSection("items.hider");
i = 1;
while (true) {
ConfigurationSection section = HiderItems.getConfigurationSection(String.valueOf(i));
if (section == null) break;
ItemStack item = createItem(section);
- if (item != null) HIDER_ITEMS.add(item);
+ if (item == null) continue;
+ String loc = section.getString("location");
+ if (loc == null) {
+ HIDER_ITEMS.add(item);
+ } else if (loc.equals("helmet")) {
+ HIDER_HELM = item;
+ } else if (loc.equals("chestplate")) {
+ HIDER_CHEST = item;
+ } else if (loc.equals("leggings")) {
+ HIDER_LEGS = item;
+ } else if (loc.equals("boots")) {
+ HIDER_BOOTS = item;
+ } else {
+ HIDER_ITEMS.add(item);
+ }
i++;
}
SEEKER_EFFECTS = new ArrayList<>();
@@ -64,7 +106,6 @@ public class Items {
if (effect != null) HIDER_EFFECTS.add(effect);
i++;
}
-
}
private static ItemStack createItem(ConfigurationSection item) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java
index b9f9b69..babf759 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java
@@ -15,12 +15,14 @@ public class Localization {
put("en-US", new String[][]{
{"WORLDBORDER_DECREASING"},
{"START","TAUNTED"},
- {"GAME_SETUP", "SETUP_GAME", "SETUP_LOBBY", "SETUP_SEEKER_LOBBY", "SETUP_EXIT", "SETUP_SAVEMAP", "SETUP_BOUNDS"}
+ {"GAME_SETUP", "SETUP_GAME", "SETUP_LOBBY", "SETUP_SEEKER_LOBBY", "SETUP_EXIT", "SETUP_SAVEMAP", "SETUP_BOUNDS"},
+ {"GAME_PLAYER_FOUND", "GAME_PLAYER_FOUND_BY"}
});
put("de-DE", new String[][]{
{},
{"TAUNTED"},
- {"GAME_SETUP", "SETUP_GAME", "SETUP_LOBBY", "SETUP_SEEKER_LOBBY", "SETUP_EXIT", "SETUP_SAVEMAP", "SETUP_BOUNDS"}
+ {"GAME_SETUP", "SETUP_GAME", "SETUP_LOBBY", "SETUP_SEEKER_LOBBY", "SETUP_EXIT", "SETUP_SAVEMAP", "SETUP_BOUNDS"},
+ {"GAME_PLAYER_FOUND", "GAME_PLAYER_FOUND_BY"}
});
}};