diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Logger.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Logger.java
index cb53173c..e814c26e 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Logger.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Logger.java
@@ -18,6 +18,7 @@
package de.butzlabben.missilewars;
+import de.butzlabben.missilewars.configuration.Config;
import org.bukkit.Bukkit;
/**
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/MissileWars.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/MissileWars.java
index 5570cc4d..0c97fb0c 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/MissileWars.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/MissileWars.java
@@ -19,22 +19,24 @@
package de.butzlabben.missilewars;
import co.aikar.commands.PaperCommandManager;
-import de.butzlabben.missilewars.cmd.MWCommands;
-import de.butzlabben.missilewars.cmd.StatsCommands;
-import de.butzlabben.missilewars.cmd.UserCommands;
+import de.butzlabben.missilewars.commands.MWCommands;
+import de.butzlabben.missilewars.commands.StatsCommands;
+import de.butzlabben.missilewars.commands.UserCommands;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Messages;
import de.butzlabben.missilewars.game.Arenas;
import de.butzlabben.missilewars.game.GameManager;
+import de.butzlabben.missilewars.game.misc.MissileWarsPlaceholder;
+import de.butzlabben.missilewars.game.signs.CheckRunnable;
+import de.butzlabben.missilewars.game.signs.SignRepository;
+import de.butzlabben.missilewars.game.stats.StatsFetcher;
import de.butzlabben.missilewars.listener.PlayerListener;
import de.butzlabben.missilewars.listener.SignListener;
import de.butzlabben.missilewars.util.ConnectionHolder;
-import de.butzlabben.missilewars.util.MissileWarsPlaceholder;
import de.butzlabben.missilewars.util.MoneyUtil;
import de.butzlabben.missilewars.util.SetupUtil;
import de.butzlabben.missilewars.util.stats.PreFetcher;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.signs.CheckRunnable;
-import de.butzlabben.missilewars.wrapper.signs.SignRepository;
-import de.butzlabben.missilewars.wrapper.stats.StatsFetcher;
import lombok.Getter;
import org.apache.commons.io.FileUtils;
import org.bstats.bukkit.Metrics;
@@ -84,7 +86,7 @@ public void onEnable() {
deleteTempWorlds();
Config.load();
- MessageConfig.load();
+ Messages.load();
SetupUtil.checkMissiles();
new File(Config.getLobbiesFolder()).mkdirs();
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/MWCommands.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommands.java
similarity index 72%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/MWCommands.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommands.java
index 3cda7cad..0195761c 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/MWCommands.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/MWCommands.java
@@ -16,36 +16,31 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.cmd;
+package de.butzlabben.missilewars.commands;
import co.aikar.commands.BaseCommand;
-import co.aikar.commands.annotation.CommandAlias;
-import co.aikar.commands.annotation.CommandCompletion;
-import co.aikar.commands.annotation.CommandPermission;
-import co.aikar.commands.annotation.Default;
-import co.aikar.commands.annotation.Description;
-import co.aikar.commands.annotation.Subcommand;
-import co.aikar.commands.annotation.Syntax;
-import de.butzlabben.missilewars.Config;
+import co.aikar.commands.annotation.*;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Lobby;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Arenas;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.GameManager;
-import de.butzlabben.missilewars.game.GameState;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.abstracts.Lobby;
-import de.butzlabben.missilewars.wrapper.abstracts.MapChooseProcedure;
-import de.butzlabben.missilewars.wrapper.missile.Missile;
-import de.butzlabben.missilewars.wrapper.missile.MissileFacing;
+import de.butzlabben.missilewars.game.enums.GameState;
+import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
+import de.butzlabben.missilewars.game.missile.Missile;
+import de.butzlabben.missilewars.game.missile.MissileFacing;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
-import org.bukkit.Bukkit;
-import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
@CommandAlias("mw|missilewars")
public class MWCommands extends BaseCommand {
@@ -54,31 +49,31 @@ public class MWCommands extends BaseCommand {
@Description("Shows information about the MissileWars Plugin.")
public void mwCommand(CommandSender sender) {
- sender.sendMessage(MessageConfig.getPrefix() + "MissileWars v" + MissileWars.getInstance().version + " by Butzlabben");
+ sender.sendMessage(Messages.getPrefix() + "MissileWars v" + MissileWars.getInstance().version + " by Butzlabben");
if (sender.hasPermission("mw.quit"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw quit - Quit a game");
+ sender.sendMessage(Messages.getPrefix() + "/mw quit - Quit a game");
if (sender.hasPermission("mw.start"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw start - Starts the game");
+ sender.sendMessage(Messages.getPrefix() + "/mw start - Starts the game");
if (sender.hasPermission("mw.stop"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw stop - Stops the game");
+ sender.sendMessage(Messages.getPrefix() + "/mw stop - Stops the game");
if (sender.hasPermission("mw.restart"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw start - Restarts the game");
+ sender.sendMessage(Messages.getPrefix() + "/mw start - Restarts the game");
if (sender.hasPermission("mw.appendrestart"))
- sender.sendMessage(MessageConfig.getPrefix()
+ sender.sendMessage(Messages.getPrefix()
+ "/mw appendrestart - Appends a restart after the next game ends");
if (sender.hasPermission("mw.paste"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw paste - Pastes a missile");
+ sender.sendMessage(Messages.getPrefix() + "/mw paste - Pastes a missile");
if (sender.hasPermission("mw.reload"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw reload - Reloads configurations");
+ sender.sendMessage(Messages.getPrefix() + "/mw reload - Reloads configurations");
if (sender.hasPermission("mw.stats"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw stats - Shows stats");
+ sender.sendMessage(Messages.getPrefix() + "/mw stats - Shows stats");
if (sender.hasPermission("mw.stats.recommendations"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw stats recommendations - Shows recommendations");
+ sender.sendMessage(Messages.getPrefix() + "/mw stats recommendations - Shows recommendations");
if (sender.hasPermission("mw.stats.players"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw stats players - Shows player list");
+ sender.sendMessage(Messages.getPrefix() + "/mw stats players - Shows player list");
if (sender.hasPermission("mw.stats.list"))
- sender.sendMessage(MessageConfig.getPrefix() + "/mw stats list - Lists history of games");
+ sender.sendMessage(Messages.getPrefix() + "/mw stats list - Lists history of games");
}
@Subcommand("paste")
@@ -93,14 +88,14 @@ public void pasteCommand(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
String arguments = getAllNextArgumentsAsString(args, false);
Missile m = game.getArena().getMissileConfiguration().getMissileFromName(arguments.trim());
if (m == null) {
- player.sendMessage(MessageConfig.getPrefix() + "§cUnknown missile");
+ player.sendMessage(Messages.getPrefix() + "§cUnknown missile");
return;
}
MissileFacing mf = MissileFacing.getFacingPlayer(player, game.getArena().getMissileConfiguration());
@@ -119,19 +114,19 @@ public void startCommand(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
if (game.getState() != GameState.LOBBY) {
- player.sendMessage(MessageConfig.getPrefix() + "§cGame already started");
+ player.sendMessage(Messages.getPrefix() + "§cGame already started");
return;
}
if (game.isReady())
game.startGame();
else {
if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING && game.getArena() == null) {
- player.sendMessage(MessageConfig.getPrefix() + "§cGame cannot be started");
+ player.sendMessage(Messages.getPrefix() + "§cGame cannot be started");
} else {
Map.Entry mostVotes = null;
for (Map.Entry arena : game.getVotes().entrySet()) {
@@ -145,7 +140,7 @@ public void startCommand(CommandSender sender, String[] args) {
Optional arena = Arenas.getFromName(mostVotes.getKey());
if (arena.isEmpty()) throw new IllegalStateException("Voted arena is not present");
game.setArena(arena.get());
- player.sendMessage(MessageConfig.getPrefix() + "A map was elected. Use \"/mw start\" again to start the round");
+ player.sendMessage(Messages.getPrefix() + "A map was elected. Use \"/mw start\" again to start the round");
}
}
}
@@ -162,7 +157,7 @@ public void stopCommand(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
@@ -185,7 +180,7 @@ public void restartCommand(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
@@ -203,7 +198,7 @@ public void restartCommand(CommandSender sender, String[] args) {
public void appendRestartCommand(CommandSender sender, String[] args) {
GameManager.getInstance().getGames().values().forEach(Game::appendRestart);
- sender.sendMessage(MessageConfig.getMessage("restart_after_game"));
+ sender.sendMessage(Messages.getMessage("restart_after_game"));
}
@Subcommand("reload")
@@ -214,9 +209,9 @@ public void appendRestartCommand(CommandSender sender, String[] args) {
public void onReload(CommandSender sender, String[] args) {
Config.load();
- MessageConfig.load();
+ Messages.load();
Arenas.load();
- sender.sendMessage(MessageConfig.getPrefix() + "Reloaded configs");
+ sender.sendMessage(Messages.getPrefix() + "Reloaded configs");
}
@Subcommand("debug")
@@ -232,7 +227,7 @@ public void onDebug(CommandSender sender, String[] args) {
Logger.NORMAL.log("Printing state for arena " + game.getArena().getName() + ". Number: " + i);
Logger.NORMAL.log(game.toString());
}
- sender.sendMessage(MessageConfig.getPrefix() + "Printed debug message into the log file");
+ sender.sendMessage(Messages.getPrefix() + "Printed debug message into the log file");
}
@Subcommand("restartall")
@@ -242,17 +237,17 @@ public void onDebug(CommandSender sender, String[] args) {
@CommandPermission("mw.reload")
public void onRestartAll(CommandSender sender, String[] args) {
- sender.sendMessage(MessageConfig.getPrefix() + "§cWarning - Restarting all games. This may take a while");
+ sender.sendMessage(Messages.getPrefix() + "§cWarning - Restarting all games. This may take a while");
List arenaPropertiesList = GameManager.getInstance().getGames().values()
.stream().map(Game::getLobby).collect(Collectors.toList());
arenaPropertiesList.forEach(GameManager.getInstance()::restartGame);
- sender.sendMessage(MessageConfig.getPrefix() + "Reloaded configs");
+ sender.sendMessage(Messages.getPrefix() + "Reloaded configs");
}
private boolean senderIsPlayer(CommandSender sender) {
if (sender instanceof Player) return true;
- sender.sendMessage(MessageConfig.getPrefix() + "§cYou are not a player");
+ sender.sendMessage(Messages.getPrefix() + "§cYou are not a player");
return false;
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/StatsCommands.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/StatsCommands.java
similarity index 89%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/StatsCommands.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/StatsCommands.java
index a449f469..25c54fcb 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/StatsCommands.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/StatsCommands.java
@@ -16,12 +16,15 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.cmd;
+package de.butzlabben.missilewars.commands;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.*;
-import de.butzlabben.missilewars.Config;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.game.stats.PlayerStats;
+import de.butzlabben.missilewars.game.stats.SavedStats;
+import de.butzlabben.missilewars.game.stats.StatsFetcher;
import de.butzlabben.missilewars.inventory.CustomInv;
import de.butzlabben.missilewars.inventory.OrcItem;
import de.butzlabben.missilewars.inventory.pages.PageGUICreator;
@@ -29,9 +32,6 @@
import de.butzlabben.missilewars.util.stats.PreFetcher;
import de.butzlabben.missilewars.util.stats.StatsUtil;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.stats.PlayerStats;
-import de.butzlabben.missilewars.wrapper.stats.SavedStats;
-import de.butzlabben.missilewars.wrapper.stats.StatsFetcher;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -138,10 +138,10 @@ public void onRecommendations(CommandSender sender, String[] args) {
// TODO implement more features
if (recommendations.size() == 0) {
- player.sendMessage(MessageConfig.getPrefix() + "§aThere are currently no recommendations, everything seems fine :)");
+ player.sendMessage(Messages.getPrefix() + "§aThere are currently no recommendations, everything seems fine :)");
} else {
- player.sendMessage(MessageConfig.getPrefix() + "§7=====[ §eMissileWars recommendations §7]=====");
- recommendations.forEach(str -> player.sendMessage(MessageConfig.getPrefix() + str));
+ player.sendMessage(Messages.getPrefix() + "§7=====[ §eMissileWars recommendations §7]=====");
+ recommendations.forEach(str -> player.sendMessage(Messages.getPrefix() + str));
}
}
@@ -188,7 +188,7 @@ public void onList(CommandSender sender, String[] args) {
private StatsFetcher getFetcher(Player player, String[] args) {
if (!Config.isFightStatsEnabled()) {
- player.sendMessage(MessageConfig.getPrefix() + "§cFightStats are not enabled!");
+ player.sendMessage(Messages.getPrefix() + "§cFightStats are not enabled!");
return null;
}
Date from = new Date(0);
@@ -197,7 +197,7 @@ private StatsFetcher getFetcher(Player player, String[] args) {
try {
from = format.parse(args[0]);
} catch (ParseException e) {
- player.sendMessage(MessageConfig.getPrefix() + "§cPlease use the date format dd.MM.yyyy");
+ player.sendMessage(Messages.getPrefix() + "§cPlease use the date format dd.MM.yyyy");
return null;
}
if (args.length > 1) {
@@ -207,17 +207,17 @@ private StatsFetcher getFetcher(Player player, String[] args) {
StatsFetcher fetcher = new StatsFetcher(from, arena);
if (fetcher.getGameCount() < 10) {
- player.sendMessage(MessageConfig.getPrefix() + "Please play more than 10 games to enable fight stats");
+ player.sendMessage(Messages.getPrefix() + "Please play more than 10 games to enable fight stats");
return null;
}
- player.sendMessage(MessageConfig.getPrefix() + "Loading data...");
+ player.sendMessage(Messages.getPrefix() + "Loading data...");
return fetcher;
}
private boolean senderIsPlayer(CommandSender sender) {
if (sender instanceof Player) return true;
- sender.sendMessage(MessageConfig.getPrefix() + "§cYou are not a player");
+ sender.sendMessage(Messages.getPrefix() + "§cYou are not a player");
return false;
}
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/UserCommands.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/UserCommands.java
similarity index 65%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/UserCommands.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/UserCommands.java
index e957fa9c..ea4fa772 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/cmd/UserCommands.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/commands/UserCommands.java
@@ -16,30 +16,26 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.cmd;
+package de.butzlabben.missilewars.commands;
import co.aikar.commands.BaseCommand;
-import co.aikar.commands.annotation.CommandAlias;
-import co.aikar.commands.annotation.CommandCompletion;
-import co.aikar.commands.annotation.CommandPermission;
-import co.aikar.commands.annotation.Description;
-import co.aikar.commands.annotation.Subcommand;
-import co.aikar.commands.annotation.Syntax;
-import de.butzlabben.missilewars.Config;
-import de.butzlabben.missilewars.MessageConfig;
+import co.aikar.commands.annotation.*;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Arenas;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.GameManager;
-import de.butzlabben.missilewars.game.GameState;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.abstracts.MapChooseProcedure;
-import de.butzlabben.missilewars.wrapper.game.Team;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
-import java.util.Optional;
+import de.butzlabben.missilewars.game.Team;
+import de.butzlabben.missilewars.game.enums.GameState;
+import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
+import de.butzlabben.missilewars.player.MWPlayer;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
+import java.util.Optional;
+
@CommandAlias("mw|missilewars")
public class UserCommands extends BaseCommand {
@@ -55,17 +51,17 @@ public void changeCommand(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
if (game.getState() != GameState.LOBBY) {
- player.sendMessage(MessageConfig.getPrefix() + "§cThe game is not in the right state to change your team right now");
+ player.sendMessage(Messages.getPrefix() + "§cThe game is not in the right state to change your team right now");
return;
}
if (args.length != 1) {
- player.sendMessage(MessageConfig.getPrefix() + "§c/mw change <1|2>");
+ player.sendMessage(Messages.getPrefix() + "§c/mw change <1|2>");
return;
}
try {
@@ -76,16 +72,16 @@ public void changeCommand(CommandSender sender, String[] args) {
int toCount = to.getMembers().size() + 1;
int diff = toCount - otherCount;
if (diff > 1) {
- player.sendMessage(MessageConfig.getMessage("cannot_change_difference"));
+ player.sendMessage(Messages.getMessage("cannot_change_difference"));
return;
}
// Remove the player from the old team and add him to the new team
to.addMember(mwPlayer);
- player.sendMessage(MessageConfig.getMessage("team_changed").replace("%team%", to.getFullname()));
+ player.sendMessage(Messages.getMessage("team_changed").replace("%team%", to.getFullname()));
} catch (NumberFormatException exception) {
- player.sendMessage(MessageConfig.getPrefix() + "§c/mw change <1|2>");
+ player.sendMessage(Messages.getPrefix() + "§c/mw change <1|2>");
}
}
@@ -101,39 +97,39 @@ public void voteCommand(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
if (game.getState() != GameState.LOBBY) {
- player.sendMessage(MessageConfig.getPrefix() + "§cThe game is not in the right state to vote right now");
+ player.sendMessage(Messages.getPrefix() + "§cThe game is not in the right state to vote right now");
return;
}
if (game.getLobby().getMapChooseProcedure() != MapChooseProcedure.MAPVOTING) {
- player.sendMessage(MessageConfig.getPrefix() + "§cYou can't vote in this game");
+ player.sendMessage(Messages.getPrefix() + "§cYou can't vote in this game");
return;
}
if (game.getArena() != null) {
- player.sendMessage(MessageConfig.getPrefix() + "§cA map was already elected");
+ player.sendMessage(Messages.getPrefix() + "§cA map was already elected");
return;
}
if (args.length != 1) {
- player.sendMessage(MessageConfig.getPrefix() + "§c/mw vote ");
+ player.sendMessage(Messages.getPrefix() + "§c/mw vote ");
return;
}
String arenaName = args[0];
Optional arena = Arenas.getFromName(arenaName);
if (!game.getVotes().containsKey(arenaName) || arena.isEmpty()) {
- player.sendMessage(MessageConfig.getPrefix() + "§cNo map with this title was found");
+ player.sendMessage(Messages.getPrefix() + "§cNo map with this title was found");
return;
}
game.getVotes().put(arenaName, game.getVotes().get(arenaName) + 1);
- player.sendMessage(MessageConfig.getMessage("vote.success").replace("%map%", arena.get().getDisplayName()));
+ player.sendMessage(Messages.getMessage("vote.success").replace("%map%", arena.get().getDisplayName()));
}
@Subcommand("quit|leave")
@@ -149,12 +145,12 @@ public void onQuit(CommandSender sender, String[] args) {
Game game = GameManager.getInstance().getGame(player.getLocation());
if (game == null) {
- player.sendMessage(MessageConfig.getMessage("not_in_arena"));
+ player.sendMessage(Messages.getMessage("not_in_arena"));
return;
}
MWPlayer mwPlayer = game.getPlayer(player);
if (mwPlayer == null) {
- player.sendMessage(MessageConfig.getPrefix() + "§cYou are not a member in this arena. Something went wrong pretty badly :(");
+ player.sendMessage(Messages.getPrefix() + "§cYou are not a member in this arena. Something went wrong pretty badly :(");
return;
}
Location endSpawn = game.getLobby().getAfterGameSpawn();
@@ -162,13 +158,13 @@ public void onQuit(CommandSender sender, String[] args) {
endSpawn = Config.getFallbackSpawn();
}
player.teleport(endSpawn);
- player.sendMessage(MessageConfig.getMessage("game_quit"));
+ player.sendMessage(Messages.getMessage("game_quit"));
}
private boolean senderIsPlayer(CommandSender sender) {
if (sender instanceof Player) return true;
- sender.sendMessage(MessageConfig.getPrefix() + "§cYou are not a player");
+ sender.sendMessage(Messages.getPrefix() + "§cYou are not a player");
return false;
}
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Config.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Config.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/Config.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Config.java
index af2d9ad7..02724269 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Config.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Config.java
@@ -16,8 +16,10 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars;
+package de.butzlabben.missilewars.configuration;
+import de.butzlabben.missilewars.Logger;
+import de.butzlabben.missilewars.MissileWars;
import de.butzlabben.missilewars.game.GameManager;
import de.butzlabben.missilewars.util.SetupUtil;
import org.bukkit.Bukkit;
@@ -169,7 +171,7 @@ public static YamlConfiguration getConfig() {
return cfg;
}
- static boolean debug() {
+ public static boolean debug() {
return cfg.getBoolean("debug");
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Lobby.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Lobby.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Lobby.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Lobby.java
index d5f3696a..82ad52a6 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Lobby.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Lobby.java
@@ -16,17 +16,14 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts;
+package de.butzlabben.missilewars.configuration;
import com.google.gson.annotations.SerializedName;
import de.butzlabben.missilewars.Logger;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Arenas;
-import de.butzlabben.missilewars.wrapper.geometry.Area;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
+import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
+import de.butzlabben.missilewars.util.geometry.Area;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
@@ -35,6 +32,12 @@
import org.bukkit.Location;
import org.bukkit.World;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
@Getter
@ToString
@RequiredArgsConstructor
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/MessageConfig.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Messages.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/MessageConfig.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Messages.java
index c122f374..acb877be 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/MessageConfig.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/Messages.java
@@ -16,8 +16,9 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars;
+package de.butzlabben.missilewars.configuration;
+import de.butzlabben.missilewars.MissileWars;
import de.butzlabben.missilewars.util.SetupUtil;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -29,7 +30,7 @@
* @author Butzlabben
* @since 13.08.2018
*/
-public class MessageConfig {
+public class Messages {
private static final File DIR = MissileWars.getInstance().getDataFolder();
private static final File FILE = new File(DIR, "messages.yml");
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Arena.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/Arena.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Arena.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/Arena.java
index 029fd106..818d0a59 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Arena.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/Arena.java
@@ -16,12 +16,11 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
-import de.butzlabben.missilewars.wrapper.abstracts.arena.*;
-import de.butzlabben.missilewars.wrapper.geometry.FlatArea;
-import de.butzlabben.missilewars.wrapper.geometry.Plane;
+import de.butzlabben.missilewars.util.geometry.FlatArea;
+import de.butzlabben.missilewars.util.geometry.Plane;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/ArrowConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ArrowConfiguration.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/ArrowConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ArrowConfiguration.java
index 424a6fe0..0cedc5ee 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/ArrowConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ArrowConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/EquipmentIntervalConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/EquipmentIntervalConfiguration.java
similarity index 96%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/EquipmentIntervalConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/EquipmentIntervalConfiguration.java
index a0075f06..5f9e50c7 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/EquipmentIntervalConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/EquipmentIntervalConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/FallProtectionConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/FallProtectionConfiguration.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/FallProtectionConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/FallProtectionConfiguration.java
index ccaf7a27..dfda106c 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/FallProtectionConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/FallProtectionConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/FireballConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/FireballConfiguration.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/FireballConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/FireballConfiguration.java
index ffcd7e1a..7888bc76 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/FireballConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/FireballConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/GameRespawnConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/GameRespawnConfiguration.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/GameRespawnConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/GameRespawnConfiguration.java
index 26beb74a..559bfac8 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/GameRespawnConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/GameRespawnConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/GameSpawnConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/GameSpawnConfiguration.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/GameSpawnConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/GameSpawnConfiguration.java
index ffc92930..783e93c3 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/GameSpawnConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/GameSpawnConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/MissileConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/MissileConfiguration.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/MissileConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/MissileConfiguration.java
index 6c7d00fd..1ab5f640 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/MissileConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/MissileConfiguration.java
@@ -16,11 +16,11 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.wrapper.missile.Missile;
-import de.butzlabben.missilewars.wrapper.missile.MissileFacing;
+import de.butzlabben.missilewars.game.missile.Missile;
+import de.butzlabben.missilewars.game.missile.MissileFacing;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/MoneyConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/MoneyConfiguration.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/MoneyConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/MoneyConfiguration.java
index d3546474..1fb26091 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/MoneyConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/MoneyConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/ShieldConfiguration.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ShieldConfiguration.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/ShieldConfiguration.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ShieldConfiguration.java
index dde3f3cd..c32ab994 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/arena/ShieldConfiguration.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/configuration/arena/ShieldConfiguration.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts.arena;
+package de.butzlabben.missilewars.configuration.arena;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameEvent.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameEvent.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameEvent.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameEvent.java
index 3b652a47..aeeb509c 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameEvent.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameEvent.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.event;
+package de.butzlabben.missilewars.event;
import de.butzlabben.missilewars.game.Game;
import org.bukkit.event.Event;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameStartEvent.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameStartEvent.java
similarity index 96%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameStartEvent.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameStartEvent.java
index 90f4e84f..72aa0ddb 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameStartEvent.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameStartEvent.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.event;
+package de.butzlabben.missilewars.event;
import de.butzlabben.missilewars.game.Game;
import org.bukkit.event.HandlerList;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameStopEvent.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameStopEvent.java
similarity index 96%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameStopEvent.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameStopEvent.java
index cd03d605..6fa003c0 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/GameStopEvent.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/GameStopEvent.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.event;
+package de.butzlabben.missilewars.event;
import de.butzlabben.missilewars.game.Game;
import org.bukkit.event.HandlerList;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/PlayerArenaJoinEvent.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/PlayerArenaJoinEvent.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/PlayerArenaJoinEvent.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/PlayerArenaJoinEvent.java
index 8a56b736..d3308e53 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/PlayerArenaJoinEvent.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/PlayerArenaJoinEvent.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.event;
+package de.butzlabben.missilewars.event;
import de.butzlabben.missilewars.game.Game;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/PlayerArenaLeaveEvent.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/PlayerArenaLeaveEvent.java
similarity index 96%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/PlayerArenaLeaveEvent.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/PlayerArenaLeaveEvent.java
index 0a717121..4ff43ab5 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/event/PlayerArenaLeaveEvent.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/event/PlayerArenaLeaveEvent.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.event;
+package de.butzlabben.missilewars.event;
import de.butzlabben.missilewars.game.Game;
import lombok.Getter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Arenas.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Arenas.java
index a3620676..e6a9577c 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Arenas.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Arenas.java
@@ -18,12 +18,12 @@
package de.butzlabben.missilewars.game;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.util.SetupUtil;
import de.butzlabben.missilewars.util.serialization.Serializer;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
import lombok.Getter;
import org.bukkit.Bukkit;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java
index 391199de..b8db22d0 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Game.java
@@ -19,10 +19,25 @@
package de.butzlabben.missilewars.game;
import com.google.common.base.Preconditions;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Lobby;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.configuration.arena.Arena;
+import de.butzlabben.missilewars.event.GameStartEvent;
+import de.butzlabben.missilewars.event.GameStopEvent;
+import de.butzlabben.missilewars.game.enums.GameResult;
+import de.butzlabben.missilewars.game.enums.GameState;
+import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
+import de.butzlabben.missilewars.game.equipment.MissileGameEquipment;
+import de.butzlabben.missilewars.game.equipment.SpecialGameEquipment;
+import de.butzlabben.missilewars.game.misc.MotdManager;
+import de.butzlabben.missilewars.game.misc.ScoreboardManager;
+import de.butzlabben.missilewars.game.missile.Missile;
+import de.butzlabben.missilewars.game.missile.MissileFacing;
+import de.butzlabben.missilewars.game.signs.MWSign;
+import de.butzlabben.missilewars.game.stats.FightStats;
import de.butzlabben.missilewars.game.timer.EndTimer;
import de.butzlabben.missilewars.game.timer.GameTimer;
import de.butzlabben.missilewars.game.timer.LobbyTimer;
@@ -32,25 +47,10 @@
import de.butzlabben.missilewars.listener.game.GameBoundListener;
import de.butzlabben.missilewars.listener.game.GameListener;
import de.butzlabben.missilewars.listener.game.LobbyListener;
-import de.butzlabben.missilewars.util.MotdManager;
+import de.butzlabben.missilewars.player.MWPlayer;
import de.butzlabben.missilewars.util.PlayerDataProvider;
-import de.butzlabben.missilewars.util.ScoreboardManager;
import de.butzlabben.missilewars.util.serialization.Serializer;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.abstracts.GameWorld;
-import de.butzlabben.missilewars.wrapper.abstracts.Lobby;
-import de.butzlabben.missilewars.wrapper.abstracts.MapChooseProcedure;
-import de.butzlabben.missilewars.wrapper.event.GameStartEvent;
-import de.butzlabben.missilewars.wrapper.event.GameStopEvent;
-import de.butzlabben.missilewars.wrapper.game.MissileGameEquipment;
-import de.butzlabben.missilewars.wrapper.game.SpecialGameEquipment;
-import de.butzlabben.missilewars.wrapper.game.Team;
-import de.butzlabben.missilewars.wrapper.missile.Missile;
-import de.butzlabben.missilewars.wrapper.missile.MissileFacing;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
-import de.butzlabben.missilewars.wrapper.signs.MWSign;
-import de.butzlabben.missilewars.wrapper.stats.FightStats;
import lombok.Getter;
import lombok.ToString;
import org.bukkit.*;
@@ -322,7 +322,7 @@ public void playerJoinInGame(Player player, boolean isSpectatorJoin) {
Bukkit.getScheduler().runTaskLater(MissileWars.getInstance(), () -> teleportToArenaSpectatorSpawn(player), 2);
Bukkit.getScheduler().runTaskLater(MissileWars.getInstance(), () -> player.setGameMode(GameMode.SPECTATOR), 35);
- player.sendMessage(MessageConfig.getMessage("spectator"));
+ player.sendMessage(Messages.getMessage("spectator"));
player.setDisplayName("§7" + player.getName() + "§r");
} else {
@@ -332,9 +332,9 @@ public void playerJoinInGame(Player player, boolean isSpectatorJoin) {
Team team = getNextTeam();
team.addMember(mwPlayer);
- player.sendMessage(MessageConfig.getMessage("team_assigned").replace("%team%", team.getFullname()));
+ player.sendMessage(Messages.getMessage("team_assigned").replace("%team%", team.getFullname()));
- broadcast(MessageConfig.getMessage("lobby_joined")
+ broadcast(Messages.getMessage("lobby_joined")
.replace("%max_players%", Integer.toString(getLobby().getMaxSize()))
.replace("%players%", Integer.toString(getPlayers().values().size()))
.replace("%player%", player.getName()));
@@ -374,7 +374,7 @@ public void playerLeaveFromGame(MWPlayer mwPlayer) {
if (task != null) task.cancel();
if (team != null) {
- broadcast(MessageConfig.getMessage("player_left")
+ broadcast(Messages.getMessage("player_left")
.replace("%team%", team.getFullname())
.replace("%player%", player.getName()));
}
@@ -411,7 +411,7 @@ private void checkTeamSize(Team team) {
sendGameResult();
stopGame();
});
- broadcast(MessageConfig.getMessage("team_offline").replace("%team%", team.getFullname()));
+ broadcast(Messages.getMessage("team_offline").replace("%team%", team.getFullname()));
}
}
@@ -618,14 +618,14 @@ public void spawnMissile(Player player, ItemStack itemStack) {
boolean isOnlyBetweenSpawnPlaceable = this.arena.getMissileConfiguration().isOnlyBetweenSpawnPlaceable();
if (isOnlyBetweenSpawnPlaceable) {
if (!this.arena.isInBetween(player.getLocation().toVector(), this.arena.getPlane1(), this.arena.getPlane2())) {
- player.sendMessage(MessageConfig.getMessage("missile_place_deny"));
+ player.sendMessage(Messages.getMessage("missile_place_deny"));
return;
}
}
Missile missile = this.arena.getMissileConfiguration().getMissileFromName(itemStack.getItemMeta().getDisplayName());
if (missile == null) {
- player.sendMessage(MessageConfig.getMessage("invalid_missile"));
+ player.sendMessage(Messages.getMessage("invalid_missile"));
return;
}
itemStack.setAmount(itemStack.getAmount() - 1);
@@ -682,7 +682,7 @@ public void setArena(Arena arena) {
}
if (lobby.getMapChooseProcedure() == MapChooseProcedure.MAPVOTING) {
- this.broadcast(MessageConfig.getMessage("vote.finished").replace("%map%", this.arena.getDisplayName()));
+ this.broadcast(Messages.getMessage("vote.finished").replace("%map%", this.arena.getDisplayName()));
}
applyForAllPlayers(player -> player.getInventory().setItem(4, new ItemStack(Material.AIR)));
@@ -739,16 +739,16 @@ public void sendNeutralGameResultTitle(Player player) {
String subTitle;
if (team1.getGameResult() == GameResult.WIN) {
- title = MessageConfig.getNativeMessage("game_result.title_won").replace("%team%", team1.getName());
- subTitle = MessageConfig.getNativeMessage("game_result.subtitle_won");
+ title = Messages.getNativeMessage("game_result.title_won").replace("%team%", team1.getName());
+ subTitle = Messages.getNativeMessage("game_result.subtitle_won");
} else if (team2.getGameResult() == GameResult.WIN) {
- title = MessageConfig.getNativeMessage("game_result.title_won").replace("%team%", team2.getName());
- subTitle = MessageConfig.getNativeMessage("game_result.subtitle_won");
+ title = Messages.getNativeMessage("game_result.title_won").replace("%team%", team2.getName());
+ subTitle = Messages.getNativeMessage("game_result.subtitle_won");
} else {
- title = MessageConfig.getNativeMessage("game_result.title_draw");
- subTitle = MessageConfig.getNativeMessage("game_result.subtitle_draw");
+ title = Messages.getNativeMessage("game_result.title_draw");
+ subTitle = Messages.getNativeMessage("game_result.subtitle_draw");
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameManager.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameManager.java
index 200a1ead..48c257f9 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameManager.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameManager.java
@@ -18,11 +18,11 @@
package de.butzlabben.missilewars.game;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Lobby;
import de.butzlabben.missilewars.util.serialization.Serializer;
-import de.butzlabben.missilewars.wrapper.abstracts.Lobby;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.Location;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/GameWorld.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameWorld.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/GameWorld.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameWorld.java
index 5e3e273c..ad4245fc 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/GameWorld.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameWorld.java
@@ -16,12 +16,12 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts;
+package de.butzlabben.missilewars.game;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
-import de.butzlabben.missilewars.game.Game;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Lobby;
+import de.butzlabben.missilewars.configuration.Messages;
import lombok.Getter;
import lombok.ToString;
import org.apache.commons.io.FileUtils;
@@ -65,7 +65,7 @@ public void kickInactivity() {
synchronized (lock) {
Bukkit.getOnlinePlayers().forEach(p -> {
if (p.isDead() && p.getWorld().getName().equals(worldName)) {
- p.kickPlayer(MessageConfig.getMessage("kick_inactivity"));
+ p.kickPlayer(Messages.getMessage("kick_inactivity"));
}
});
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/Team.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Team.java
similarity index 87%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/Team.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Team.java
index 6a0e09b3..78a0b987 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/Team.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/Team.java
@@ -16,16 +16,15 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.game;
+package de.butzlabben.missilewars.game;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
-import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.GameResult;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.game.enums.GameResult;
+import de.butzlabben.missilewars.player.MWPlayer;
import de.butzlabben.missilewars.util.MoneyUtil;
import de.butzlabben.missilewars.util.version.ColorConverter;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
@@ -187,16 +186,16 @@ public void sendGameResultTitle(MWPlayer missileWarsPlayer) {
switch (gameResult) {
case WIN:
- title = MessageConfig.getNativeMessage("game_result.title_winner");
- subTitle = MessageConfig.getNativeMessage("game_result.subtitle_winner");
+ title = Messages.getNativeMessage("game_result.title_winner");
+ subTitle = Messages.getNativeMessage("game_result.subtitle_winner");
break;
case LOSE:
- title = MessageConfig.getNativeMessage("game_result.title_loser");
- subTitle = MessageConfig.getNativeMessage("game_result.subtitle_loser");
+ title = Messages.getNativeMessage("game_result.title_loser");
+ subTitle = Messages.getNativeMessage("game_result.subtitle_loser");
break;
case DRAW:
- title = MessageConfig.getNativeMessage("game_result.title_draw");
- subTitle = MessageConfig.getNativeMessage("game_result.subtitle_draw");
+ title = Messages.getNativeMessage("game_result.title_draw");
+ subTitle = Messages.getNativeMessage("game_result.subtitle_draw");
break;
default:
title = null;
@@ -229,10 +228,10 @@ public void sendGameResultSound(MWPlayer missileWarsPlayer) {
// TODO Add new team buffer
public void updateIntervals(int newInterval) {
if (newInterval < currentInterval && currentInterval != 0) {
- getGame().broadcast(MessageConfig.getMessage("team_buffed").replace("%team%", getFullname()));
+ getGame().broadcast(Messages.getMessage("team_buffed").replace("%team%", getFullname()));
}
if (newInterval > currentInterval && currentInterval != 0) {
- getGame().broadcast(MessageConfig.getMessage("team_nerved").replace("%team%", getFullname()));
+ getGame().broadcast(Messages.getMessage("team_nerved").replace("%team%", getFullname()));
}
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameResult.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/GameResult.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameResult.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/GameResult.java
index 14dbafa0..cb3ae67b 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameResult.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/GameResult.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.game;
+package de.butzlabben.missilewars.game.enums;
/**
* @author Butzlabben
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameState.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/GameState.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameState.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/GameState.java
index da4bced9..5e93b39e 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/GameState.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/GameState.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.game;
+package de.butzlabben.missilewars.game.enums;
/**
* @author Butzlabben
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/MapChooseProcedure.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/MapChooseProcedure.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/MapChooseProcedure.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/MapChooseProcedure.java
index 94dd3ab7..343e4650 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/MapChooseProcedure.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/enums/MapChooseProcedure.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.abstracts;
+package de.butzlabben.missilewars.game.enums;
/**
* @author Butzlabben
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/MissileGameEquipment.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/MissileGameEquipment.java
similarity index 94%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/MissileGameEquipment.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/MissileGameEquipment.java
index 1d86f9dd..042065b6 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/MissileGameEquipment.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/MissileGameEquipment.java
@@ -16,10 +16,10 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.game;
+package de.butzlabben.missilewars.game.equipment;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.wrapper.missile.Missile;
+import de.butzlabben.missilewars.game.missile.Missile;
import lombok.Getter;
import java.util.ArrayList;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerEquipmentRandomizer.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/PlayerEquipmentRandomizer.java
similarity index 96%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerEquipmentRandomizer.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/PlayerEquipmentRandomizer.java
index 4b3187e0..e4e85e49 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerEquipmentRandomizer.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/PlayerEquipmentRandomizer.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.util;
+package de.butzlabben.missilewars.game.equipment;
import de.butzlabben.missilewars.Logger;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.missile.Missile;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
+import de.butzlabben.missilewars.game.missile.Missile;
+import de.butzlabben.missilewars.player.MWPlayer;
import org.bukkit.inventory.ItemStack;
import java.util.Random;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/SpecialGameEquipment.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/SpecialGameEquipment.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/SpecialGameEquipment.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/SpecialGameEquipment.java
index f6a3798d..3194e0d0 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/SpecialGameEquipment.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/equipment/SpecialGameEquipment.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.game;
+package de.butzlabben.missilewars.game.equipment;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.util.version.VersionUtil;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MissileWarsPlaceholder.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MissileWarsPlaceholder.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MissileWarsPlaceholder.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MissileWarsPlaceholder.java
index 32255a47..a0448b88 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MissileWarsPlaceholder.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MissileWarsPlaceholder.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.util;
+package de.butzlabben.missilewars.game.misc;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Lobby;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.GameManager;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.abstracts.Lobby;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MotdManager.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MotdManager.java
similarity index 92%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MotdManager.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MotdManager.java
index 9e42083a..6c4a1241 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MotdManager.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/MotdManager.java
@@ -16,11 +16,11 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.util;
+package de.butzlabben.missilewars.game.misc;
-import de.butzlabben.missilewars.Config;
+import de.butzlabben.missilewars.configuration.Config;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.GameState;
+import de.butzlabben.missilewars.game.enums.GameState;
import org.bukkit.ChatColor;
public class MotdManager {
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/RespawnGoldBlock.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/RespawnGoldBlock.java
similarity index 92%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/RespawnGoldBlock.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/RespawnGoldBlock.java
index 01f7915b..a4a0f07e 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/RespawnGoldBlock.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/RespawnGoldBlock.java
@@ -16,17 +16,14 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.game;
+package de.butzlabben.missilewars.game.misc;
-import de.butzlabben.missilewars.MessageConfig;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Messages;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.GameState;
+import de.butzlabben.missilewars.game.enums.GameState;
import de.butzlabben.missilewars.util.version.BlockSetterProvider;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
@@ -38,6 +35,10 @@
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerToggleSneakEvent;
+import java.util.AbstractMap;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author Butzlabben
* @since 14.01.2018
@@ -126,7 +127,7 @@ public void stop() {
BlockSetterProvider.getBlockDataSetter().setData(loc.getBlock(), map.get(loc).getValue());
}
map.clear();
- player.sendMessage(MessageConfig.getMessage("fall_protection_inactive"));
+ player.sendMessage(Messages.getMessage("fall_protection_inactive"));
Bukkit.getScheduler().cancelTask(task);
HandlerList.unregisterAll(this);
}
@@ -138,7 +139,7 @@ public void stop() {
private void sendFallProtectionMessage() {
double seconds = (double) duration / 20;
if ((seconds == Math.floor(seconds)) && !Double.isInfinite(seconds)) {
- player.sendMessage(MessageConfig.getMessage("fall_protection").replace("%seconds%", "" + (int) seconds));
+ player.sendMessage(Messages.getMessage("fall_protection").replace("%seconds%", "" + (int) seconds));
}
}
@@ -153,7 +154,7 @@ public void onSneak(PlayerToggleSneakEvent e) {
map.clear();
Bukkit.getScheduler().cancelTask(task);
HandlerList.unregisterAll(this);
- p.sendMessage(MessageConfig.getMessage("fall_protection_deactivated"));
+ p.sendMessage(Messages.getMessage("fall_protection_deactivated"));
}
}
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ScoreboardManager.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/ScoreboardManager.java
similarity index 96%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ScoreboardManager.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/ScoreboardManager.java
index 41ef3dc7..0d7b077d 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ScoreboardManager.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/ScoreboardManager.java
@@ -16,14 +16,14 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.util;
+package de.butzlabben.missilewars.game.misc;
-import de.butzlabben.missilewars.Config;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.GameState;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.game.Team;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
+import de.butzlabben.missilewars.game.Team;
+import de.butzlabben.missilewars.game.enums.GameState;
+import de.butzlabben.missilewars.player.MWPlayer;
import lombok.RequiredArgsConstructor;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/Shield.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/Shield.java
similarity index 93%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/Shield.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/Shield.java
index b73d7df8..22c88867 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/game/Shield.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/misc/Shield.java
@@ -16,12 +16,12 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.game;
+package de.butzlabben.missilewars.game.misc;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.arena.ShieldConfiguration;
+import de.butzlabben.missilewars.game.missile.paste.PasteProvider;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.abstracts.arena.ShieldConfiguration;
-import de.butzlabben.missilewars.wrapper.missile.paste.PasteProvider;
import lombok.RequiredArgsConstructor;
import org.bukkit.Bukkit;
import org.bukkit.Location;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/Missile.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/Missile.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/Missile.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/Missile.java
index 9b16a7b5..60c26834 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/Missile.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/Missile.java
@@ -16,14 +16,14 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile;
+package de.butzlabben.missilewars.game.missile;
import com.google.gson.annotations.SerializedName;
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
import de.butzlabben.missilewars.game.Game;
+import de.butzlabben.missilewars.game.missile.paste.PasteProvider;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.missile.paste.PasteProvider;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.bukkit.Location;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/MissileFacing.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/MissileFacing.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/MissileFacing.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/MissileFacing.java
index 661852cb..6f2b1b90 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/MissileFacing.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/MissileFacing.java
@@ -16,15 +16,16 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile;
+package de.butzlabben.missilewars.game.missile;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.wrapper.abstracts.arena.MissileConfiguration;
-import de.butzlabben.missilewars.wrapper.player.Interval;
+import de.butzlabben.missilewars.configuration.arena.MissileConfiguration;
+import de.butzlabben.missilewars.util.missile.Interval;
+import org.bukkit.entity.Player;
+
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
-import org.bukkit.entity.Player;
/**
* @author Butzlabben
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/PasteProvider.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/PasteProvider.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/PasteProvider.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/PasteProvider.java
index 96853ee1..9aa7338b 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/PasteProvider.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/PasteProvider.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile.paste;
+package de.butzlabben.missilewars.game.missile.paste;
import de.butzlabben.missilewars.Logger;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/Paster.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/Paster.java
similarity index 90%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/Paster.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/Paster.java
index 5ec94fed..a95de2d9 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/Paster.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/Paster.java
@@ -16,12 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile.paste;
+package de.butzlabben.missilewars.game.missile.paste;
-import de.butzlabben.missilewars.wrapper.game.Team;
-import java.io.File;
+import de.butzlabben.missilewars.game.Team;
import org.bukkit.util.Vector;
+import java.io.File;
+
/**
* @author Butzlabben
* @since 23.09.2018
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_12PasteProvider.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_12PasteProvider.java
similarity index 91%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_12PasteProvider.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_12PasteProvider.java
index 263bd0e9..7181a7a7 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_12PasteProvider.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_12PasteProvider.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile.paste;
+package de.butzlabben.missilewars.game.missile.paste;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.game.Team;
import de.butzlabben.missilewars.missile.paste.r1_12.R1_12Paster;
import de.butzlabben.missilewars.util.version.ColorConverter;
-import de.butzlabben.missilewars.wrapper.game.Team;
import org.bukkit.World;
import org.bukkit.util.Vector;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_13FawePasteProvider.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_13FawePasteProvider.java
similarity index 91%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_13FawePasteProvider.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_13FawePasteProvider.java
index 17261fd7..e64511c3 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_13FawePasteProvider.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_13FawePasteProvider.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile.paste;
+package de.butzlabben.missilewars.game.missile.paste;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.game.Team;
import de.butzlabben.missilewars.missile.paste.r1_13.fawe.R1_13Paster;
import de.butzlabben.missilewars.util.version.ColorConverter;
-import de.butzlabben.missilewars.wrapper.game.Team;
import org.bukkit.World;
import org.bukkit.util.Vector;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_13WEPasteProvider.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_13WEPasteProvider.java
similarity index 91%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_13WEPasteProvider.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_13WEPasteProvider.java
index 18540cf9..42d71951 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_13WEPasteProvider.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_13WEPasteProvider.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile.paste;
+package de.butzlabben.missilewars.game.missile.paste;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.game.Team;
import de.butzlabben.missilewars.missile.paste.r1_13.we.R1_13Paster;
import de.butzlabben.missilewars.util.version.ColorConverter;
-import de.butzlabben.missilewars.wrapper.game.Team;
import org.bukkit.World;
import org.bukkit.util.Vector;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_16FawePasteProvider.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_16FawePasteProvider.java
similarity index 91%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_16FawePasteProvider.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_16FawePasteProvider.java
index 75393135..1b6ea4e8 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/missile/paste/R1_16FawePasteProvider.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/missile/paste/R1_16FawePasteProvider.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.missile.paste;
+package de.butzlabben.missilewars.game.missile.paste;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.game.Team;
import de.butzlabben.missilewars.missile.paste.r1_16.fawe.R1_16Paster;
import de.butzlabben.missilewars.util.version.ColorConverter;
-import de.butzlabben.missilewars.wrapper.game.Team;
import org.bukkit.World;
import org.bukkit.util.Vector;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/CheckRunnable.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/CheckRunnable.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/CheckRunnable.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/CheckRunnable.java
index a5dd01fa..1f8c8c89 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/CheckRunnable.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/CheckRunnable.java
@@ -16,9 +16,10 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.signs;
+package de.butzlabben.missilewars.game.signs;
import de.butzlabben.missilewars.MissileWars;
+
import java.util.List;
public class CheckRunnable implements Runnable {
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/MWSign.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/MWSign.java
similarity index 88%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/MWSign.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/MWSign.java
index ac2aefe1..d47f0169 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/MWSign.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/MWSign.java
@@ -16,16 +16,14 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.signs;
+package de.butzlabben.missilewars.game.signs;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Messages;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.GameManager;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import java.util.ArrayList;
-import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -34,6 +32,9 @@
import org.bukkit.block.Block;
import org.bukkit.block.Sign;
+import java.util.ArrayList;
+import java.util.List;
+
@Data
@AllArgsConstructor
@EqualsAndHashCode(of = "location")
@@ -61,7 +62,7 @@ public void update() {
Game game = GameManager.getInstance().getGame(getLobby());
List lines = new ArrayList<>();
for (int i = 0; i < 4; i++) {
- lines.add(replace(MessageConfig.getNativeMessage("sign." + i), game));
+ lines.add(replace(Messages.getNativeMessage("sign." + i), game));
}
if (game == null) {
Logger.WARN.log("Could not find specifed arena \"" + getLobby() + "\" for sign at: " + getLocation().toString());
@@ -84,20 +85,20 @@ public void editSign(Location location, List lines) {
}
private String replace(String line, Game game) {
- String state = MessageConfig.getNativeMessage("sign.state.error");
+ String state = Messages.getNativeMessage("sign.state.error");
String name = "No game";
if (game != null) {
switch (game.getState()) {
case LOBBY:
- state = MessageConfig.getNativeMessage("sign.state.lobby");
+ state = Messages.getNativeMessage("sign.state.lobby");
name = game.getLobby().getDisplayName();
break;
case INGAME:
- state = MessageConfig.getNativeMessage("sign.state.ingame");
+ state = Messages.getNativeMessage("sign.state.ingame");
name = game.getArena().getDisplayName();
break;
case END:
- state = MessageConfig.getNativeMessage("sign.state.ended");
+ state = Messages.getNativeMessage("sign.state.ended");
name = game.getArena().getDisplayName();
break;
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/SignRepository.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/SignRepository.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/SignRepository.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/SignRepository.java
index b8e39655..82f8dde8 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/signs/SignRepository.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/signs/SignRepository.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.signs;
+package de.butzlabben.missilewars.game.signs;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/FightStats.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/FightStats.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/FightStats.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/FightStats.java
index 870ba864..1e1a1265 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/FightStats.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/FightStats.java
@@ -16,13 +16,13 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.stats;
+package de.butzlabben.missilewars.game.stats;
-import de.butzlabben.missilewars.Config;
+import de.butzlabben.missilewars.configuration.Config;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.GameResult;
+import de.butzlabben.missilewars.game.enums.GameResult;
+import de.butzlabben.missilewars.player.MWPlayer;
import de.butzlabben.missilewars.util.ConnectionHolder;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
import lombok.RequiredArgsConstructor;
import java.sql.PreparedStatement;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/PlayerStats.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/PlayerStats.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/PlayerStats.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/PlayerStats.java
index c948bc98..d6700a06 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/PlayerStats.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/PlayerStats.java
@@ -16,14 +16,15 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.stats;
+package de.butzlabben.missilewars.game.stats;
-import java.util.UUID;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
+import java.util.UUID;
+
@RequiredArgsConstructor
@Getter
@ToString(of = {"name", "uuid"})
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/PlayerStatsComparator.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/PlayerStatsComparator.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/PlayerStatsComparator.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/PlayerStatsComparator.java
index 01f4b3c8..e424cf4d 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/PlayerStatsComparator.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/PlayerStatsComparator.java
@@ -16,11 +16,12 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.stats;
+package de.butzlabben.missilewars.game.stats;
-import java.util.Comparator;
import lombok.AllArgsConstructor;
+import java.util.Comparator;
+
@AllArgsConstructor
public class PlayerStatsComparator implements Comparator {
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/SavedStats.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/SavedStats.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/SavedStats.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/SavedStats.java
index 9cd9ad46..cb79376e 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/SavedStats.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/SavedStats.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.stats;
+package de.butzlabben.missilewars.game.stats;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/StatsFetcher.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/StatsFetcher.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/StatsFetcher.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/StatsFetcher.java
index edb7407a..3b1d21d7 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/stats/StatsFetcher.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/stats/StatsFetcher.java
@@ -16,10 +16,12 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.stats;
+package de.butzlabben.missilewars.game.stats;
-import de.butzlabben.missilewars.Config;
+import de.butzlabben.missilewars.configuration.Config;
import de.butzlabben.missilewars.util.ConnectionHolder;
+import lombok.Getter;
+
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -27,7 +29,6 @@
import java.util.Date;
import java.util.List;
import java.util.UUID;
-import lombok.Getter;
@Getter
public class StatsFetcher {
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/EndTimer.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/EndTimer.java
index 00652ef9..ca320aa6 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/EndTimer.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/EndTimer.java
@@ -18,7 +18,7 @@
package de.butzlabben.missilewars.game.timer;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Messages;
import de.butzlabben.missilewars.game.Game;
/**
@@ -37,7 +37,7 @@ public void tick() {
switch(seconds) {
case 15:
- broadcast(MessageConfig.getMessage("game_starts_new_in").replace("%seconds%", Integer.toString(seconds)));
+ broadcast(Messages.getMessage("game_starts_new_in").replace("%seconds%", Integer.toString(seconds)));
break;
case 0:
getGame().reset();
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/GameTimer.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/GameTimer.java
index 223b9d50..2c3d9c00 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/GameTimer.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/GameTimer.java
@@ -18,7 +18,7 @@
package de.butzlabben.missilewars.game.timer;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Messages;
import de.butzlabben.missilewars.game.Game;
/**
@@ -45,7 +45,7 @@ public void tick() {
case 600:
case 300:
case 180:
- broadcast(MessageConfig.getMessage("game_ends_in_minutes").replace("%minutes%", Integer.toString(seconds/60)));
+ broadcast(Messages.getMessage("game_ends_in_minutes").replace("%minutes%", Integer.toString(seconds/60)));
break;
case 60:
case 30:
@@ -55,7 +55,7 @@ public void tick() {
case 3:
case 2:
case 1:
- broadcast(MessageConfig.getMessage("game_ends_in_seconds").replace("%seconds%", Integer.toString(seconds)));
+ broadcast(Messages.getMessage("game_ends_in_seconds").replace("%seconds%", Integer.toString(seconds)));
break;
case 0:
game.sendGameResult();
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/LobbyTimer.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/LobbyTimer.java
index ff69ab23..cc238ced 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/LobbyTimer.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/LobbyTimer.java
@@ -18,13 +18,14 @@
package de.butzlabben.missilewars.game.timer;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Arenas;
import de.butzlabben.missilewars.game.Game;
+import de.butzlabben.missilewars.game.enums.MapChooseProcedure;
+import de.butzlabben.missilewars.player.MWPlayer;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
-import de.butzlabben.missilewars.wrapper.abstracts.MapChooseProcedure;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
+
import java.util.Map;
import java.util.Optional;
@@ -66,7 +67,7 @@ public void tick() {
if (size1 + size2 < getGame().getLobby().getMinSize()) {
seconds = startTime;
remaining = 90;
- broadcast(MessageConfig.getMessage("not_enough_players"));
+ broadcast(Messages.getMessage("not_enough_players"));
return;
}
}
@@ -80,22 +81,22 @@ public void tick() {
case 3:
case 2:
case 1:
- broadcast(MessageConfig.getMessage("game_starts_in").replace("%seconds%", Integer.toString(seconds)));
+ broadcast(Messages.getMessage("game_starts_in").replace("%seconds%", Integer.toString(seconds)));
playPling();
break;
case 10:
checkVote();
- broadcast(MessageConfig.getMessage("game_starts_in").replace("%seconds%", Integer.toString(seconds)));
+ broadcast(Messages.getMessage("game_starts_in").replace("%seconds%", Integer.toString(seconds)));
playPling();
break;
case 0:
int diff = size1 - size2;
if (diff >= 2 || diff <= -2) {
- broadcast(MessageConfig.getMessage("teams_unequal"));
+ broadcast(Messages.getMessage("teams_unequal"));
seconds = startTime;
return;
}
- broadcast(MessageConfig.getMessage("game_starts"));
+ broadcast(Messages.getMessage("game_starts"));
playPling();
getGame().startGame();
return;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/Timer.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/Timer.java
index 52deeb4e..f6b0edeb 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/Timer.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/game/timer/Timer.java
@@ -19,7 +19,7 @@
package de.butzlabben.missilewars.game.timer;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
+import de.butzlabben.missilewars.player.MWPlayer;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.bukkit.Sound;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/inventory/VoteInventory.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/inventory/VoteInventory.java
index ad35f6b4..66133be7 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/inventory/VoteInventory.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/inventory/VoteInventory.java
@@ -19,17 +19,18 @@
package de.butzlabben.missilewars.inventory;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.configuration.arena.Arena;
+import org.bukkit.Material;
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.bukkit.Material;
public class VoteInventory extends OrcInventory {
public VoteInventory(List arenas) {
- super(MessageConfig.getNativeMessage("vote.gui"), (int) Math.ceil(arenas.size() / 9D));
+ super(Messages.getNativeMessage("vote.gui"), (int) Math.ceil(arenas.size() / 9D));
Map map = new HashMap<>();
map.put(1, new int[] {4});
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java
index 63db759f..9be32756 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/PlayerListener.java
@@ -18,14 +18,14 @@
package de.butzlabben.missilewars.listener;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.event.PlayerArenaJoinEvent;
+import de.butzlabben.missilewars.event.PlayerArenaLeaveEvent;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.GameManager;
-import de.butzlabben.missilewars.util.MotdManager;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaJoinEvent;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaLeaveEvent;
+import de.butzlabben.missilewars.game.misc.MotdManager;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/SignListener.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/SignListener.java
index d8e819e4..9044ccee 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/SignListener.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/SignListener.java
@@ -18,13 +18,13 @@
package de.butzlabben.missilewars.listener;
-import de.butzlabben.missilewars.MessageConfig;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Messages;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.game.GameManager;
+import de.butzlabben.missilewars.game.signs.MWSign;
+import de.butzlabben.missilewars.game.signs.SignRepository;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.signs.MWSign;
-import de.butzlabben.missilewars.wrapper.signs.SignRepository;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -80,9 +80,9 @@ public void onSignChange(SignChangeEvent event) {
signRepository.getSigns().add(sign);
signRepository.saveData();
- player.sendMessage(MessageConfig.getPrefix() + "Sign was successfully created and connected");
+ player.sendMessage(Messages.getPrefix() + "Sign was successfully created and connected");
} else {
- player.sendMessage(MessageConfig.getPrefix() + "§cCould not find lobby \"" + lobbyName + "\"");
+ player.sendMessage(Messages.getPrefix() + "§cCould not find lobby \"" + lobbyName + "\"");
event.setCancelled(true);
}
}
@@ -105,9 +105,9 @@ public void onSignBreak(BlockBreakEvent event) {
repository.getSigns().remove(sign);
repository.saveData();
- player.sendMessage(MessageConfig.getPrefix() + "You have successfully removed this missilewars sign");
+ player.sendMessage(Messages.getPrefix() + "You have successfully removed this missilewars sign");
} else {
- player.sendMessage(MessageConfig.getPrefix() + "§cYou have to be sneaking in order to remove this sign");
+ player.sendMessage(Messages.getPrefix() + "§cYou have to be sneaking in order to remove this sign");
event.setCancelled(true);
}
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java
index 99fc3a15..4dbdb0be 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/EndListener.java
@@ -18,11 +18,11 @@
package de.butzlabben.missilewars.listener.game;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.event.PlayerArenaJoinEvent;
+import de.butzlabben.missilewars.event.PlayerArenaLeaveEvent;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaJoinEvent;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaLeaveEvent;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
+import de.butzlabben.missilewars.player.MWPlayer;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -74,7 +74,7 @@ public void onPlayerArenaJoin(PlayerArenaJoinEvent event) {
if (getGame().isSpectatorsMax()) {
event.setCancelled(true);
- event.getPlayer().sendMessage(MessageConfig.getMessage("not_enter_arena"));
+ event.getPlayer().sendMessage(Messages.getMessage("not_enter_arena"));
return;
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameBoundListener.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameBoundListener.java
index 87a3c555..ac70d2dd 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameBoundListener.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameBoundListener.java
@@ -20,7 +20,7 @@
import de.butzlabben.missilewars.MissileWars;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
+import de.butzlabben.missilewars.player.MWPlayer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java
index 57bef1b3..fe8753b4 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/GameListener.java
@@ -18,17 +18,17 @@
package de.butzlabben.missilewars.listener.game;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.configuration.arena.FallProtectionConfiguration;
+import de.butzlabben.missilewars.event.PlayerArenaJoinEvent;
+import de.butzlabben.missilewars.event.PlayerArenaLeaveEvent;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.game.GameResult;
+import de.butzlabben.missilewars.game.Team;
+import de.butzlabben.missilewars.game.enums.GameResult;
+import de.butzlabben.missilewars.game.misc.RespawnGoldBlock;
+import de.butzlabben.missilewars.game.misc.Shield;
+import de.butzlabben.missilewars.player.MWPlayer;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.abstracts.arena.FallProtectionConfiguration;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaJoinEvent;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaLeaveEvent;
-import de.butzlabben.missilewars.wrapper.game.RespawnGoldBlock;
-import de.butzlabben.missilewars.wrapper.game.Shield;
-import de.butzlabben.missilewars.wrapper.game.Team;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
@@ -163,7 +163,7 @@ public void onDamage(EntityDamageByEntityEvent event) {
// same team
if (team == getGame().getPlayer(player).getTeam()) {
- shooter.sendMessage(MessageConfig.getMessage("hurt_teammates"));
+ shooter.sendMessage(Messages.getMessage("hurt_teammates"));
event.setCancelled(true);
}
}
@@ -206,9 +206,9 @@ public void onDeath(PlayerDeathEvent event) {
EntityDamageEvent.DamageCause damageCause = player.getLastDamageCause().getCause();
if (damageCause == EntityDamageEvent.DamageCause.BLOCK_EXPLOSION || damageCause == EntityDamageEvent.DamageCause.ENTITY_EXPLOSION) {
- deathBroadcast = MessageConfig.getNativeMessage("died_explosion").replace("%player%", player.getDisplayName());
+ deathBroadcast = Messages.getNativeMessage("died_explosion").replace("%player%", player.getDisplayName());
} else {
- deathBroadcast = MessageConfig.getNativeMessage("died").replace("%player%", player.getDisplayName());
+ deathBroadcast = Messages.getNativeMessage("died").replace("%player%", player.getDisplayName());
}
getGame().broadcast(deathBroadcast);
@@ -248,7 +248,7 @@ public void onMove(PlayerMoveEvent event) {
int toY = event.getTo().getBlockY();
if (toY > getGame().getArena().getMaxHeight()) {
player.teleport(event.getFrom());
- player.sendMessage(MessageConfig.getMessage("not_higher"));
+ player.sendMessage(Messages.getMessage("not_higher"));
} else if (toY < getGame().getArena().getDeathHeight()) {
player.setLastDamageCause(new EntityDamageEvent(player, EntityDamageEvent.DamageCause.FALL, 20));
player.damage(20.0D);
@@ -259,7 +259,7 @@ public void onMove(PlayerMoveEvent event) {
if (!getGame().isInGameArea(event.getTo())) {
if (to != null) Game.knockbackEffect(player, from, to);
- player.sendMessage(MessageConfig.getMessage("arena_leave"));
+ player.sendMessage(Messages.getMessage("arena_leave"));
}
}
@@ -272,7 +272,7 @@ public void onPlayerArenaJoin(PlayerArenaJoinEvent event) {
if ((!getGame().getLobby().isJoinOngoingGame()) || (getGame().isPlayersMax())) {
if (getGame().isSpectatorsMax()) {
event.setCancelled(true);
- event.getPlayer().sendMessage(MessageConfig.getMessage("not_enter_arena"));
+ event.getPlayer().sendMessage(Messages.getMessage("not_enter_arena"));
return;
}
getGame().playerJoinInGame(player, true);
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/LobbyListener.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/LobbyListener.java
index 33f38a1a..8dd231ab 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/LobbyListener.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/game/LobbyListener.java
@@ -18,13 +18,13 @@
package de.butzlabben.missilewars.listener.game;
-import de.butzlabben.missilewars.MessageConfig;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.event.PlayerArenaJoinEvent;
+import de.butzlabben.missilewars.event.PlayerArenaLeaveEvent;
import de.butzlabben.missilewars.game.Game;
import de.butzlabben.missilewars.inventory.VoteInventory;
+import de.butzlabben.missilewars.player.MWPlayer;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaJoinEvent;
-import de.butzlabben.missilewars.wrapper.event.PlayerArenaLeaveEvent;
-import de.butzlabben.missilewars.wrapper.player.MWPlayer;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -71,7 +71,7 @@ public void onInteract(PlayerInteractEvent event) {
// too late for team change:
if (getGame().getTimer().getSeconds() < 10) {
- player.sendMessage(MessageConfig.getMessage("change_team_not_now"));
+ player.sendMessage(Messages.getMessage("change_team_not_now"));
return;
}
@@ -122,7 +122,7 @@ public void onPlayerArenaJoin(PlayerArenaJoinEvent event) {
if (getGame().isPlayersMax()) {
event.setCancelled(true);
- event.getPlayer().sendMessage(MessageConfig.getMessage("not_enter_arena"));
+ event.getPlayer().sendMessage(Messages.getMessage("not_enter_arena"));
return;
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/MWPlayer.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/player/MWPlayer.java
similarity index 92%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/MWPlayer.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/player/MWPlayer.java
index e7ad170b..9c2ab61e 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/MWPlayer.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/player/MWPlayer.java
@@ -16,11 +16,11 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.player;
+package de.butzlabben.missilewars.player;
import de.butzlabben.missilewars.game.Game;
-import de.butzlabben.missilewars.util.PlayerEquipmentRandomizer;
-import de.butzlabben.missilewars.wrapper.game.Team;
+import de.butzlabben.missilewars.game.Team;
+import de.butzlabben.missilewars.game.equipment.PlayerEquipmentRandomizer;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/PlayerData.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/player/PlayerData.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/PlayerData.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/player/PlayerData.java
index 83cde6f4..d0ca8d34 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/PlayerData.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/player/PlayerData.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.player;
+package de.butzlabben.missilewars.player;
import com.google.common.base.Preconditions;
import de.butzlabben.missilewars.util.version.VersionUtil;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ConnectionHolder.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ConnectionHolder.java
index 1aa7e30e..9f8e0272 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ConnectionHolder.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/ConnectionHolder.java
@@ -18,17 +18,13 @@
package de.butzlabben.missilewars.util;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
+import de.butzlabben.missilewars.configuration.Config;
import org.bukkit.Bukkit;
+import java.sql.*;
+
/**
* @author Butzlabben
* @since 13.08.2018
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MoneyUtil.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MoneyUtil.java
index c90c538f..6c90c959 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MoneyUtil.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/MoneyUtil.java
@@ -19,14 +19,15 @@
package de.butzlabben.missilewars.util;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
-import java.util.UUID;
+import de.butzlabben.missilewars.configuration.Messages;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.RegisteredServiceProvider;
+import java.util.UUID;
+
/**
* @author Butzlabben
* @since 13.08.2018
@@ -67,7 +68,7 @@ public static void giveMoney(UUID uuid, int money) {
Logger.WARN.log("Message: " + r.errorMessage);
} else {
if (Bukkit.getPlayer(uuid) != null)
- Bukkit.getPlayer(uuid).sendMessage(MessageConfig.getMessage("money").replace("%money%", money + ""));
+ Bukkit.getPlayer(uuid).sendMessage(Messages.getMessage("money").replace("%money%", money + ""));
}
}
}
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerDataProvider.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerDataProvider.java
index 8b20622a..31f1164e 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerDataProvider.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/PlayerDataProvider.java
@@ -20,7 +20,7 @@
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
-import de.butzlabben.missilewars.wrapper.player.PlayerData;
+import de.butzlabben.missilewars.player.PlayerData;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/SetupUtil.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/SetupUtil.java
index bb1dbd0a..891e75de 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/SetupUtil.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/SetupUtil.java
@@ -18,11 +18,11 @@
package de.butzlabben.missilewars.util;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.arena.Arena;
import de.butzlabben.missilewars.game.Arenas;
-import de.butzlabben.missilewars.wrapper.abstracts.Arena;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Area.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Area.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Area.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Area.java
index 87e061a6..c4bb8025 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Area.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Area.java
@@ -16,17 +16,18 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.geometry;
+package de.butzlabben.missilewars.util.geometry;
import com.google.gson.annotations.SerializedName;
-import java.util.HashMap;
-import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import org.bukkit.Location;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
+import java.util.HashMap;
+import java.util.Map;
+
@ToString
@AllArgsConstructor
@Getter
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/FlatArea.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/FlatArea.java
similarity index 95%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/FlatArea.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/FlatArea.java
index dab965ad..334129ff 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/FlatArea.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/FlatArea.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.geometry;
+package de.butzlabben.missilewars.util.geometry;
import org.bukkit.Location;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Line.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Line.java
similarity index 98%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Line.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Line.java
index 765ef9b7..a0afa8c2 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Line.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Line.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.geometry;
+package de.butzlabben.missilewars.util.geometry;
import de.butzlabben.missilewars.util.MathUtil;
import lombok.AllArgsConstructor;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Plane.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Plane.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Plane.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Plane.java
index ee855eac..3e4416e9 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/geometry/Plane.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Plane.java
@@ -16,15 +16,16 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.geometry;
+package de.butzlabben.missilewars.util.geometry;
import de.butzlabben.missilewars.util.MathUtil;
-import java.util.Optional;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import org.bukkit.util.Vector;
+import java.util.Optional;
+
@Getter
@AllArgsConstructor
@ToString
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/Interval.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/missile/Interval.java
similarity index 97%
rename from missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/Interval.java
rename to missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/missile/Interval.java
index a3df2fd5..90427aa0 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/player/Interval.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/missile/Interval.java
@@ -16,7 +16,7 @@
* along with MissileWars. If not, see .
*/
-package de.butzlabben.missilewars.wrapper.player;
+package de.butzlabben.missilewars.util.missile;
import java.util.Objects;
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PlayerGuiFactory.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PlayerGuiFactory.java
index 0a502e3b..ee23d419 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PlayerGuiFactory.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PlayerGuiFactory.java
@@ -19,25 +19,15 @@
package de.butzlabben.missilewars.util.stats;
import com.mojang.authlib.GameProfile;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
import de.butzlabben.missilewars.MissileWars;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.game.stats.PlayerStats;
+import de.butzlabben.missilewars.game.stats.PlayerStatsComparator;
import de.butzlabben.missilewars.inventory.OrcItem;
import de.butzlabben.missilewars.inventory.pages.PageGUICreator;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.stats.PlayerStats;
-import de.butzlabben.missilewars.wrapper.stats.PlayerStatsComparator;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ForkJoinPool;
-import java.util.stream.Collectors;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
@@ -45,6 +35,12 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
+import java.io.IOException;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ForkJoinPool;
+import java.util.stream.Collectors;
+
@Getter
public class PlayerGuiFactory {
@@ -76,7 +72,7 @@ public void openWhenReady(Player player) {
int currentSize = names.size();
if (realSize > currentSize) {
if (Config.isContactAuth()) {
- player.sendMessage(MessageConfig.getPrefix() + "Fetching not cached player names: " + currentSize + "/" + realSize);
+ player.sendMessage(Messages.getPrefix() + "Fetching not cached player names: " + currentSize + "/" + realSize);
ForkJoinPool.commonPool().execute(() -> {
List missing = getMissingUUIDs();
int maxFetches = Math.min(missing.size(), MAX_FETCHES);
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PreFetcher.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PreFetcher.java
index 0ebff3a0..642e7c31 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PreFetcher.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/stats/PreFetcher.java
@@ -19,24 +19,20 @@
package de.butzlabben.missilewars.util.stats;
import com.mojang.authlib.GameProfile;
-import de.butzlabben.missilewars.Config;
import de.butzlabben.missilewars.Logger;
+import de.butzlabben.missilewars.configuration.Config;
+import de.butzlabben.missilewars.game.stats.StatsFetcher;
import de.butzlabben.missilewars.inventory.OrcItem;
import de.butzlabben.missilewars.inventory.pages.InventoryPage;
import de.butzlabben.missilewars.inventory.pages.PageGUICreator;
import de.butzlabben.missilewars.util.version.VersionUtil;
-import de.butzlabben.missilewars.wrapper.stats.StatsFetcher;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
+import java.util.*;
+
public class PreFetcher {
@Getter
diff --git a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/version/VersionUtil.java b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/version/VersionUtil.java
index 07b2f29d..ec697aa5 100644
--- a/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/version/VersionUtil.java
+++ b/missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/version/VersionUtil.java
@@ -19,8 +19,8 @@
package de.butzlabben.missilewars.util.version;
import de.butzlabben.missilewars.Logger;
-import de.butzlabben.missilewars.MessageConfig;
-import de.butzlabben.missilewars.wrapper.game.Team;
+import de.butzlabben.missilewars.configuration.Messages;
+import de.butzlabben.missilewars.game.Team;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -86,7 +86,7 @@ public static void sendTitle(Player p, String title, String subtitle) {
e.printStackTrace();
}
} else {
- p.sendMessage(MessageConfig.getPrefix() + title + " " + subtitle);
+ p.sendMessage(Messages.getPrefix() + title + " " + subtitle);
}
}