diff --git a/lib/ProtocolLib.jar b/lib/ProtocolLib.jar
deleted file mode 100644
index daa31c7..0000000
Binary files a/lib/ProtocolLib.jar and /dev/null differ
diff --git a/pom.xml b/pom.xml
index 974cdc8..8b2a39d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,10 +4,13 @@
1.7.0
Hide and Seek Plugin
+
+ UTF-8
+
+
clean install
src/main/java
-
org.apache.maven.plugins
@@ -30,10 +33,6 @@
com.zaxxer.hikari
net.tylermurphy.dependencies.hikari
-
- org.ibex.nestedvm
- net.tylermurphy.dependencies.nestedvm
-
@@ -58,7 +57,6 @@
META-INF/services/java.sql.Driver
- true
@@ -82,10 +80,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/public/
-
-
-
-
+
+ dmulloy2-repo
+ https://repo.dmulloy2.net/repository/public/
+
placeholderapi
https://repo.extendedclip.com/content/repositories/placeholderapi/
@@ -109,8 +107,8 @@
com.comphenix.protocol
ProtocolLib
4.4.0
- system
- ${project.basedir}/lib/ProtocolLib.jar
+
+
org.xerial
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java b/src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java
index dd73dac..c1316f8 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java
@@ -5,22 +5,13 @@ package net.tylermurphy.hideAndSeek.command.location;
*/
public enum Locations {
- GAME("spawns.game"),
- LOBBY("spawns.lobby"),
- EXIT("spawns.exit"),
- SEEKER("spawns.seeker");
-
- private final String path;
- Locations(String path) {
- this.path = path;
- }
+ GAME,
+ LOBBY,
+ EXIT,
+ SEEKER;
public String message() {
return this + "_SPAWN";
}
- public String path(String additive) {
- return path + "." + additive;
- }
-
}
\ No newline at end of file
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java b/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java
index e9ed90c..b366b9a 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java
@@ -70,7 +70,7 @@ public class CommandGroup {
if (data == null) {
player.sendMessage(
- String.format("%s%sKenshin's Hide and Seek %s(%s1.7.0 BETA%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY, ChatColor.WHITE, ChatColor.GRAY) +
+ String.format("%s%sKenshin's Hide and Seek %s(%s1.7.0%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY, ChatColor.WHITE, ChatColor.GRAY) +
String.format("%sAuthor: %s[KenshinEto]\n", ChatColor.GRAY, ChatColor.WHITE) +
String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE)
);
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/world/Create.java b/src/main/java/net/tylermurphy/hideAndSeek/command/world/Create.java
index 20ffd5a..e399993 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/world/Create.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/world/Create.java
@@ -3,10 +3,9 @@ package net.tylermurphy.hideAndSeek.command.world;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.util.Location;
-import org.bukkit.Bukkit;
+import org.bukkit.World;
import org.bukkit.WorldType;
import org.bukkit.entity.Player;
-import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
@@ -23,20 +22,35 @@ public class Create implements ICommand {
List worlds = Main.getInstance().getWorlds();
if(worlds.contains(args[0])) {
sender.sendMessage(errorPrefix + message("WORLD_EXISTS").addAmount(args[0]));
+ return;
}
WorldType type;
- if(args[1].equals("normal")) {
- type = WorldType.NORMAL;
- } else if(args[1].equals("flat")) {
- type = WorldType.FLAT;
- } else {
- sender.sendMessage(errorPrefix + message("INVALID_WORLD_TYPE").addAmount(args[1]));
- return;
+ World.Environment environment;
+ switch (args[1]) {
+ case "normal":
+ type = WorldType.NORMAL;
+ environment = World.Environment.NORMAL;
+ break;
+ case "flat":
+ type = WorldType.FLAT;
+ environment = World.Environment.NORMAL;
+ break;
+ case "nether":
+ type = WorldType.NORMAL;
+ environment = World.Environment.NETHER;
+ break;
+ case "end":
+ type = WorldType.NORMAL;
+ environment = World.Environment.THE_END;
+ break;
+ default:
+ sender.sendMessage(errorPrefix + message("INVALID_WORLD_TYPE").addAmount(args[1]));
+ return;
}
Location temp = new Location(args[0], 0, 0, 0);
- if (temp.load(type) == null) {
+ if (temp.load(type, environment) == null) {
sender.sendMessage(errorPrefix + message("WORLD_ADDED_FAILED"));
} else {
sender.sendMessage(messagePrefix + message("WORLD_ADDED").addAmount(args[0]));
@@ -61,7 +75,7 @@ public class Create implements ICommand {
return Collections.singletonList("name");
}
if(parameter.equals("type")) {
- return Arrays.asList("normal", "flat");
+ return Arrays.asList("normal", "flat", "nether", "end");
}
return null;
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/world/Delete.java b/src/main/java/net/tylermurphy/hideAndSeek/command/world/Delete.java
index 4800e08..985ccdc 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/world/Delete.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/world/Delete.java
@@ -22,12 +22,14 @@ public class Delete implements ICommand {
java.util.List worlds = Main.getInstance().getWorlds();
if(!worlds.contains(args[0])) {
sender.sendMessage(errorPrefix + message("WORLD_DOESNT_EXIST").addAmount(args[0]));
+ return;
}
Confirm.Confirmation confirmation = new Confirm.Confirmation(args[0], world -> {
java.util.List worlds_now = Main.getInstance().getWorlds();
if(!worlds_now.contains(world)) {
sender.sendMessage(errorPrefix + message("WORLD_DOESNT_EXIST").addAmount(world));
+ return;
}
World bukkit_world = Bukkit.getWorld(world);
if(bukkit_world != null && bukkit_world.getPlayers().size() > 0) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/world/List.java b/src/main/java/net/tylermurphy/hideAndSeek/command/world/List.java
index 2c0f745..bdb98e5 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/world/List.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/world/List.java
@@ -4,6 +4,7 @@ import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.ICommand;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
+import org.bukkit.World;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@@ -20,8 +21,18 @@ public class List implements ICommand {
} else {
StringBuilder response = new StringBuilder(messagePrefix + message("LIST_WORLDS"));
for (String world : worlds) {
- boolean loaded = Bukkit.getWorld(world) != null;
- response.append("\n ").append(world).append(": ").append(loaded ? ChatColor.GREEN + "LOADED" : ChatColor.YELLOW + "NOT LOADED").append(ChatColor.WHITE);
+ String status = ChatColor.GRAY + "NOT LOADED";
+ World bukkit_world = Bukkit.getWorld(world);
+ if(bukkit_world != null) {
+ if(bukkit_world.getEnvironment() == World.Environment.NETHER) {
+ status = ChatColor.RED + "NETHER";
+ } else if(bukkit_world.getEnvironment() == World.Environment.THE_END) {
+ status = ChatColor.YELLOW + "THE END";
+ } else {
+ status = ChatColor.GREEN + bukkit_world.getWorldType().toString();
+ }
+ }
+ response.append("\n ").append(world).append(": ").append(status).append(ChatColor.WHITE);
}
sender.sendMessage(response.toString());
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java
index be699ec..958d1ca 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java
@@ -126,6 +126,7 @@ public class ConfigManager {
return config.contains(path);
}
+ @SuppressWarnings("unused")
public double getDouble(String path) {
if (!config.contains(path)) {
return defaultConfig.getDouble(path);
@@ -190,10 +191,6 @@ public class ConfigManager {
config.set(path, defaultConfig.get(path));
}
- public void resetAll() {
- config = new YamlConfiguration();
- }
-
public void resetFile(String newDefaultFilename) {
this.defaultFilename = newDefaultFilename;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java
index 83fc2a6..1873fd4 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java
@@ -268,7 +268,7 @@ public class Board {
board.setLine(String.valueOf(i), line.replace("{TEAM}", value));
} else if (line.contains("{BORDER}")) {
if (!Main.getInstance().getGame().getCurrentMap().isWorldBorderEnabled()) continue;
- if (worldBorder == null || status == Status.STARTING) {
+ if (status == Status.STARTING) {
board.setLine(String.valueOf(i), line.replace("{BORDER}", BORDER_COUNTING.replace("{AMOUNT}", "0")));
} else if (!worldBorder.isRunning()) {
board.setLine(String.valueOf(i), line.replace("{BORDER}", BORDER_COUNTING.replaceFirst("\\{AMOUNT}", worldBorder.getDelay()/60+"").replaceFirst("\\{AMOUNT}", worldBorder.getDelay()%60+"")));
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java
index e238caf..e18a309 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java
@@ -97,13 +97,15 @@ public class Game {
}
public void start() {
+ Player seeker;
try {
int rand = (int) (Math.random() * board.getPlayers().size());
- Player seeker = board.getPlayers().get(rand);
- start(seeker);
+ seeker = board.getPlayers().get(rand);
} catch (Exception e){
Main.getInstance().getLogger().warning("Failed to select random seeker.");
+ return;
}
+ start(seeker);
}
public void start(Player seeker) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java
index 1e7ba69..d34cb11 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/PlayerHandler.java
@@ -2,7 +2,6 @@ package net.tylermurphy.hideAndSeek.game.listener;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.configuration.Items;
-import net.tylermurphy.hideAndSeek.game.Game;
import net.tylermurphy.hideAndSeek.game.util.Status;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java b/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java
index e769b05..10fa783 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java
@@ -51,7 +51,7 @@ public class Location {
this.z = location.getZ();
}
- public World load(WorldType type) {
+ public World load(WorldType type, World.Environment environment) {
boolean mapSave = world.startsWith("hs_");
World bukkitWorld = Bukkit.getWorld(world);
if(bukkitWorld != null) return bukkitWorld;
@@ -59,6 +59,9 @@ public class Location {
if(type != null) {
creator.type(type);
}
+ if(environment != null) {
+ creator.environment(environment);
+ }
if(mapSave) {
creator.generator(new VoidGenerator());
}
@@ -69,7 +72,7 @@ public class Location {
public World load() {
if(!exists()) return null;
if(!Main.getInstance().isLoaded()) return null;
- return load(null);
+ return load(null, null);
}
private org.bukkit.Location toBukkit() {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java b/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java
index 864397e..d14f617 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java
@@ -60,13 +60,15 @@ public class WorldLoader {
}
public void loadMap() {
- Bukkit.getServer().createWorld(new WorldCreator(map.getGameSpawnName()).generator(new VoidGenerator()));
- World world = Bukkit.getServer().getWorld(map.getGameSpawnName());
- if (world == null) {
- Main.getInstance().getLogger().severe("COULD NOT LOAD " + map.getGameSpawnName());
- return;
- }
- world.setAutoSave(false);
+ Main.getInstance().scheduleTask(() -> {
+ Bukkit.getServer().createWorld(new WorldCreator(map.getGameSpawnName()).generator(new VoidGenerator()));
+ World world = Bukkit.getServer().getWorld(map.getGameSpawnName());
+ if (world == null) {
+ Main.getInstance().getLogger().severe("COULD NOT LOAD " + map.getGameSpawnName());
+ return;
+ }
+ world.setAutoSave(false);
+ });
}
public void rollback() {