From 13e6b38aa97f59e5a432f2d88ea15738358df019 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 17 May 2022 19:26:00 -0400 Subject: [PATCH] mysql support, always glow, countdown_last, kill stat change, game board null fix --- pom.xml | 6 ++- .../tylermurphy/hideAndSeek/command/Top.java | 9 +++- .../tylermurphy/hideAndSeek/command/Wins.java | 20 ++++----- .../hideAndSeek/configuration/Config.java | 25 ++++++++++- .../configuration/ConfigManager.java | 4 ++ .../configuration/Localization.java | 24 ++++++++--- .../hideAndSeek/database/Database.java | 9 +++- .../database/connections/MySQLConnection.java | 16 +++---- .../tylermurphy/hideAndSeek/game/Board.java | 6 +-- .../tylermurphy/hideAndSeek/game/Game.java | 6 ++- .../hideAndSeek/game/events/Glow.java | 7 +++- .../game/listener/DamageHandler.java | 11 ++--- .../game/listener/JoinLeaveHandler.java | 4 +- .../hideAndSeek/util/PAPIExpansion.java | 37 ++++++++-------- src/main/resources/config.yml | 28 +++++++++++++ .../resources/lang/localization_de-DE.yml | 1 + .../resources/lang/localization_en-US.yml | 1 + src/test/java/MainTest.java | 42 ------------------- 18 files changed, 146 insertions(+), 110 deletions(-) delete mode 100644 src/test/java/MainTest.java diff --git a/pom.xml b/pom.xml index fff9f6c..b72260d 100644 --- a/pom.xml +++ b/pom.xml @@ -41,8 +41,10 @@ *:* META-INF/*.MF - META-INF/*.md - META-INF + META-INF/*.MD + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA sqlite-jdbc.properties diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java index caa751b..9b55c9f 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java @@ -22,6 +22,7 @@ package net.tylermurphy.hideAndSeek.command; import net.tylermurphy.hideAndSeek.Main; import net.tylermurphy.hideAndSeek.database.util.PlayerInfo; import org.bukkit.ChatColor; +import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import java.util.List; @@ -54,7 +55,13 @@ public class Top implements ICommand { return; } for(PlayerInfo info : infos) { - String name = Main.getInstance().getServer().getOfflinePlayer(info.getUniqueId()).getName(); + OfflinePlayer temp = Main.getInstance().getServer().getOfflinePlayer(info.getUniqueId()); + String name; + if(temp == null){ + name = Main.getInstance().getDatabase().getNameData().getName(info.getUniqueId()); + } else { + name = temp.getName(); + } ChatColor color; switch (i) { case 1: color = ChatColor.YELLOW; break; diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java index 8a0b6dc..491c9a4 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Wins.java @@ -37,23 +37,21 @@ public class Wins implements ICommand { UUID uuid; String name; if (args.length == 0) { - Player player = Main.getInstance().getServer().getPlayer(sender.getName()); - if (player == null) { - sender.sendMessage(errorPrefix + message("START_INVALID_NAME").addPlayer(sender.getName())); - return; - } - uuid = player.getUniqueId(); + uuid = sender.getUniqueId(); name = sender.getName(); } else { - try { - name = args[0]; + name = args[0]; + if(Main.getInstance().getServer().getOfflinePlayer(args[0]) == null){ + uuid = Main.getInstance().getDatabase().getNameData().getUUID(args[0]); + } else { uuid = Main.getInstance().getServer().getOfflinePlayer(args[0]).getUniqueId(); - } catch (Exception e) { - sender.sendMessage(errorPrefix + message("START_INVALID_NAME").addPlayer(args[0])); - return; } } + if(uuid == null){ + sender.sendMessage(errorPrefix + message("START_INVALID_NAME").addPlayer(args[0])); + return; + } PlayerInfo info = Main.getInstance().getDatabase().getGameData().getInfo(uuid); if (info == null) { sender.sendMessage(errorPrefix + message("NO_GAME_INFO")); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java index 03d7504..4aeac68 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Config.java @@ -55,7 +55,13 @@ public class Config { locale, leaveServer, placeholderError, - placeholderNoData; + placeholderNoData, + databaseType, + databaseHost, + databasePort, + databaseUser, + databasePass, + databaseName; public static Vector spawnPosition, @@ -71,6 +77,7 @@ public class Config { tauntEnabled, tauntCountdown, tauntLast, + alwaysGlow, glowEnabled, glowStackable, pvpEnabled, @@ -218,9 +225,10 @@ public class Config { tauntLast = config.getBoolean("taunt.whenLastPerson"); //Glow + alwaysGlow = config.getBoolean("alwaysGlow") && Main.getInstance().supports(9); glowLength = Math.max(1, config.getInt("glow.time")); glowStackable = config.getBoolean("glow.stackable"); - glowEnabled = config.getBoolean("glow.enabled") && Main.getInstance().supports(9); + glowEnabled = config.getBoolean("glow.enabled") && Main.getInstance().supports(9) && !alwaysGlow; if (glowEnabled) { glowPowerupItem = createItemStack("glow"); } @@ -314,6 +322,19 @@ public class Config { teleportItem = createItemStack("spectatorItems.teleport"); teleportItemPosition = config.getInt("spectatorItems.teleport.position"); + + //Database + databaseHost = config.getString("databaseHost"); + databasePort = config.getString("databasePort"); + databaseUser = config.getString("databaseUser"); + databasePass = config.getString("databasePass"); + databaseName = config.getString("databaseName"); + + databaseType = config.getString("databaseType").toUpperCase(); + if(!databaseType.equals("SQLITE") && !databaseType.equals("MYSQL")){ + Main.getInstance().getLogger().warning("databaseType: "+databaseType+" is not a valid configuration option!"); + databaseType = "SQLITE"; + } } public static void addToConfig(String path, Object value) { diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java index f02eaba..381a41c 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java @@ -205,6 +205,10 @@ public class ConfigManager { } } + public ConfigurationSection getDefaultConfigurationSection(String path) { + return defaultConfig.getConfigurationSection(path); + } + public void set(String path, Object value) { config.set(path, value); } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java index be60b61..9418414 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/Localization.java @@ -28,6 +28,7 @@ import java.util.Map; public class Localization { public static final Map LOCAL = new HashMap<>(); + public static final Map DEFAULT_LOCAL = new HashMap<>(); private static final Map CHANGES = new HashMap() {{ put("en-US", new String[][]{{"WORLDBORDER_DECREASING"},{"START","TAUNTED"}}); @@ -61,17 +62,28 @@ public class Localization { for(String key : manager.getConfigurationSection("Localization").getKeys(false)) { LOCAL.put( - key, + key, new LocalizationString( ChatColor.translateAlternateColorCodes('&', manager.getString("Localization."+key) ) ) - ); + ); + } + + for(String key : manager.getDefaultConfigurationSection("Localization").getKeys(false)) { + DEFAULT_LOCAL.put( + key, + new LocalizationString( ChatColor.translateAlternateColorCodes('&', manager.getString("Localization."+key) ) ) + ); } } public static LocalizationString message(String key) { - LocalizationString temp = LOCAL.get(key); - if (temp == null) { - return new LocalizationString(ChatColor.RED + "" + ChatColor.ITALIC + key + " is not found in localization.yml. This is a plugin issue, please report it."); + LocalizationString message = LOCAL.get(key); + if (message == null) { + LocalizationString defaultMessage = DEFAULT_LOCAL.get(key); + if(defaultMessage == null) { + return new LocalizationString(ChatColor.RED + "" + ChatColor.ITALIC + key + " is not found in localization.yml. This is a plugin issue, please report it."); + } + return new LocalizationString(defaultMessage.toString()); } - return new LocalizationString(temp.toString()); + return new LocalizationString(message.toString()); } } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java b/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java index 0eceb98..0489b5d 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/database/Database.java @@ -22,6 +22,7 @@ package net.tylermurphy.hideAndSeek.database; import com.google.common.io.ByteStreams; import net.tylermurphy.hideAndSeek.Main; import net.tylermurphy.hideAndSeek.database.connections.DatabaseConnection; +import net.tylermurphy.hideAndSeek.database.connections.MySQLConnection; import net.tylermurphy.hideAndSeek.database.connections.SQLiteConnection; import java.io.ByteArrayInputStream; @@ -32,6 +33,8 @@ import java.sql.Connection; import java.sql.SQLException; import java.util.UUID; +import static net.tylermurphy.hideAndSeek.configuration.Config.databaseType; + public class Database { private final GameDataTable playerInfo; @@ -40,7 +43,11 @@ public class Database { public Database(){ - connection = new SQLiteConnection(); + if(databaseType.equals("SQLITE")) { + connection = new SQLiteConnection(); + } else { + connection = new MySQLConnection(); + } playerInfo = new GameDataTable(this); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/database/connections/MySQLConnection.java b/src/main/java/net/tylermurphy/hideAndSeek/database/connections/MySQLConnection.java index c29d1b3..b7c1b1d 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/database/connections/MySQLConnection.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/database/connections/MySQLConnection.java @@ -25,26 +25,22 @@ import com.zaxxer.hikari.HikariDataSource; import java.sql.Connection; import java.sql.SQLException; +import static net.tylermurphy.hideAndSeek.configuration.Config.*; + public class MySQLConnection implements DatabaseConnection { - private final HikariConfig config; private final HikariDataSource ds; public MySQLConnection(){ - String host = "to be implemented"; - String port = "to be implemented"; - String user = "to be implemented"; - String pass = "to be implemented"; + HikariConfig config = new HikariConfig(); - config = new HikariConfig(); - - config.setJdbcUrl("jdbc:mariadb://"+host+":"+port+"/kenbot"); + config.setJdbcUrl("jdbc:mariadb://"+databaseHost+":"+databasePort+"/"+databaseName); config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); - config.addDataSourceProperty("user", user); - config.addDataSourceProperty("password",pass); + config.addDataSourceProperty("user", databaseUser); + config.addDataSourceProperty("password",databasePass); config.addDataSourceProperty("autoCommit", "true"); config.setAutoCommit(true); config.setMaximumPoolSize(20); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java index 04b0d37..a8e41c7 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Board.java @@ -153,7 +153,7 @@ public class Board { } else { hider_kills.put(uuid.toString(), 1); } - } else if (getFirstSeeker().getUniqueId().equals(uuid)) { + } else if (Seeker.contains(uuid.toString())) { if (seeker_kills.containsKey(uuid.toString())) { seeker_kills.put(uuid.toString(), seeker_kills.get(uuid.toString())+1); } else { @@ -169,7 +169,7 @@ public class Board { } else { hider_deaths.put(uuid.toString(), 1); } - } else if (getFirstSeeker().getUniqueId().equals(uuid)) { + } else if (Seeker.contains(uuid.toString())) { if (seeker_deaths.containsKey(uuid.toString())) { seeker_deaths.put(uuid.toString(), seeker_deaths.get(uuid.toString())+1); } else { @@ -234,7 +234,7 @@ public class Board { private void createGameBoard(Player player, boolean recreate) { CustomBoard board = customBoards.get(player.getUniqueId().toString()); - if (recreate) { + if (recreate || board == null) { board = new CustomBoard(player, GAME_TITLE); board.updateTeams(); } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java index c261b52..cb3ad1f 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java @@ -242,12 +242,14 @@ public class Game { private void whileStarting() { if(gameTick % 20 == 0) { - if (startingTimer % 5 == 0 || startingTimer < 4) { + if (startingTimer % 5 == 0 || startingTimer < 5) { String message; if (startingTimer == 0) { message = message("START").toString(); status = Status.PLAYING; board.getPlayers().forEach(player -> PlayerLoader.resetPlayer(player, board)); + } else if (startingTimer == 1){ + message = message("START_COUNTDOWN_LAST").addAmount(startingTimer).toString(); } else { message = message("START_COUNTDOWN").addAmount(startingTimer).toString(); } @@ -305,7 +307,7 @@ public class Game { } if (worldBorderEnabled) worldBorder.update(); if (tauntEnabled) taunt.update(); - if (glowEnabled) glow.update(); + if (glowEnabled || alwaysGlow) glow.update(); } board.getSpectators().forEach(spectator -> spectator.setFlying(spectator.getAllowFlight())); checkWinConditions(); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/events/Glow.java b/src/main/java/net/tylermurphy/hideAndSeek/game/events/Glow.java index a1d7295..8631ef5 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/events/Glow.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/events/Glow.java @@ -10,8 +10,7 @@ import org.bukkit.entity.Player; import java.lang.reflect.InvocationTargetException; -import static net.tylermurphy.hideAndSeek.configuration.Config.glowLength; -import static net.tylermurphy.hideAndSeek.configuration.Config.glowStackable; +import static net.tylermurphy.hideAndSeek.configuration.Config.*; public class Glow { @@ -37,6 +36,10 @@ public class Glow { } public void update() { + if(alwaysGlow){ + sendPackets(); + return; + } if (running) { sendPackets(); glowTime--; diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java index 701f446..3b90d39 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java @@ -96,21 +96,18 @@ public class DamageHandler implements Listener { // Broadcast player death message if (board.isSeeker(player)) { game.broadcastMessage(message("GAME_PLAYER_DEATH").addPlayer(player).toString()); - if (board.getFirstSeeker().getName().equals(player.getName())) { - board.addDeath(player.getUniqueId()); - } } else if (board.isHider(player)) { if (attacker == null) { game.broadcastMessage(message("GAME_PLAYER_FOUND").addPlayer(player).toString()); } else { game.broadcastMessage(message("GAME_PLAYER_FOUND_BY").addPlayer(player).addPlayer(attacker).toString()); } - board.addDeath(player.getUniqueId()); board.addSeeker(player); } - // Add leaderboard kills if attacker - if (attacker != null && ( board.isHider(attacker) || board.getFirstSeeker().getName().equals(attacker.getName()) ) ) - board.addKill(attacker.getUniqueId()); + // Add leaderboard stats + board.addDeath(player.getUniqueId()); + if (attacker != null) board.addKill(attacker.getUniqueId()); + //Reload player PlayerLoader.resetPlayer(player, board); board.reloadBoardTeams(); } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/JoinLeaveHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/JoinLeaveHandler.java index 094ff68..7ac4f85 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/JoinLeaveHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/JoinLeaveHandler.java @@ -23,8 +23,8 @@ public class JoinLeaveHandler implements Listener { @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerJoin(PlayerJoinEvent event) { - if(!Main.getInstance().getDatabase().getNameData().update(event.getPlayer().getUniqueId(), event.getPlayer().getDisplayName())){ - Main.getInstance().getLogger().warning("Failed to save name data for user: " + event.getPlayer().getDisplayName()); + if(!Main.getInstance().getDatabase().getNameData().update(event.getPlayer().getUniqueId(), event.getPlayer().getName())){ + Main.getInstance().getLogger().warning("Failed to save name data for user: " + event.getPlayer().getName()); } Main.getInstance().getBoard().remove(event.getPlayer()); removeItems(event.getPlayer()); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/PAPIExpansion.java b/src/main/java/net/tylermurphy/hideAndSeek/util/PAPIExpansion.java index 72d1f4d..7823fe9 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/PAPIExpansion.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/PAPIExpansion.java @@ -39,15 +39,17 @@ public class PAPIExpansion extends PlaceholderExpansion { Database database = Main.getInstance().getDatabase(); String[] args = params.split("_"); if (args.length < 1) return null; - if (args[0].equals("stats") && args.length == 2) { - PlayerInfo info = database.getGameData().getInfo(player.getUniqueId()); + if (args[0].equals("stats") && (args.length == 2 || args.length == 3)) { + PlayerInfo info = null; + if(args.length == 2) { + database.getGameData().getInfo(player.getUniqueId()); + } else { + UUID uuid; + try { uuid = Main.getInstance().getServer().getOfflinePlayer(args[2]).getUniqueId(); } catch (Exception e) { return placeholderError; } + info = database.getGameData().getInfo(uuid); + } if (info == null) return placeholderNoData; return getValue(info, args[1]); - } else if (args[0].equals("stats") && args.length == 3) { - UUID uuid; - try { uuid = Main.getInstance().getServer().getOfflinePlayer(args[2]).getUniqueId(); } catch (Exception e) { return placeholderError; } - PlayerInfo info = database.getGameData().getInfo(uuid); - return getValue(info, args[1]); } else if ((args[0].equals("rank-score") || args[0].equals("rank-name") ) && args.length == 3) { int place; try { place = Integer.parseInt(args[2]); } catch (NumberFormatException e) { return placeholderError; } @@ -60,24 +62,21 @@ public class PAPIExpansion extends PlaceholderExpansion { } else { return Main.getInstance().getServer().getOfflinePlayer(info.getUniqueId()).getName(); } - } else if (args[0].equals("rank-place") && args.length == 2) { + } else if (args[0].equals("rank-place") && (args.length == 2 || args.length == 3)) { if (getRanking(args[1]) == null) { return placeholderError; } - PlayerInfo info = database.getGameData().getInfo(player.getUniqueId()); + PlayerInfo info = null; + if(args.length == 2){ + database.getGameData().getInfo(player.getUniqueId()); + } else { + UUID uuid; + try { uuid = Main.getInstance().getServer().getOfflinePlayer(args[2]).getUniqueId(); } catch (Exception e) { return placeholderError; } + info = database.getGameData().getInfo(uuid); + } if (info == null) return placeholderNoData; if (getValue(info, args[1]).equals("0")) { return "-"; } Integer count = database.getGameData().getRanking(getRanking(args[1]), player.getUniqueId()); if (count == null) { return placeholderNoData; } return count.toString(); - } else if (args[0].equals("rank-place") && args.length == 3) { - UUID uuid; - try { uuid = Main.getInstance().getServer().getOfflinePlayer(args[2]).getUniqueId(); } catch (Exception e) { return placeholderError; } - if (getRanking(args[1]) == null) { return placeholderError; } - PlayerInfo info = database.getGameData().getInfo(player.getUniqueId()); - if (info == null) return placeholderNoData; - if (getValue(info, args[1]).equals("0")) { return "-"; } - Integer count = database.getGameData().getRanking(getRanking(args[1]), uuid); - if (count == null) { return placeholderNoData; } - return count.toString(); } return null; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 2d76b4a..6153c46 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -94,6 +94,26 @@ leaveServer: hub # default: true mapSaveEnabled: true +# How you want to store game data. If you are running a single server, sqlite is fine, as no setup is necessary. +# But if you want the data to go across multiple servers, you can switch it to mysql. +# WARNING: Data is not saved across databases. You have to migrate the data yourself! +# +# SQLITE - A single database.db file in the plugin folder, good for a single server. +# +# MYSQL - Uses a mysql server to store data, good for multi-server setups or large servers. +# +# default: SQLITE +databaseType: SQLITE + +# The following settings are used for MYSQL databases ONLY. If you are running SQLITE, these +# will be ignored. If you are running MYSQL, you need to provide the database host url, database +# host port (usually 3306), database username, and database password. +databaseHost: localhost +databasePort: 3306 +databaseUser: root +databasePass: +databaseName: hideandseek + # The world border closes every interval, which is evey [delay] in minutes. # Thw world border starts at [size], and decreases 100 blocks every interval. # x & z are the center location. [enabled] is whenever the border is enabled. @@ -132,6 +152,14 @@ glow: material: SNOWBALL model-data: 0 +# This has the same glow effect as the glow powerup in that all seekers positions get +# shown to hiders. But enabling this force disables the powerup, and instead always shows +# the seekers positions to the hiders. Good for small maps. Since the glow effect wasn't added +# until Minecraft 1.9, any server running 1.8 will have this disabled regardless of the +# options below. +# default: false +alwaysGlow: false + # The message prefixes displayed before messages. The message contents themselves # can be changed in localization.yml. prefix: diff --git a/src/main/resources/lang/localization_de-DE.yml b/src/main/resources/lang/localization_de-DE.yml index 84ada18..a1a6eea 100644 --- a/src/main/resources/lang/localization_de-DE.yml +++ b/src/main/resources/lang/localization_de-DE.yml @@ -56,6 +56,7 @@ Localization: START_MIN_PLAYERS: "Um das Spiel zu starten benötigst du mindestens {AMOUNT} Spieler." START_INVALID_NAME: "Ungültiger Spieler: {PLAYER}." START_COUNTDOWN: "Die Hider haben {AMOUNT} Sekunden Zeit sich zu verstecken!" + START_COUNTDOWN_LAST: "Die Hider haben {AMOUNT} Sekunde Zeit sich zu verstecken!" START: "Los, Seeker! Es ist Zeit, die Hider zu finden." STOP: "Das Spiel wurde gestoppt." HIDER_TEAM_NAME: "&6&lHIDER" diff --git a/src/main/resources/lang/localization_en-US.yml b/src/main/resources/lang/localization_en-US.yml index 07d547b..96ccf7a 100644 --- a/src/main/resources/lang/localization_en-US.yml +++ b/src/main/resources/lang/localization_en-US.yml @@ -57,6 +57,7 @@ Localization: START_MIN_PLAYERS: "You must have at least {AMOUNT} players to start." START_INVALID_NAME: "Invalid player: {PLAYER}." START_COUNTDOWN: "Hiders have {AMOUNT} seconds to hide!" + START_COUNTDOWN_LAST: "Hiders have {AMOUNT} second to hide!" START: "Attention SEEKERS, its time to find the hiders!" STOP: "Game has been force stopped." HIDER_TEAM_NAME: "&6&lHIDER" diff --git a/src/test/java/MainTest.java b/src/test/java/MainTest.java deleted file mode 100644 index 9997e04..0000000 --- a/src/test/java/MainTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of Kenshins Hide and Seek - * - * Copyright (c) 2022 Tyler Murphy. - * - * Kenshins Hide and Seek free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * he Free Software Foundation version 3. - * - * Kenshins Hide and Seek is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import net.tylermurphy.hideAndSeek.Main; -import org.junit.After; -import org.junit.Before; - -public class MainTest { - - private ServerMock server; - private Main plugin; - - @Before - public void setUp() { - server = MockBukkit.mock(); - plugin = MockBukkit.load(Main.class); - } - - @After - public void tearDown() { - MockBukkit.unmock(); - } - -}