Splits the two types of configuration keys

This commit is contained in:
Kristian Knarvik 2023-07-06 21:37:31 +02:00
parent 177f585145
commit 8f704f9d87
48 changed files with 876 additions and 778 deletions

View File

@ -47,7 +47,7 @@ again sick of marking issues as duplicates and then closing them
NOTE: Bugs will always be fixed first before implementing ideas so please don't spam us.
Also please do not message us via Bukkit as it is irritating, and we only respond to Plugin Developers
Also, please do not message us via Bukkit as it is irritating, and we only respond to Plugin Developers
Thank you for reading this. The reason I have written this up is that we are sick to the back teeth of issues that don't
need to be reported.

View File

@ -14,17 +14,16 @@ This plugin has been heavily inspired from the gamemode "PropHunt", from the gam
### Downloads
| Branch | Plugin version | Compatiable Minecraft version | Build status | Download |
| --- | --- | --- | --- | --- |
| Release| **v0.2.1** | **
v1.12.2** | [![Build Status](https://jenkins.addstar.com.au/job/Blockhunt/badge/icon)] | [DOWNLOAD](https://jenkins.addstar.com.au/job/Blockhunt/lastSuccessfulBuild/artifact/target/) |
| Branch | Plugin version | Compatiable Minecraft version | Build status | Download |
|---------|----------------|-------------------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Release | **v0.2.1** | **v1.12.2** | [![Build Status](https://jenkins.addstar.com.au/job/Blockhunt/badge/icon)] | [DOWNLOAD](https://jenkins.addstar.com.au/job/Blockhunt/lastSuccessfulBuild/artifact/target/) |
#### This plugin requires you to download and install two addinonal plugins! ([Lib's Disguises](https://www.spigotmc.org/resources/libs-disguises.81/) and [ProtocolLib](http://dev.bukkit.org/bukkit-plugins/protocollib/))
### Support
|Method|Link|
| --- | --- |
| Method | Link |
|------------------------------|--------------------------------------------------------------|
| **Issues/Tickets on GitHub** | [Click Here](https://github.com/AddstarMC/BlockHunt/issues/) |
### Features
@ -54,16 +53,16 @@ _**Note:** Instead of using /BlockHunt you could use:_
|Command|Description|Permission|| |:--|:--|:--|:--| |`/BlockHunt [info/i]`|Displays the plugin's info.|blockhunt.info|_
All players have this permission from default._| |`/BlockHunt <help/h>`|Shows a list of commands.|blockhunt.help|_All
players have this permission from default._| |`/BlockHunt <reload/r>`|Reloads all
configs.|blockhunt.reload|blockhunt.admin| |`/BlockHunt <join/j> <arenaname>`|Joins a BlockHunt
configs.|blockhunt.reload|blockhunt.admin| |`/BlockHunt <join/j> <arenaName>`|Joins a BlockHunt
game.|blockhunt.join|blockhunt.player| |`/BlockHunt <leave/l>`|Leave a BlockHunt game.|blockhunt.leave|blockhunt.player|
|`/BlockHunt <list/li>`|Shows a list of available arenas.|blockhunt.list|blockhunt.player| |`/BlockHunt <shop/sh>`|Opens
the BlockHunt shop.|blockhunt.shop|blockhunt.player| |`/BlockHunt <start/go> <arenaname>`|Forces an arena to
the BlockHunt shop.|blockhunt.shop|blockhunt.player| |`/BlockHunt <start/go> <arenaName>`|Forces an arena to
start.|blockhunt.start|blockhunt.moderator| |`/BlockHunt <wand/w>`|Gives you the wand selection
tool.|blockhunt.create|blockhunt.admin| |`/BlockHunt <create/c> <arenaname>`|Creates an arena from your
selection.|blockhunt.create|blockhunt.admin| |`/BlockHunt <set/s> <arenaname>`|Opens a panel to set
settings.|blockhunt.set|blockhunt.moderator| |`/BlockHunt <setwarp/sw> <lobby/hiders/seekers/spawn> <arenaname>`|Sets
warps for your arena.|blockhunt.setwarp|blockhunt.moderator| |`/BlockHunt <remove/delete> <arenaname>`|Deletes an
Arena.|blockhunt.remove|blockhunt.admin| |`/BlockHunt <tokens/t> <set/add/take> <playername> <amount>`|Change someones
tool.|blockhunt.create|blockhunt.admin| |`/BlockHunt <create/c> <arenaName>`|Creates an arena from your
selection.|blockhunt.create|blockhunt.admin| |`/BlockHunt <set/s> <arenaName>`|Opens a panel to set
settings.|blockhunt.set|blockhunt.moderator| |`/BlockHunt <setWarp/sw> <lobby/hiders/seekers/spawn> <arenaName>`|Sets
warps for your arena.|blockhunt.setWarp|blockhunt.moderator| |`/BlockHunt <remove/delete> <arenaName>`|Deletes an
Arena.|blockhunt.remove|blockhunt.admin| |`/BlockHunt <tokens/t> <set/add/take> <%playerName%> <amount>`|Change someones
tokens.|blockhunt.tokens|blockhunt.admin| ||Able to join full games.|blockhunt.joinfull|blockhunt.moderator| ||Able to
join/leave using join/leave signs.|blockhunt.joinsign|blockhunt.player| ||Able to create a join/leave
sign.|blockhunt.signcreate|blockhunt.moderator| ||Gives you the
@ -76,7 +75,7 @@ in-game.|blockhunt.allcommands|Operators|
permissions.| |`blockhunt.moderator`|All moderator related permissions.| |`blockhunt.admin`|All admin related
permissions.| |`*`|All permissions on your server, including BlockHunt's permissions.|
## How to set-up?
## How to set up?
Use this video to manage your way through the set-up phase!

View File

@ -86,7 +86,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<version>24.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -21,6 +21,9 @@ import net.knarcraft.blockhunt.command.ShopCommand;
import net.knarcraft.blockhunt.command.StartCommand;
import net.knarcraft.blockhunt.command.TokensCommand;
import net.knarcraft.blockhunt.command.WandCommand;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.config.Permission;
import net.knarcraft.blockhunt.listener.OnBlockBreakEvent;
import net.knarcraft.blockhunt.listener.OnBlockPlaceEvent;
import net.knarcraft.blockhunt.listener.OnEntityDamageByEntityEvent;
@ -64,20 +67,10 @@ import java.util.ArrayList;
import java.util.List;
public class BlockHunt extends JavaPlugin implements Listener {
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
public static PluginDescriptionFile pdfFile;
private static PluginDescriptionFile pluginDescriptionFile;
public static BlockHunt plugin;
public String rootPermission = BlockHunt.getPluginDescriptionFile().getName().toLowerCase() + ".";
@SuppressWarnings("serial")
public static final List<String> BlockHuntCMD = new ArrayList<>() {
@ -93,7 +86,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
add("wand");
add("create");
add("set");
add("setwarp");
add("setWarp");
add("remove");
add("tokens");
}
@ -136,59 +129,59 @@ public class BlockHunt extends JavaPlugin implements Listener {
ConfigurationSerialization.registerClass(Arena.class, "BlockHuntArena");
pdfFile = getDescription();
pluginDescriptionFile = getDescription();
plugin = this;
ConfigManager.newFiles();
CMD = new CommandManager("BlockHunt", "BlockHunt", null, null, PermissionsC.Permissions.info, ConfigC.help_info, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_info), BlockHuntCMD,
CMD = new CommandManager("BlockHunt", "BlockHunt", null, null, Permission.INFO, MessageKey.HELP_INFO, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_INFO), BlockHuntCMD,
new InfoCommand(), null);
CMDInfo = new CommandManager("BlockHunt INFO", "BlockHunt", "info", "i", PermissionsC.Permissions.info, ConfigC.help_info, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_info),
CMDInfo = new CommandManager("BlockHunt INFO", "BlockHunt", "info", "i", Permission.INFO, MessageKey.HELP_INFO, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_INFO),
BlockHuntCMD, new InfoCommand(), "/BlockHunt [info|i]");
CMDHelp = new CommandManager("BlockHunt HELP", "BlockHunt", "help", "h", PermissionsC.Permissions.help, ConfigC.help_help, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_help),
CMDHelp = new CommandManager("BlockHunt HELP", "BlockHunt", "help", "h", Permission.HELP, MessageKey.HELP_HELP, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_HELP),
BlockHuntCMD, new HelpCommand(), "/BlockHunt <help|h> [page number]");
CMDReload = new CommandManager("BlockHunt RELOAD", "BlockHunt", "reload", "r", PermissionsC.Permissions.reload, ConfigC.help_reload,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_reload), BlockHuntCMD, new ReloadCommand(), "/BlockHunt <reload|r>");
CMDJoin = new CommandManager("BlockHunt JOIN", "BlockHunt", "join", "j", PermissionsC.Permissions.join, ConfigC.help_join, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_join),
CMDReload = new CommandManager("BlockHunt RELOAD", "BlockHunt", "reload", "r", Permission.RELOAD, MessageKey.HELP_RELOAD,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_RELOAD), BlockHuntCMD, new ReloadCommand(), "/BlockHunt <reload|r>");
CMDJoin = new CommandManager("BlockHunt JOIN", "BlockHunt", "join", "j", Permission.JOIN, MessageKey.HELP_JOIN, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_JOIN),
BlockHuntCMD, new JoinCommand(), "/BlockHunt <join|j> <arena name>");
CMDLeave = new CommandManager("BlockHunt LEAVE", "BlockHunt", "leave", "l", PermissionsC.Permissions.leave, ConfigC.help_leave,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_leave), BlockHuntCMD, new LeaveCommand(), "/BlockHunt <leave|l>");
CMDList = new CommandManager("BlockHunt LIST", "BlockHunt", "list", "li", PermissionsC.Permissions.list, ConfigC.help_list, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_list),
CMDLeave = new CommandManager("BlockHunt LEAVE", "BlockHunt", "leave", "l", Permission.LEAVE, MessageKey.HELP_LEAVE,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_LEAVE), BlockHuntCMD, new LeaveCommand(), "/BlockHunt <leave|l>");
CMDList = new CommandManager("BlockHunt LIST", "BlockHunt", "list", "li", Permission.LIST, MessageKey.HELP_LIST, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_LIST),
BlockHuntCMD, new ListCommand(), "/BlockHunt <list|li>");
CMDShop = new CommandManager("BlockHunt SHOP", "BlockHunt", "shop", "sh", PermissionsC.Permissions.shop, ConfigC.help_shop, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_shop),
CMDShop = new CommandManager("BlockHunt SHOP", "BlockHunt", "shop", "sh", Permission.SHOP, MessageKey.HELP_SHOP, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_SHOP),
BlockHuntCMD, new ShopCommand(), "/BlockHunt <shop|sh>");
CMDStart = new CommandManager("BlockHunt START", "BlockHunt", "start", "go", PermissionsC.Permissions.start, ConfigC.help_start,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_start), BlockHuntCMD, new StartCommand(), "/BlockHunt <start|go> <arena name>");
CMDWand = new CommandManager("BlockHunt WAND", "BlockHunt", "wand", "w", PermissionsC.Permissions.create, ConfigC.help_wand, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_wand),
CMDStart = new CommandManager("BlockHunt START", "BlockHunt", "start", "go", Permission.START, MessageKey.HELP_START,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_START), BlockHuntCMD, new StartCommand(), "/BlockHunt <start|go> <arena name>");
CMDWand = new CommandManager("BlockHunt WAND", "BlockHunt", "wand", "w", Permission.CREATE, MessageKey.HELP_WAND, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_WAND),
BlockHuntCMD, new WandCommand(), "/BlockHunt <wand|w>");
CMDCreate = new CommandManager("BlockHunt CREATE", "BlockHunt", "create", "c", PermissionsC.Permissions.create, ConfigC.help_create,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_create), BlockHuntCMD, new CreateCommand(), "/BlockHunt <create|c> <arena name>");
CMDSet = new CommandManager("BlockHunt SET", "BlockHunt", "set", "s", PermissionsC.Permissions.set, ConfigC.help_set, (Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_set),
CMDCreate = new CommandManager("BlockHunt CREATE", "BlockHunt", "create", "c", Permission.CREATE, MessageKey.HELP_CREATE,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_CREATE), BlockHuntCMD, new CreateCommand(), "/BlockHunt <create|c> <arena name>");
CMDSet = new CommandManager("BlockHunt SET", "BlockHunt", "set", "s", Permission.SET, MessageKey.HELP_SET, (Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_SET),
BlockHuntCMD, new SetCommand(), "/BlockHunt <set|s> <arena name>");
CMDSetWarp = new CommandManager("BlockHunt SETWARP", "BlockHunt", "setwarp", "sw", PermissionsC.Permissions.setwarp, ConfigC.help_setwarp,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_setwarp), BlockHuntCMD, new SetWarpCommand(),
"/BlockHunt <setwarp|sw> <lobby|hiders|seekers|spawn> <arena name>");
CMDRemove = new CommandManager("BlockHunt REMOVE", "BlockHunt", "remove", "delete", PermissionsC.Permissions.remove, ConfigC.help_remove,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_remove), BlockHuntCMD, new RemoveCommand(), "/BlockHunt <remove|delete> <arena name>");
CMDTokens = new CommandManager("BlockHunt TOKENS", "BlockHunt", "tokens", "t", PermissionsC.Permissions.tokens, ConfigC.help_tokens,
(Boolean) MemoryStorage.config.get(ConfigC.commandEnabled_tokens), BlockHuntCMD, new TokensCommand(), "/BlockHunt <tokens|t> <set|add|take> <player name> <amount>");
CMDSetWarp = new CommandManager("BlockHunt SETWARP", "BlockHunt", "setWarp", "sw", Permission.SET_WARP, MessageKey.HELP_SET_WARP,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_SET_WARP), BlockHuntCMD, new SetWarpCommand(),
"/BlockHunt <setWarp|sw> <lobby|hiders|seekers|spawn> <arena name>");
CMDRemove = new CommandManager("BlockHunt REMOVE", "BlockHunt", "remove", "delete", Permission.REMOVE, MessageKey.HELP_REMOVE,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_REMOVE), BlockHuntCMD, new RemoveCommand(), "/BlockHunt <remove|delete> <arena name>");
CMDTokens = new CommandManager("BlockHunt TOKENS", "BlockHunt", "tokens", "t", Permission.TOKENS, MessageKey.HELP_TOKENS,
(Boolean) MemoryStorage.config.get(ConfigKey.COMMAND_ENABLED_TOKENS), BlockHuntCMD, new TokensCommand(), "/BlockHunt <tokens|t> <set|add|take> <player name> <amount>");
if (!getServer().getPluginManager().isPluginEnabled("LibsDisguises")) {
MessageManager.broadcastFMessage(ConfigC.error_libsDisguisesNotInstalled);
MessageManager.broadcastFMessage(MessageKey.ERROR_LIBS_DISGUISES_NOT_INSTALLED);
Bukkit.getServer().getPluginManager().disablePlugin(this);
return;
}
if (!getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
MessageManager.broadcastFMessage(ConfigC.error_protocolLibNotInstalled);
MessageManager.broadcastFMessage(MessageKey.ERROR_PROTOCOL_LIB_NOT_INSTALLED);
Bukkit.getServer().getPluginManager().disablePlugin(this);
return;
}
ArenaHandler.loadArenas();
MessageManager.sendFMessage(null, ConfigC.log_enabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "authors-"
+ BlockHunt.pdfFile.getAuthors().get(0));
MessageManager.sendFMessage(null, MessageKey.LOG_ENABLED_PLUGIN, "name-" + BlockHunt.pluginDescriptionFile.getName(), "version-" + BlockHunt.pluginDescriptionFile.getVersion(), "authors-"
+ BlockHunt.pluginDescriptionFile.getAuthors().get(0));
// Welcome to the massive game loop!!
getServer().getScheduler().runTaskTimer(this, () -> {
@ -197,35 +190,35 @@ public class BlockHunt extends JavaPlugin implements Listener {
if (arena.playersInArena.size() >= arena.minPlayers) {
arena.gameState = ArenaState.STARTING;
arena.timer = arena.timeInLobbyUntilStart;
ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-" + arena.timeInLobbyUntilStart);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_LOBBY_ARENA_IS_STARTING, "1-" + arena.timeInLobbyUntilStart);
}
} else if (arena.gameState == ArenaState.STARTING) {
arena.timer = arena.timer - 1;
if (arena.timer > 0) {
if (arena.timer == 60 || arena.timer == 30 || arena.timer == 10) {
ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-" + arena.timer);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_LOBBY_ARENA_IS_STARTING, "1-" + arena.timer);
} else if (arena.timer <= 5) {
World world = arena.lobbyWarp.getWorld();
if (world != null) {
int pitch = (int) (2 - Math.floor(arena.timer / 2.0));
world.playSound(arena.lobbyWarp, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, pitch);
}
ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-" + arena.timer);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_LOBBY_ARENA_IS_STARTING, "1-" + arena.timer);
}
} else {
arena.gameState = ArenaState.IN_GAME;
arena.timer = arena.gameTime;
ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaStarted, "secs-" + arena.waitingTimeSeeker);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_LOBBY_ARENA_STARTED, "secs-" + arena.waitingTimeSeeker);
for (int i = arena.amountSeekersOnStart; i > 0; i = i - 1) {
boolean loop = true;
Player seeker = arena.playersInArena.get(MemoryStorage.random.nextInt(arena.playersInArena.size()));
for (Player playerCheck : arena.playersInArena) {
if (MemoryStorage.choosenSeeker.get(playerCheck) != null) {
if (MemoryStorage.choosenSeeker.get(playerCheck)) {
if (MemoryStorage.chosenSeeker.get(playerCheck) != null) {
if (MemoryStorage.chosenSeeker.get(playerCheck)) {
seeker = playerCheck;
MemoryStorage.choosenSeeker.remove(playerCheck);
MemoryStorage.chosenSeeker.remove(playerCheck);
} else {
if (seeker.equals(playerCheck)) {
i = i + 1;
@ -237,7 +230,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
if (loop) {
if (!arena.seekers.contains(seeker)) {
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_SEEKER_CHOSEN, "seeker-" + seeker.getName());
arena.seekers.add(seeker);
PlayerHandler.teleport(seeker, arena.seekersWarp);
seeker.getInventory().clear();
@ -256,9 +249,9 @@ public class BlockHunt extends JavaPlugin implements Listener {
arenaPlayer.updateInventory();
ItemStack block = arena.disguiseBlocks.get(MemoryStorage.random.nextInt(arena.disguiseBlocks.size()));
if (MemoryStorage.choosenBlock.get(arenaPlayer) != null) {
block = MemoryStorage.choosenBlock.get(arenaPlayer);
MemoryStorage.choosenBlock.remove(arenaPlayer);
if (MemoryStorage.chosenBlock.get(arenaPlayer) != null) {
block = MemoryStorage.chosenBlock.get(arenaPlayer);
MemoryStorage.chosenBlock.remove(arenaPlayer);
}
MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getType());
@ -270,7 +263,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
MemoryStorage.pBlock.put(arenaPlayer, block);
String blockName = block.getType().name();
blockName = WordUtils.capitalizeFully(blockName.replace("_", " "));
MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameBlock,
MessageManager.sendFMessage(arenaPlayer, MessageKey.NORMAL_IN_GAME_BLOCK,
"block-" + blockName);
}
}
@ -299,7 +292,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
if (MemoryStorage.seekertime.get(player) <= 0) {
PlayerHandler.teleport(player, arena.hidersWarp);
MemoryStorage.seekertime.remove(player);
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerSpawned, "playername-" + player.getName());
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_SEEKER_SPAWNED, "%playerName%-" + player.getName());
}
}
}
@ -313,7 +306,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
for (Player arenaPlayer : arena.playersInArena) {
if (!arena.seekers.contains(arenaPlayer)) {
arenaPlayer.getInventory().addItem(sword);
MessageManager.sendFMessage(arenaPlayer, ConfigC.normal_ingameGivenSword);
MessageManager.sendFMessage(arenaPlayer, MessageKey.NORMAL_IN_GAME_GIVEN_SWORD);
}
}
}
@ -331,18 +324,18 @@ public class BlockHunt extends JavaPlugin implements Listener {
}
}
String blocklist = StringUtils.join(remainingBlocks, ", ");
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameBlocksLeft, "1-" + blocklist);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_BLOCKS_LEFT, "1-" + blocklist);
}
if (arena.timer == 190 || arena.timer == 60 || arena.timer == 30 || arena.timer == 10) {
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-" + arena.timer);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_ARENA_END, "1-" + arena.timer);
} else if (arena.timer <= 5) {
World world = arena.lobbyWarp.getWorld();
if (world != null) {
int pitch = (int) (2 - Math.floor(arena.timer / 2.0));
world.playSound(arena.lobbyWarp, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, pitch);
}
ArenaHandler.sendFMessage(arena, ConfigC.normal_lobbyArenaIsStarting, "1-" + arena.timer);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_LOBBY_ARENA_IS_STARTING, "1-" + arena.timer);
}
} else {
ArenaHandler.hidersWin(arena);
@ -391,7 +384,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
MemoryStorage.hiddenLoc.put(player, moveLoc);
String blockName = block.getType().name();
blockName = WordUtils.capitalizeFully(blockName.replace("_", " "));
MessageManager.sendFMessage(player, ConfigC.normal_ingameNowSolid, "block-"
MessageManager.sendFMessage(player, MessageKey.NORMAL_IN_GAME_NOW_SOLID, "block-"
+ blockName);
}
for (Player pl : Bukkit.getOnlinePlayers()) {
@ -401,7 +394,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
}
}
} else {
MessageManager.sendFMessage(player, ConfigC.warning_ingameNoSolidPlace);
MessageManager.sendFMessage(player, MessageKey.WARNING_IN_GAME_NO_SOLID_PLACE);
}
}
} else {
@ -432,11 +425,15 @@ public class BlockHunt extends JavaPlugin implements Listener {
public void onDisable() {
for (Arena arena : MemoryStorage.arenaList) {
String cause = "[BlockHunt] Arena " + arena.arenaName + " has been stopped";
ArenaHandler.stopArena(arena, cause, ConfigC.warning_arenaStopped);
ArenaHandler.stopArena(arena, cause, MessageKey.WARNING_ARENA_STOPPED);
}
MessageManager.sendFMessage(null, ConfigC.log_disabledPlugin, "name-" + BlockHunt.pdfFile.getName(), "version-" + BlockHunt.pdfFile.getVersion(), "authors-"
+ BlockHunt.pdfFile.getAuthors().get(0));
MessageManager.sendFMessage(null, MessageKey.LOG_DISABLED_PLUGIN, "name-" + BlockHunt.pluginDescriptionFile.getName(), "version-" + BlockHunt.pluginDescriptionFile.getVersion(), "authors-"
+ BlockHunt.pluginDescriptionFile.getAuthors().get(0));
}
public static PluginDescriptionFile getPluginDescriptionFile() {
return pluginDescriptionFile;
}
/**
@ -497,7 +494,7 @@ public class BlockHunt extends JavaPlugin implements Listener {
if (command.enabled) {
return command.CMD.execute(player, cmd, label, args);
} else {
MessageManager.sendFMessage(player, ConfigC.error_commandNotEnabled);
MessageManager.sendFMessage(player, MessageKey.ERROR_COMMAND_NOT_ENABLED);
}
}

View File

@ -1,126 +0,0 @@
package net.knarcraft.blockhunt;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.manager.ConfigManager;
public enum ConfigC {
chat_tag("[" + BlockHunt.pdfFile.getName() + "] ", MemoryStorage.config), chat_normal("&b", MemoryStorage.config), chat_warning("&c", MemoryStorage.config), chat_error("&c", MemoryStorage.config), chat_arg("&e",
MemoryStorage.config), chat_header("&9", MemoryStorage.config), chat_headerhigh("%H_______.[ %A%header%%H ]._______", MemoryStorage.config),
commandEnabled_info(true, MemoryStorage.config), commandEnabled_help(true, MemoryStorage.config), commandEnabled_reload(true, MemoryStorage.config), commandEnabled_join(true, MemoryStorage.config), commandEnabled_leave(
true, MemoryStorage.config), commandEnabled_list(true, MemoryStorage.config), commandEnabled_shop(true, MemoryStorage.config), commandEnabled_start(true, MemoryStorage.config), commandEnabled_wand(true,
MemoryStorage.config), commandEnabled_create(true, MemoryStorage.config), commandEnabled_set(true, MemoryStorage.config), commandEnabled_setwarp(true, MemoryStorage.config), commandEnabled_remove(true,
MemoryStorage.config), commandEnabled_tokens(true, MemoryStorage.config),
autoUpdateCheck(true, MemoryStorage.config), autoDownloadUpdate(false, MemoryStorage.config),
wandIDname("STICK", MemoryStorage.config), wandName("%A&l" + BlockHunt.pdfFile.getName() + "%N's selection wand", MemoryStorage.config), wandDescription(new String[]{
"%NUse this item to select an arena for your arena.", "%ALeft-Click%N to select point #1.", "%ARight-Click%N to select point #2.",
"%NUse the create command to define your arena.", "%A/" + BlockHunt.pdfFile.getName() + " <help|h>"}, MemoryStorage.config),
shop_title("%H&lBlockHunt %NShop", MemoryStorage.config), shop_price("%NPrice: %A%amount% %Ntokens.", MemoryStorage.config),
shop_blockChooserv1Enabled(true, MemoryStorage.config), shop_blockChooserv1IDname("BOOK", MemoryStorage.config), shop_blockChooserv1Price(3000, MemoryStorage.config), shop_blockChooserv1Name(
"%H&lBlockHunt Chooser", MemoryStorage.config), shop_blockChooserv1Description(new String[]{"%NUse this item before the arena starts.",
"%ARight-Click%N in the lobby and choose", "%Nthe block you want to be!", "&6Unlimited uses."}, MemoryStorage.config),
shop_BlockHuntPassv2Enabled(true, MemoryStorage.config), shop_BlockHuntPassv2IDName("NAME_TAG", MemoryStorage.config), shop_BlockHuntPassv2Price(150, MemoryStorage.config), shop_BlockHuntPassv2Name(
"%H&lBlockHunt Pass", MemoryStorage.config), shop_BlockHuntPassv2Description(new String[]{"%NUse this item before the arena starts.",
"%ARight-Click%N in the lobby and choose", "%Nif you want to be a Hider or a Seeker!", "&61 time use.",}, MemoryStorage.config),
sign_LEAVE(new String[]{"%H[" + BlockHunt.pdfFile.getName() + "%H]", "&4LEAVE", "&8Right-Click", "&8To leave."}, MemoryStorage.config), sign_SHOP(new String[]{
"%H[" + BlockHunt.pdfFile.getName() + "%H]", "&4SHOP", "&8Right-Click", "&8To shop."}, MemoryStorage.config), sign_WAITING(new String[]{
"%H[" + BlockHunt.pdfFile.getName() + "%H]", "%A%arenaname%", "%A%players%%N/%A%maxplayers%", "&8Waiting..."}, MemoryStorage.config), sign_STARTING(new String[]{
"%H[" + BlockHunt.pdfFile.getName() + "%H]", "%A%arenaname%", "%A%players%%N/%A%maxplayers%", "&2Start: %A%timeleft%"}, MemoryStorage.config), sign_INGAME(new String[]{
"%H[" + BlockHunt.pdfFile.getName() + "%H]", "%A%arenaname%", "%A%players%%N/%A%maxplayers%", "%EIngame: %A%timeleft%"}, MemoryStorage.config),
scoreboard_enabled(true, MemoryStorage.config), scoreboard_title("%H[" + BlockHunt.pdfFile.getName() + "]", MemoryStorage.config), scoreboard_timeleft("%ATime left:", MemoryStorage.config), scoreboard_seekers(
"%NSeekers:", MemoryStorage.config), scoreboard_hiders("%NHiders:", MemoryStorage.config),
requireInventoryClearOnJoin(false, MemoryStorage.config),
log_enabledPlugin("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%authors%%N.", MemoryStorage.messages), log_disabledPlugin(
"%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%authors%%N.", MemoryStorage.messages),
help_info("%NDisplays the plugin's info.", MemoryStorage.messages), help_help("%NShows a list of commands.", MemoryStorage.messages), help_reload("%NReloads all configs.", MemoryStorage.messages), help_join(
"%NJoins a " + BlockHunt.pdfFile.getName() + " game.", MemoryStorage.messages), help_leave("%NLeave a " + BlockHunt.pdfFile.getName() + " game.", MemoryStorage.messages), help_list(
"%NShows a list of available arenas.", MemoryStorage.messages), help_shop("%NOpens the " + BlockHunt.pdfFile.getName() + " shop.", MemoryStorage.messages), help_start(
"%NForces an arena to start.", MemoryStorage.messages), help_wand("%NGives you the wand selection tool.", MemoryStorage.messages), help_create(
"%NCreates an arena from your selection.", MemoryStorage.messages), help_set("%NOpens a panel to set settings.", MemoryStorage.messages), help_setwarp(
"%NSets warps for your arena.", MemoryStorage.messages), help_remove("%NDeletes an Arena.", MemoryStorage.messages), help_tokens("%NChange someones tokens.", MemoryStorage.messages),
button_add("%NAdd %A%1%%N to %A%2%%N", MemoryStorage.messages), button_add2("Add", MemoryStorage.messages), button_setting("%NSetting %A%1%%N is now: %A%2%%N.", MemoryStorage.messages), button_remove(
"%NRemove %A%1%%N from %A%2%%N", MemoryStorage.messages), button_remove2("Remove", MemoryStorage.messages),
normal_reloadedConfigs("%TAG&aReloaded all configs!", MemoryStorage.messages), normal_joinJoinedArena("%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)", MemoryStorage.messages), normal_leaveYouLeft(
"%TAG%NYou left the arena! Thanks for playing!", MemoryStorage.messages), normal_leaveLeftArena("%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)", MemoryStorage.messages), normal_startForced(
"%TAG%NYou forced to start arena '%A%arenaname%%N'!", MemoryStorage.messages), normal_wandGaveWand("%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)", MemoryStorage.messages), normal_wandSetPosition(
"%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N, %A%z%%N).", MemoryStorage.messages), normal_createCreatedArena(
"%TAG%NCreated an arena with the name '%A%name%%N'.", MemoryStorage.messages), normal_lobbyArenaIsStarting("%TAG%NThe arena will start in %A%1%%N second(s)!", MemoryStorage.messages), normal_lobbyArenaStarted(
"%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!", MemoryStorage.messages), normal_ingameSeekerChoosen(
"%TAG%NPlayer %A%seeker%%N has been choosen as seeker!", MemoryStorage.messages), normal_ingameBlock("%TAG%NYou're disguised as a(n) '%A%block%%N' block.", MemoryStorage.messages), normal_ingameArenaEnd(
"%TAG%NThe arena will end in %A%1%%N second(s)!", MemoryStorage.messages), normal_ingameSeekerSpawned("%TAG%A%playername%%N has spawned as a seeker!", MemoryStorage.messages), normal_ingameGivenSword(
"%TAG%NYou were given a sword!", MemoryStorage.messages), normal_ingameHiderDied("%TAG%NHider %A%playername%%N was killed by %A%killer%%N!", MemoryStorage.messages), normal_ingameHidersLeft(
"%NHider(s) left: %A%left%%N", MemoryStorage.messages), normal_ingameSeekerDied("%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!", MemoryStorage.messages), normal_winSeekers(
"%TAG%NThe %ASEEKERS%N have won!", MemoryStorage.messages), normal_winHiders("%TAG%NThe %AHIDERS%N have won!", MemoryStorage.messages), normal_setwarpWarpSet(
"%TAG%NSet warp '%A%warp%%N' to your location!", MemoryStorage.messages), normal_addedToken("%TAG%A%amount%%N tokens were added to your account!", MemoryStorage.messages), normal_removeRemovedArena(
"%TAG%NRemoved arena '%A%name%%N'!", MemoryStorage.messages), normal_tokensChanged("%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.", MemoryStorage.messages), normal_tokensChangedPerson(
"%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.", MemoryStorage.messages), normal_ingameNowSolid(
"%TAG%NYou're now a solid '%A%block%%N' block!", MemoryStorage.messages), normal_ingameNoMoreSolid("%TAG%NYou're no longer a solid block!", MemoryStorage.messages), normal_shopBoughtItem(
"%TAG%NYou've bought the '%A%itemname%%N' item!", MemoryStorage.messages), normal_shopChoosenBlock("%TAG%NYou've choosen to be a(n) '%A%block%%N' block!", MemoryStorage.messages), normal_shopChoosenSeeker(
"%TAG%NYou've choosen to be a %Aseeker%N!", MemoryStorage.messages), normal_shopChoosenHiders("%TAG%NYou've choosen to be a %Ahider%N!", MemoryStorage.messages), normal_ingameBlocksLeft("%TAG%NRemaining blocks: %A%1%%N", MemoryStorage.messages),
warning_lobbyNeedAtleast("%TAG%WYou need atleast %A%1% player(s) to start the game!", MemoryStorage.messages), warning_ingameNEWSeekerChoosen(
"%TAG%WThe last seeker left and a new seeker has been choosen!", MemoryStorage.messages), warning_unableToCommand(
"%TAG%WSorry but that command is disabled in the arena.", MemoryStorage.messages), warning_ingameNoSolidPlace("%TAG%WThat's not a valid place to become solid!",
MemoryStorage.messages), warning_arenaStopped("%TAG%WThe arena has been forced to stop!", MemoryStorage.messages),
error_noPermission("%TAG%EYou don't have the permissions to do that!", MemoryStorage.messages), error_notANumber("%TAG%E'%A%1%%E' is not a number!", MemoryStorage.messages), error_commandNotEnabled(
"%TAG%EThis command has been disabled!", MemoryStorage.messages), error_commandNotFound("%TAG%ECouldn't find the command. Try %A/" + BlockHunt.pdfFile.getName()
+ " help %Efor more info.", MemoryStorage.messages), error_notEnoughArguments("%TAG%EYou're missing arguments, correct syntax: %A%syntax%", MemoryStorage.messages), error_libsDisguisesNotInstalled(
"%TAG%EThe plugin '%ALib's Disguises%E' is required to run this plugin! Intall it or it won't work!", MemoryStorage.messages), error_protocolLibNotInstalled(
"%TAG%EThe plugin '%AProtocolLib%E' is required to run this plugin! Intall it or it won't work!", MemoryStorage.messages), error_noArena(
"%TAG%ENo arena found with the name '%A%name%%E'.", MemoryStorage.messages), error_onlyIngame("%TAG%EThis is an only in-game command!", MemoryStorage.messages), error_joinAlreadyJoined(
"%TAG%EYou've already joined an arena!", MemoryStorage.messages), error_joinNoBlocksSet("%TAG%EThere are none blocks set for this arena. Notify the administrator.",
MemoryStorage.messages), error_joinWarpsNotSet("%TAG%EThere are no warps set for this arena. Notify the administrator.", MemoryStorage.messages), error_joinArenaIngame(
"%TAG%EThis game has already started.", MemoryStorage.messages), error_joinFull("%TAG%EUnable to join this arena. It's full!", MemoryStorage.messages), error_joinInventoryNotEmpty(
"%TAG%EYour inventory should be empty before joining!", MemoryStorage.messages), error_leaveNotInArena("%TAG%EYou're not in an arena!", MemoryStorage.messages), error_createSelectionFirst(
"%TAG%EMake a selection first. Use the wand command: %A/" + BlockHunt.pdfFile.getName() + " <wand|w>%E.", MemoryStorage.messages), error_createNotSameWorld(
"%TAG%EMake your selection points in the same world!", MemoryStorage.messages), error_setTooHighNumber("%TAG%EThat amount is too high! Max amount is: %A%max%%E.",
MemoryStorage.messages), error_setTooLowNumber("%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.", MemoryStorage.messages), error_setNotABlock(
"%TAG%EThat is not a block!", MemoryStorage.messages), error_setwarpWarpNotFound("%TAG%EWarp '%A%warp%%E' is not valid!", MemoryStorage.messages), error_tokensPlayerNotOnline(
"%TAG%ENo player found with the name '%A%playername%%E'!", MemoryStorage.messages), error_tokensUnknownsetting("%TAG%E'%A%option%%E' is not a known option!", MemoryStorage.messages), error_shopNeedMoreTokens(
"%TAG%EYou need more tokens before you can buy this item.", MemoryStorage.messages), error_shopMaxSeekersReached(
"%TAG%ESorry, the maximum amount of seekers has been reached!", MemoryStorage.messages), error_shopMaxHidersReached(
"%TAG%ESorry, the maximum amount of hiders has been reached!", MemoryStorage.messages),
error_teleportFailed("%TAG%EUnable to teleport you into the arena.", MemoryStorage.messages),
error_teleportBlocked("%TAG%EYou cannot teleport while playing!", MemoryStorage.messages);
public final Object value;
public final ConfigManager config;
public final String location;
/**
* Makes an object from the list above.
*
* @param value Setting in the config file.
* @param config The config file.
*/
ConfigC(Object value, ConfigManager config) {
this.value = value;
this.config = config;
this.location = this.name().replaceAll("_", ".");
}
}

View File

@ -2,6 +2,9 @@ package net.knarcraft.blockhunt;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaProperty;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.config.Permission;
import net.knarcraft.blockhunt.manager.MessageManager;
import net.knarcraft.blockhunt.manager.PermissionsManager;
import org.bukkit.Bukkit;
@ -16,18 +19,18 @@ import java.util.List;
public class InventoryHandler {
public static void openPanel(Player player, String arenaname) {
public static void openPanel(Player player, String arenaName) {
Arena arena = null;
for (Arena arena2 : MemoryStorage.arenaList) {
if (arena2.arenaName.equalsIgnoreCase(arenaname)) {
if (arena2.arenaName.equalsIgnoreCase(arenaName)) {
arena = arena2;
}
}
if (arena != null) {
String shorten = arena.arenaName;
arenaname = arena.arenaName;
arenaName = arena.arenaName;
if (shorten.length() > 6) {
shorten = shorten.substring(0, 6);
}
@ -122,14 +125,14 @@ public class InventoryHandler {
player.openInventory(panel);
} else {
MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_ARENA, "name-" + arenaName);
}
}
public static void updownButton(Inventory panel, Arena arena, ArenaProperty at, String option, String addremove, ItemStack UP, ItemStack BUTTON, ItemStack DOWN, int up,
int button, int down) {
ItemMeta UP_IM = UP.getItemMeta();
UP_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.messages.get(ConfigC.button_add), "1-" + addremove, "2-" + option));
UP_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.messages.get(MessageKey.BUTTON_ADD), "1-" + addremove, "2-" + option));
UP.setItemMeta(UP_IM);
int setting = switch (at) {
@ -148,11 +151,11 @@ public class InventoryHandler {
};
ItemMeta BUTTON_IM = BUTTON.getItemMeta();
BUTTON_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.messages.get(ConfigC.button_setting), "1-" + option, "2-" + setting));
BUTTON_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.messages.get(MessageKey.BUTTON_SETTING), "1-" + option, "2-" + setting));
BUTTON.setItemMeta(BUTTON_IM);
ItemMeta DOWN_IM = DOWN.getItemMeta();
DOWN_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.messages.get(ConfigC.button_remove), "1-" + addremove, "2-" + option));
DOWN_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.messages.get(MessageKey.BUTTON_REMOVE), "1-" + addremove, "2-" + option));
DOWN.setItemMeta(DOWN_IM);
panel.setItem(up, UP);
@ -161,12 +164,12 @@ public class InventoryHandler {
}
public static void openDisguiseBlocks(Arena arena, Player player) {
String arenaname = arena.arenaName;
String arenaName = arena.arenaName;
Inventory panel = Bukkit.createInventory(null, 36, MessageManager.replaceAll("%N&lDisguiseBlocks"));
ItemStack arenaNameNote = new ItemStack(Material.PAPER, 1);
ItemMeta arenaNameNote_IM = arenaNameNote.getItemMeta();
arenaNameNote_IM.setDisplayName(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A" + arenaname));
arenaNameNote_IM.setDisplayName(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A" + arenaName));
ArrayList<String> lores = new ArrayList<>();
lores.add(MessageManager.replaceAll("%NPlace the DisguiseBlocks inside this inventory."));
arenaNameNote_IM.setLore(lores);
@ -181,7 +184,7 @@ public class InventoryHandler {
}
public static void openShop(Player player) {
Inventory shop = Bukkit.createInventory(null, 9, MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)));
Inventory shop = Bukkit.createInventory(null, 9, MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigKey.SHOP_TITLE)));
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", 0);
MemoryStorage.shop.save();
@ -195,40 +198,40 @@ public class InventoryHandler {
shopTokens_IM.setDisplayName(MessageManager.replaceAll("%N&lTokens: %A" + playerTokens));
shopTokens.setItemMeta(shopTokens_IM);
ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1IDname)), 1);
ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_ID_NAME)), 1);
ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta();
shopBlockChooser_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)));
lores = MemoryStorage.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location);
shopBlockChooser_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME)));
lores = MemoryStorage.config.getFile().getStringList(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_DESCRIPTION.getPath());
lores2 = new ArrayList<>();
for (String lore : lores) {
lores2.add(MessageManager.replaceAll(lore));
}
lores2.add(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_price), "amount-" + MemoryStorage.config.get(ConfigC.shop_blockChooserv1Price)));
lores2.add(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_PRICE), "amount-" + MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_PRICE)));
shopBlockChooser_IM.setLore(lores2);
shopBlockChooser.setItemMeta(shopBlockChooser_IM);
ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2IDName)), 1);
ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_ID_NAME)), 1);
ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta();
shopBlockHuntPass_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)));
lores = MemoryStorage.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location);
shopBlockHuntPass_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME)));
lores = MemoryStorage.config.getFile().getStringList(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_DESCRIPTION.getPath());
lores2 = new ArrayList<>();
for (String lore : lores) {
lores2.add(MessageManager.replaceAll(lore));
}
lores2.add(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_price), "amount-" + MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Price)));
lores2.add(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_PRICE), "amount-" + MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_PRICE)));
shopBlockHuntPass_IM.setLore(lores2);
shopBlockHuntPass.setItemMeta(shopBlockHuntPass_IM);
shop.setItem(0, shopTokens);
if ((Boolean) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Enabled)
&& (MemoryStorage.shop.getFile().get(player.getName() + ".blockchooser") == null && !PermissionsManager.hasPerm(player, PermissionsC.Permissions.shopblockchooser, false))) {
if ((Boolean) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_ENABLED)
&& (MemoryStorage.shop.getFile().get(player.getName() + ".blockchooser") == null && !PermissionsManager.hasPerm(player, Permission.SHOP_BLOCK_CHOOSER, false))) {
shop.setItem(1, shopBlockChooser);
}
if ((Boolean) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Enabled)) {
if ((Boolean) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_ENABLED)) {
shop.setItem(2, shopBlockHuntPass);
}
player.openInventory(shop);

View File

@ -1,17 +1,5 @@
package net.knarcraft.blockhunt;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.manager.CommandManager;
import net.knarcraft.blockhunt.manager.ConfigManager;
@ -53,8 +41,8 @@ public class MemoryStorage {
public static final HashMap<Player, Integer> seekertime = new HashMap<>();
public static final HashMap<Player, PlayerArenaData> pData = new HashMap<>();
public static final HashMap<Player, ItemStack> choosenBlock = new HashMap<>();
public static final HashMap<Player, Boolean> choosenSeeker = new HashMap<>();
public static final HashMap<Player, ItemStack> chosenBlock = new HashMap<>();
public static final HashMap<Player, Boolean> chosenSeeker = new HashMap<>();
public static final HashMap<Player, ItemStack> pBlock = new HashMap<>();
public static final HashMap<Player, Location> moveLoc = new HashMap<>();

View File

@ -1,37 +0,0 @@
package net.knarcraft.blockhunt;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
public class PermissionsC {
public static final String main = BlockHunt.pdfFile.getName().toLowerCase() + ".";
public enum PType {
ALL, PLAYER, MODERATOR, ADMIN, OP
}
public enum Permissions {
info("info", PType.ALL), help("help", PType.ALL), reload("reload", PType.ADMIN), join("join", PType.PLAYER), joinfull("joinfull", PType.MODERATOR), joinsign(
"joinsign", PType.PLAYER), leave("leave", PType.PLAYER), list("list", PType.PLAYER), shop("shop", PType.PLAYER), shopblockchooser("shop.blockchooser",
PType.ADMIN), start("start", PType.MODERATOR), create("create", PType.ADMIN), set("set", PType.MODERATOR), setwarp("setwarp", PType.MODERATOR), signcreate(
"signcreate", PType.MODERATOR), remove("remove", PType.ADMIN), tokens("tokens", PType.ADMIN), allcommands("allcommands", PType.OP);
public final String perm;
public final PType type;
Permissions(String perm, PType type) {
this.perm = perm;
this.type = type;
}
}
}

View File

@ -2,6 +2,7 @@ package net.knarcraft.blockhunt;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaState;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@ -12,27 +13,27 @@ import org.bukkit.scoreboard.Scoreboard;
public class ScoreboardHandler {
public static void createScoreboard(Arena arena) {
if ((Boolean) MemoryStorage.config.get(ConfigC.scoreboard_enabled)) {
if ((Boolean) MemoryStorage.config.get(ConfigKey.SCOREBOARD_ENABLED)) {
Scoreboard board = arena.scoreboard;
if (board.getObjective(arena.arenaName) != null) {
updateScoreboard(arena);
return;
}
String displayName = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_title)), 32);
String displayName = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_TITLE)), 32);
Objective object = board.registerNewObjective(BlockHunt.cutString(arena.arenaName, 32), "dummy", displayName);
object.setDisplaySlot(DisplaySlot.SIDEBAR);
String temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_timeleft)), 32);
String temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_TIME_LEFT)), 32);
Score timeleft = object.getScore(temp);
timeleft.setScore(arena.timer);
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_seekers)), 32);
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_SEEKERS)), 32);
Score seekers = object.getScore(temp);
seekers.setScore(arena.seekers.size());
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_hiders)), 32);
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_HIDERS)), 32);
Score hiders = object.getScore(temp);
hiders.setScore(arena.playersInArena.size() - arena.seekers.size());
@ -49,20 +50,20 @@ public class ScoreboardHandler {
}
public static void updateScoreboard(Arena arena) {
if ((Boolean) MemoryStorage.config.get(ConfigC.scoreboard_enabled)) {
if ((Boolean) MemoryStorage.config.get(ConfigKey.SCOREBOARD_ENABLED)) {
Scoreboard board = arena.scoreboard;
Objective object = board.getObjective(DisplaySlot.SIDEBAR);
object.setDisplayName(BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_title)), 32));
object.setDisplayName(BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_TITLE)), 32));
String temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_timeleft)), 32);
String temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_TIME_LEFT)), 32);
Score timeleft = object.getScore(temp);
timeleft.setScore(arena.timer);
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_seekers)), 32);
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_SEEKERS)), 32);
Score seekers = object.getScore(temp);
seekers.setScore(arena.seekers.size());
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.scoreboard_hiders)), 32);
temp = BlockHunt.cutString(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SCOREBOARD_HIDERS)), 32);
Score hiders = object.getScore(temp);
hiders.setScore(arena.playersInArena.size() - arena.seekers.size());

View File

@ -2,6 +2,8 @@ package net.knarcraft.blockhunt;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaState;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Location;
import org.bukkit.block.Sign;
@ -27,7 +29,7 @@ public class SignsHandler {
}
if (!saved) {
MessageManager.sendFMessage(event.getPlayer(), ConfigC.error_noArena, "name-" + lines[1]);
MessageManager.sendFMessage(event.getPlayer(), MessageKey.ERROR_NO_ARENA, "name-" + lines[1]);
}
}
}
@ -52,8 +54,8 @@ public class SignsHandler {
public static void removeSign(Location location) {
//TODO: This seems really inefficient
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
Location loc = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
if (loc.equals(location)) {
Location signLocation = (Location) MemoryStorage.signs.getFile().get(sign + ".location");
if (signLocation != null && signLocation.equals(location)) {
MemoryStorage.signs.getFile().set(sign, null);
MemoryStorage.signs.save();
}
@ -94,9 +96,9 @@ public class SignsHandler {
if (location.getBlock().getState() instanceof Sign signBlock) {
String[] lines = signBlock.getLines();
if (sign.contains("leave")) {
drawSign(MemoryStorage.config.getFile().getStringList(ConfigC.sign_LEAVE.location), signBlock);
drawSign(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_LEAVE.getPath()), signBlock);
} else if (sign.contains("shop")) {
drawSign(MemoryStorage.config.getFile().getStringList(ConfigC.sign_SHOP.location), signBlock);
drawSign(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_SHOP.getPath()), signBlock);
} else {
drawArenaSign(lines[1], signBlock);
}
@ -113,17 +115,17 @@ public class SignsHandler {
continue;
}
if (arena.gameState.equals(ArenaState.WAITING)) {
drawSign(MemoryStorage.config.getFile().getStringList(ConfigC.sign_WAITING.location), signBlock, arena);
drawSign(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_WAITING.getPath()), signBlock, arena);
} else if (arena.gameState.equals(ArenaState.STARTING)) {
drawSign(MemoryStorage.config.getFile().getStringList(ConfigC.sign_STARTING.location), signBlock, arena);
drawSign(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_STARTING.getPath()), signBlock, arena);
} else if (arena.gameState.equals(ArenaState.IN_GAME)) {
drawSign(MemoryStorage.config.getFile().getStringList(ConfigC.sign_INGAME.location), signBlock, arena);
drawSign(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_IN_GAME.getPath()), signBlock, arena);
}
}
}
private static void drawSign(List<String> signLines, Sign signBlock, Arena arena) {
drawSign(signLines, signBlock, "arenaname-" + arena.arenaName, "players-" + arena.playersInArena.size(),
drawSign(signLines, signBlock, "arenaName-" + arena.arenaName, "players-" + arena.playersInArena.size(),
"maxplayers-" + arena.maxPlayers, "timeleft-" + arena.timer);
}

View File

@ -3,6 +3,7 @@ package net.knarcraft.blockhunt;
import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
import me.libraryaddict.disguise.disguisetypes.MiscDisguise;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -13,13 +14,16 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.util.logging.Level;
public class SolidBlockHandler {
public static void makePlayerUnsolid(Player player) {
ItemStack block = player.getInventory().getItem(8);
if (block == null) {
player.sendMessage(ChatColor.RED + "Unable to hide you because your inventory block is missing!");
System.out.println("[BlockHunt] ERROR: " + player.getName() + " could not be hidden because their inventory block was missing!");
BlockHunt.plugin.getLogger().log(Level.SEVERE, player.getName() + " could not be hidden because " +
"their inventory block was missing!");
return;
}
@ -57,7 +61,7 @@ public class SolidBlockHandler {
MiscDisguise disguise = new MiscDisguise(DisguiseType.FALLING_BLOCK, block.getType());
DisguiseAPI.disguiseToAll(player, disguise);
MessageManager.sendFMessage(player, ConfigC.normal_ingameNoMoreSolid);
MessageManager.sendFMessage(player, MessageKey.NORMAL_IN_GAME_NO_MORE_SOLID);
}
}

View File

@ -2,13 +2,15 @@ package net.knarcraft.blockhunt.arena;
import me.libraryaddict.disguise.DisguiseAPI;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.PermissionsC;
import net.knarcraft.blockhunt.PlayerArenaData;
import net.knarcraft.blockhunt.PlayerHandler;
import net.knarcraft.blockhunt.ScoreboardHandler;
import net.knarcraft.blockhunt.SignsHandler;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.Key;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.config.Permission;
import net.knarcraft.blockhunt.event.EndArenaEvent;
import net.knarcraft.blockhunt.event.JoinArenaEvent;
import net.knarcraft.blockhunt.event.LeaveArenaEvent;
@ -28,6 +30,7 @@ import org.bukkit.potion.PotionEffect;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
public class ArenaHandler {
@ -42,17 +45,21 @@ public class ArenaHandler {
}
}
public static void sendMessage(Arena arena, String message, String... vars) {
public static void sendMessage(Arena arena, String message, String... variables) {
for (Player player : arena.playersInArena) {
String pMessage = message.replaceAll("%player%", player.getDisplayName());
player.sendMessage(MessageManager.replaceAll(pMessage, vars));
String playerMessage = message.replaceAll("%player%", player.getDisplayName());
player.sendMessage(MessageManager.replaceAll(playerMessage, variables));
}
}
public static void sendFMessage(Arena arena, ConfigC location, String... vars) {
public static void sendFMessage(Arena arena, Key location, String... variables) {
for (Player player : arena.playersInArena) {
String pMessage = location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName());
player.sendMessage(MessageManager.replaceAll(pMessage, vars));
Location realLocation = location.getConfigManager().getFile().getLocation(location.getPath());
if (realLocation == null) {
continue;
}
String playerMessage = realLocation.toString().replaceAll("%player%", player.getDisplayName());
player.sendMessage(MessageManager.replaceAll(playerMessage, variables));
}
}
@ -71,7 +78,7 @@ public class ArenaHandler {
if (arena.arenaName.equalsIgnoreCase(arenaName)) {
found = true;
if (arena.disguiseBlocks.isEmpty()) {
MessageManager.sendFMessage(player, ConfigC.error_joinNoBlocksSet);
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_NO_BLOCKS_SET);
} else {
boolean inventoryEmpty = true;
for (ItemStack inventoryItem : player.getInventory()) {
@ -90,8 +97,8 @@ public class ArenaHandler {
}
}
if ((Boolean) MemoryStorage.config.get(ConfigC.requireInventoryClearOnJoin) && !inventoryEmpty) {
MessageManager.sendFMessage(player, ConfigC.error_joinInventoryNotEmpty);
if ((Boolean) MemoryStorage.config.get(ConfigKey.REQUIRE_INVENTORY_CLEAR_ON_JOIN) && !inventoryEmpty) {
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_INVENTORY_NOT_EMPTY);
return;
}
@ -100,19 +107,19 @@ public class ArenaHandler {
if (!arena.lobbyWarp.equals(zero) && !arena.hidersWarp.equals(zero) && !arena.seekersWarp.equals(zero) && !arena.spawnWarp.equals(zero)) {
if (arena.gameState == ArenaState.WAITING || arena.gameState == ArenaState.STARTING) {
if (arena.playersInArena.size() >= arena.maxPlayers) {
if (!PermissionsManager.hasPerm(player, PermissionsC.Permissions.joinfull, false)) {
MessageManager.sendFMessage(player, ConfigC.error_joinFull);
if (!PermissionsManager.hasPerm(player, Permission.JOIN_FULL, false)) {
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_FULL);
return;
}
}
boolean canWarp = PlayerHandler.teleport(player, arena.lobbyWarp);
if (!canWarp) {
MessageManager.sendFMessage(player, ConfigC.error_teleportFailed);
MessageManager.sendFMessage(player, MessageKey.ERROR_TELEPORT_FAILED);
return;
}
System.out.println("[BlockHunt] " + player.getName() + " has joined " + arenaName);
BlockHunt.plugin.getLogger().log(Level.INFO, player.getName() + " has joined " + arenaName);
arena.playersInArena.add(player);
JoinArenaEvent event = new JoinArenaEvent(player, arena);
Bukkit.getPluginManager().callEvent(event);
@ -163,13 +170,13 @@ public class ArenaHandler {
// player
}
if ((Boolean) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Enabled)) {
if ((Boolean) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_ENABLED)) {
if (MemoryStorage.shop.getFile().get(player.getName() + ".blockchooser") != null
|| PermissionsManager.hasPerm(player, PermissionsC.Permissions.shopblockchooser, false)) {
ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1IDname)), 1);
|| PermissionsManager.hasPerm(player, Permission.SHOP_BLOCK_CHOOSER, false)) {
ItemStack shopBlockChooser = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_ID_NAME)), 1);
ItemMeta shopBlockChooser_IM = shopBlockChooser.getItemMeta();
shopBlockChooser_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)));
List<String> loreStrings = MemoryStorage.config.getFile().getStringList(ConfigC.shop_blockChooserv1Description.location);
shopBlockChooser_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME)));
List<String> loreStrings = MemoryStorage.config.getFile().getStringList(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_DESCRIPTION.getPath());
List<String> loreStrings2 = new ArrayList<>();
for (String lore : loreStrings) {
loreStrings2.add(MessageManager.replaceAll(lore));
@ -181,13 +188,13 @@ public class ArenaHandler {
}
}
if ((Boolean) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Enabled)) {
if ((Boolean) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_ENABLED)) {
if (MemoryStorage.shop.getFile().getInt(player.getName() + ".blockhuntpass") != 0) {
ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2IDName)),
ItemStack shopBlockHuntPass = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_ID_NAME)),
1);
ItemMeta shopBlockHuntPass_IM = shopBlockHuntPass.getItemMeta();
shopBlockHuntPass_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)));
List<String> loreStrings = MemoryStorage.config.getFile().getStringList(ConfigC.shop_BlockHuntPassv2Description.location);
shopBlockHuntPass_IM.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME)));
List<String> loreStrings = MemoryStorage.config.getFile().getStringList(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_DESCRIPTION.getPath());
List<String> loreStrings2 = new ArrayList<>();
for (String lore : loreStrings) {
loreStrings2.add(MessageManager.replaceAll(lore));
@ -204,30 +211,30 @@ public class ArenaHandler {
DisguiseAPI.undisguiseToAll(player);
ArenaHandler.sendFMessage(arena, ConfigC.normal_joinJoinedArena, "playername-" + player.getName(),
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_JOIN_JOINED_ARENA, "%playerName%-" + player.getName(),
"1-" + arena.playersInArena.size(), "2-" + arena.maxPlayers);
if (arena.playersInArena.size() < arena.minPlayers) {
sendFMessage(arena, ConfigC.warning_lobbyNeedAtleast, "1-" + arena.minPlayers);
sendFMessage(arena, MessageKey.WARNING_LOBBY_NEED_AT_LEAST, "1-" + arena.minPlayers);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_joinArenaIngame);
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_ARENA_IN_GAME);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_joinWarpsNotSet);
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_WARPS_NOT_SET);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_joinWarpsNotSet);
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_WARPS_NOT_SET);
}
}
}
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_joinAlreadyJoined);
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_ALREADY_JOINED);
return;
}
if (!found) {
MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaName);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_ARENA, "name-" + arenaName);
}
SignsHandler.updateSigns();
@ -245,7 +252,7 @@ public class ArenaHandler {
}
if (arena != null) {
System.out.println("[BlockHunt] " + player.getName() + " has left " + arena.arenaName);
BlockHunt.plugin.getLogger().log(Level.INFO, player.getName() + " has left " + arena.arenaName);
LeaveArenaEvent event = new LeaveArenaEvent(player, arena);
Bukkit.getPluginManager().callEvent(event);
@ -259,7 +266,7 @@ public class ArenaHandler {
arena.gameState = ArenaState.WAITING;
arena.timer = 0;
sendFMessage(arena, ConfigC.warning_lobbyNeedAtleast, "1-" + arena.minPlayers);
sendFMessage(arena, MessageKey.WARNING_LOBBY_NEED_AT_LEAST, "1-" + arena.minPlayers);
}
if (arena.playersInArena.size() <= 1 && arena.gameState == ArenaState.IN_GAME) {
@ -276,8 +283,8 @@ public class ArenaHandler {
if (arena.seekers.size() <= 0 && arena.gameState == ArenaState.IN_GAME) {
Player seeker = arena.playersInArena.get(MemoryStorage.random.nextInt(arena.playersInArena.size()));
ArenaHandler.sendFMessage(arena, ConfigC.warning_ingameNEWSeekerChoosen, "seeker-" + seeker.getName());
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameSeekerChoosen, "seeker-" + seeker.getName());
ArenaHandler.sendFMessage(arena, MessageKey.WARNING_IN_GAME_NEW_SEEKER_CHOSEN, "seeker-" + seeker.getName());
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_SEEKER_CHOSEN, "seeker-" + seeker.getName());
DisguiseAPI.undisguiseToAll(seeker);
for (Player pl : Bukkit.getOnlinePlayers()) {
pl.showPlayer(BlockHunt.plugin, seeker);
@ -328,7 +335,7 @@ public class ArenaHandler {
player.setWalkSpeed(0.2F);
MemoryStorage.pData.remove(player);
MemoryStorage.choosenBlock.remove(player);
MemoryStorage.chosenBlock.remove(player);
for (Player pl : Bukkit.getOnlinePlayers()) {
pl.showPlayer(BlockHunt.plugin, player);
@ -348,14 +355,14 @@ public class ArenaHandler {
ScoreboardHandler.removeScoreboard(player);
MessageManager.sendFMessage(player, ConfigC.normal_leaveYouLeft);
MessageManager.sendFMessage(player, MessageKey.NORMAL_LEAVE_YOU_LEFT);
if (message) {
ArenaHandler.sendFMessage(arena, ConfigC.normal_leaveLeftArena, "playername-" + player.getName(), "1-" + arena.playersInArena.size(), "2-"
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_LEAVE_LEFT_ARENA, "%playerName%-" + player.getName(), "1-" + arena.playersInArena.size(), "2-"
+ arena.maxPlayers);
}
} else {
if (message) {
MessageManager.sendFMessage(player, ConfigC.error_leaveNotInArena);
MessageManager.sendFMessage(player, MessageKey.ERROR_LEAVE_NOT_IN_ARENA);
}
return;
}
@ -388,7 +395,7 @@ public class ArenaHandler {
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens + arena.seekersTokenWin);
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + arena.seekersTokenWin);
MessageManager.sendFMessage(player, MessageKey.NORMAL_ADDED_TOKEN, "amount-" + arena.seekersTokenWin);
}
@ -399,7 +406,7 @@ public class ArenaHandler {
EndArenaEvent event = new EndArenaEvent(winners, losers, arena);
Bukkit.getServer().getPluginManager().callEvent(event);
stopArena(arena, cause, ConfigC.normal_winSeekers);
stopArena(arena, cause, MessageKey.normal_winSeekers);
}
public static void hidersWin(Arena arena) {
@ -429,7 +436,7 @@ public class ArenaHandler {
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens + arena.hidersTokenWin);
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + arena.hidersTokenWin);
MessageManager.sendFMessage(player, MessageKey.NORMAL_ADDED_TOKEN, "amount-" + arena.hidersTokenWin);
}
}
@ -437,11 +444,11 @@ public class ArenaHandler {
EndArenaEvent event = new EndArenaEvent(winners, losers, arena);
Bukkit.getServer().getPluginManager().callEvent(event);
stopArena(arena, cause, ConfigC.normal_winHiders);
stopArena(arena, cause, MessageKey.NORMAL_WIN_HIDERS);
}
public static void stopArena(Arena arena, String cause, ConfigC message) {
System.out.println(cause);
public static void stopArena(Arena arena, String cause, Key message) {
BlockHunt.plugin.getLogger().log(Level.INFO, cause);
ArenaHandler.sendFMessage(arena, message);
arena.seekers.clear();

View File

@ -7,5 +7,5 @@ public enum ArenaState {
IN_GAME,
RESTARTING,
DISABLED
}

View File

@ -1,11 +1,11 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.ScoreboardHandler;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaState;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
@ -19,7 +19,7 @@ public class CreateCommand extends DefaultCommand {
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
if (args.length <= 1) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDCreate.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDCreate.usage);
} else {
if (MemoryStorage.pos1.get(player) != null && MemoryStorage.pos2.get(player) != null) {
if (MemoryStorage.pos1.get(player).getWorld().equals(MemoryStorage.pos2.get(player).getWorld())) {
@ -33,12 +33,12 @@ public class CreateCommand extends DefaultCommand {
MemoryStorage.arenaList.add(arena);
ScoreboardHandler.createScoreboard(arena);
MessageManager.sendFMessage(player, ConfigC.normal_createCreatedArena, "name-" + args[1]);
MessageManager.sendFMessage(player, MessageKey.NORMAL_CREATE_CREATED_ARENA, "name-" + args[1]);
} else {
MessageManager.sendFMessage(player, ConfigC.error_createNotSameWorld);
MessageManager.sendFMessage(player, MessageKey.ERROR_CREATE_NOT_SAME_WORLD);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_createSelectionFirst);
MessageManager.sendFMessage(player, MessageKey.ERROR_CREATE_SELECTION_FIRST);
}
}
}

View File

@ -1,15 +1,4 @@
package net.knarcraft.blockhunt.command;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import org.bukkit.command.Command;
import org.bukkit.entity.Player;

View File

@ -1,19 +1,8 @@
package net.knarcraft.blockhunt.command;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.manager.CommandManager;
import net.knarcraft.blockhunt.manager.MessageManager;
import net.knarcraft.blockhunt.manager.PermissionsManager;
@ -39,15 +28,15 @@ public class HelpCommand extends DefaultCommand {
int page = 1;
if (args.length == 1) {
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages);
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-" + BlockHunt.getPluginDescriptionFile().getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages);
int i = 1;
for (CommandManager command : MemoryStorage.commands) {
if (i <= 4) {
if (command.usage != null) {
if (PermissionsManager.hasPerm(player, command.permission, false)) {
MessageManager.sendMessage(player, "%A" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.location));
MessageManager.sendMessage(player, "%A" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.getPath()));
} else {
MessageManager.sendMessage(player, "%MemoryStorage" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.location));
MessageManager.sendMessage(player, "%MemoryStorage" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.getPath()));
}
i = i + 1;
}
@ -64,7 +53,7 @@ public class HelpCommand extends DefaultCommand {
maxPages = page;
}
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages);
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-" + BlockHunt.getPluginDescriptionFile().getName() + " %Nhelp page %A" + page + "%N/%A" + maxPages);
int i = 1;
for (CommandManager command : MemoryStorage.commands) {
@ -72,9 +61,9 @@ public class HelpCommand extends DefaultCommand {
if (command.usage != null) {
if (i >= ((page - 1) * 4) + 1 && i <= ((page - 1) * 4) + 4) {
if (PermissionsManager.hasPerm(player, command.permission, false)) {
MessageManager.sendMessage(player, "%A" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.location));
MessageManager.sendMessage(player, "%A" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.getPath()));
} else {
MessageManager.sendMessage(player, "%MemoryStorage" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.location));
MessageManager.sendMessage(player, "%MemoryStorage" + command.usage + "%N - " + MemoryStorage.messages.getFile().get(command.help.getPath()));
}
}
i = i + 1;
@ -82,7 +71,7 @@ public class HelpCommand extends DefaultCommand {
}
}
}
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oHelp Page");
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-&oHelp Page");
return true;
}
}

View File

@ -1,18 +1,7 @@
package net.knarcraft.blockhunt.command;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -22,14 +11,15 @@ public class InfoCommand extends DefaultCommand {
@Override
public boolean execute(Player player, Command cmd, String label, String[] args) {
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName());
MessageManager.sendMessage(player, "%A%name%%N made by %A%authors%%N.", "name-" + BlockHunt.pdfFile.getName(), "authors-" + BlockHunt.pdfFile.getAuthors().get(0));
MessageManager.sendMessage(player, "%NVersion: %A%version%%N.", "version-" + BlockHunt.pdfFile.getVersion());
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-" + BlockHunt.getPluginDescriptionFile().getName());
MessageManager.sendMessage(player, "%A%name%%N made by %A%authors%%N.", "name-" +
BlockHunt.getPluginDescriptionFile().getName(), "authors-" + BlockHunt.getPluginDescriptionFile().getAuthors().get(0));
MessageManager.sendMessage(player, "%NVersion: %A%version%%N.", "version-" + BlockHunt.getPluginDescriptionFile().getVersion());
MessageManager.sendMessage(player, "%NType %A%helpusage% %Nfor help.", "helpusage-" + BlockHunt.CMDHelp.usage);
MessageManager.sendMessage(player, "%NDev-Page: %Ahttp://dev.bukkit.org/bukkit-plugins/blockhunt/");
MessageManager.sendMessage(player, "%NDonations are welcome!");
MessageManager.sendMessage(player, "%NMade by help from some friends &c<3%N!");
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oInfo Page");
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-&oInfo Page");
return true;
}
}

View File

@ -1,8 +1,8 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -13,12 +13,12 @@ public class JoinCommand extends DefaultCommand {
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
if (args.length <= 1) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDJoin.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDJoin.usage);
} else {
ArenaHandler.playerJoinArena(player, args[1]);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(null, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -1,7 +1,7 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -13,7 +13,7 @@ public class LeaveCommand extends DefaultCommand {
if (player != null) {
ArenaHandler.playerLeaveArena(player, true, true);
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(null, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -1,9 +1,9 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -12,7 +12,7 @@ public class ListCommand extends DefaultCommand {
@Override
public boolean execute(Player player, Command cmd, String label, String[] args) {
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-" + BlockHunt.pdfFile.getName());
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-" + BlockHunt.getPluginDescriptionFile().getName());
if (MemoryStorage.arenaList.size() >= 1) {
MessageManager.sendMessage(player, "&7Available arena(s):");
for (Arena arena : MemoryStorage.arenaList) {
@ -22,7 +22,7 @@ public class ListCommand extends DefaultCommand {
MessageManager.sendMessage(player, "&7&oNo arenas available...");
MessageManager.sendMessage(player, "&7&oCreate an arena first please.");
}
MessageManager.sendFMessage(player, ConfigC.chat_headerhigh, "header-&oArenas list");
MessageManager.sendFMessage(player, ConfigKey.CHAT_HEADER_HIGH, "header-&oArenas list");
return true;
}
}

View File

@ -1,17 +1,6 @@
package net.knarcraft.blockhunt.command;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -20,7 +9,7 @@ public class NotFoundCommand extends DefaultCommand {
@Override
public boolean execute(Player player, Command cmd, String label, String[] args) {
MessageManager.sendFMessage(player, ConfigC.error_commandNotFound);
MessageManager.sendFMessage(player, MessageKey.ERROR_COMMAND_NOT_FOUND);
return true;
}
}

View File

@ -1,20 +1,9 @@
package net.knarcraft.blockhunt.command;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.ConfigManager;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
@ -34,11 +23,11 @@ public class ReloadCommand extends DefaultCommand {
MemoryStorage.shop.load();
for (Arena arena : MemoryStorage.arenaList) {
String cause = "[BlockHunt] Arena " + arena.arenaName + " has been stopped";
ArenaHandler.stopArena(arena, cause, ConfigC.warning_arenaStopped);
ArenaHandler.stopArena(arena, cause, MessageKey.WARNING_ARENA_STOPPED);
}
ArenaHandler.loadArenas();
MessageManager.sendFMessage(player, ConfigC.normal_reloadedConfigs);
MessageManager.sendFMessage(player, MessageKey.NORMAL_RELOADED_CONFIGS);
return true;
}
}

View File

@ -1,9 +1,9 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Effect;
import org.bukkit.Location;
@ -18,11 +18,11 @@ public class RemoveCommand extends DefaultCommand {
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
if (args.length <= 1) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDRemove.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDRemove.usage);
} else {
for (Arena arena : MemoryStorage.arenaList) {
if (args[1].equalsIgnoreCase(arena.arenaName)) {
MessageManager.sendFMessage(player, ConfigC.normal_removeRemovedArena, "name-" + args[1]);
MessageManager.sendFMessage(player, MessageKey.NORMAL_REMOVE_REMOVED_ARENA, "name-" + args[1]);
MemoryStorage.arenas.getFile().set(args[1], null);
for (String sign : MemoryStorage.signs.getFile().getKeys(false)) {
if (MemoryStorage.signs.getFile().get(sign + ".arenaName").toString().equalsIgnoreCase(args[1])) {
@ -42,10 +42,10 @@ public class RemoveCommand extends DefaultCommand {
}
}
MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_ARENA, "name-" + args[1]);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(player, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -1,8 +1,8 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.InventoryHandler;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -13,13 +13,13 @@ public class SetCommand extends DefaultCommand {
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
if (args.length <= 1) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDSet.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDSet.usage);
} else {
String arenaname = args[1];
InventoryHandler.openPanel(player, arenaname);
String arenaName = args[1];
InventoryHandler.openPanel(player, arenaName);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(player, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -1,10 +1,10 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Location;
import org.bukkit.command.Command;
@ -16,14 +16,14 @@ public class SetWarpCommand extends DefaultCommand {
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
if (args.length <= 2) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDSetWarp.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDSetWarp.usage);
} else {
String arenaname = args[2];
String arenaName = args[2];
String warpname = args[1];
Arena arena = null;
for (Arena arena2 : MemoryStorage.arenaList) {
if (arena2.arenaName.equalsIgnoreCase(arenaname)) {
if (arena2.arenaName.equalsIgnoreCase(arenaName)) {
arena = arena2;
}
}
@ -32,28 +32,28 @@ public class SetWarpCommand extends DefaultCommand {
if (warpname.equalsIgnoreCase("lobby")) {
arena.lobbyWarp = loc;
save(arena);
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
MessageManager.sendFMessage(player, MessageKey.NORMAL_SET_WARP_WARP_SET, "warp-" + warpname);
} else if (warpname.equalsIgnoreCase("hiders")) {
arena.hidersWarp = loc;
save(arena);
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
MessageManager.sendFMessage(player, MessageKey.NORMAL_SET_WARP_WARP_SET, "warp-" + warpname);
} else if (warpname.equalsIgnoreCase("seekers")) {
arena.seekersWarp = loc;
save(arena);
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
MessageManager.sendFMessage(player, MessageKey.NORMAL_SET_WARP_WARP_SET, "warp-" + warpname);
} else if (warpname.equalsIgnoreCase("spawn")) {
arena.spawnWarp = loc;
save(arena);
MessageManager.sendFMessage(player, ConfigC.normal_setwarpWarpSet, "warp-" + warpname);
MessageManager.sendFMessage(player, MessageKey.NORMAL_SET_WARP_WARP_SET, "warp-" + warpname);
} else {
MessageManager.sendFMessage(player, ConfigC.error_setwarpWarpNotFound, "warp-" + warpname);
MessageManager.sendFMessage(player, MessageKey.ERROR_SET_WARP_WARP_NOT_FOUND, "warp-" + warpname);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + arenaname);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_ARENA, "name-" + arenaName);
}
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(null, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -1,10 +1,10 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaState;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
@ -15,7 +15,7 @@ public class StartCommand extends DefaultCommand {
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
if (args.length <= 1) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDStart.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDStart.usage);
} else {
Arena arena = null;
for (Arena arena2 : MemoryStorage.arenaList) {
@ -29,9 +29,9 @@ public class StartCommand extends DefaultCommand {
if (arena.playersInArena.size() >= 2) {
arena.timer = 11;
arena.gameState = ArenaState.STARTING;
MessageManager.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName);
MessageManager.sendFMessage(player, MessageKey.NORMAL_START_FORCED, "arenaName-" + arena.arenaName);
} else {
MessageManager.sendFMessage(player, ConfigC.warning_lobbyNeedAtleast, "1-2");
MessageManager.sendFMessage(player, MessageKey.WARNING_LOBBY_NEED_AT_LEAST, "1-2");
}
} else if (arena.gameState.equals(ArenaState.STARTING)) {
if (arena.playersInArena.size() < arena.maxPlayers) {
@ -42,14 +42,14 @@ public class StartCommand extends DefaultCommand {
arena.timer = 1;
}
MessageManager.sendFMessage(player, ConfigC.normal_startForced, "arenaname-" + arena.arenaName);
MessageManager.sendFMessage(player, MessageKey.NORMAL_START_FORCED, "arenaName-" + arena.arenaName);
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_noArena, "name-" + args[1]);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_ARENA, "name-" + args[1]);
}
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(null, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -1,19 +1,8 @@
package net.knarcraft.blockhunt.command;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
@ -25,7 +14,7 @@ public class TokensCommand extends DefaultCommand {
@Override
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (args.length <= 3) {
MessageManager.sendFMessage(player, ConfigC.error_notEnoughArguments, "syntax-" + BlockHunt.CMDTokens.usage);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_ENOUGH_ARGUMENTS, "syntax-" + BlockHunt.CMDTokens.usage);
} else {
String option = args[1];
String playerName = args[2];
@ -33,13 +22,13 @@ public class TokensCommand extends DefaultCommand {
try {
amount = Integer.parseInt(args[3]);
} catch (NumberFormatException e) {
MessageManager.sendFMessage(player, ConfigC.error_notANumber, "1-" + args[3]);
MessageManager.sendFMessage(player, MessageKey.ERROR_NOT_A_NUMBER, "1-" + args[3]);
return true;
}
Player tokenPlayer = Bukkit.getPlayer(playerName);
if (tokenPlayer == null) {
MessageManager.sendFMessage(player, ConfigC.error_tokensPlayerNotOnline, "playername-" + playerName);
MessageManager.sendFMessage(player, MessageKey.ERROR_TOKENS_PLAYER_NOT_ONLINE, "%playerName%-" + playerName);
return true;
}
String name = "\u00A78Console";
@ -50,8 +39,8 @@ public class TokensCommand extends DefaultCommand {
if (option.equalsIgnoreCase("set")) {
MemoryStorage.shop.getFile().set(tokenPlayer.getName() + ".tokens", amount);
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Set", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount);
MessageManager.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-set", "playername-" + name, "option2-to", "amount-" + amount);
MessageManager.sendFMessage(player, MessageKey.NORMAL_TOKENS_CHANGED, "option-Set", "%playerName%-" + tokenPlayer.getName(), "option2-to", "amount-" + amount);
MessageManager.sendFMessage(tokenPlayer, MessageKey.NORMAL_TOKENS_CHANGED_PERSON, "option-set", "%playerName%-" + name, "option2-to", "amount-" + amount);
} else if (option.equalsIgnoreCase("add")) {
int tokens = 0;
if (MemoryStorage.shop.getFile().getInt(tokenPlayer.getName() + ".tokens") != 0) {
@ -59,8 +48,8 @@ public class TokensCommand extends DefaultCommand {
}
MemoryStorage.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens + amount);
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Added", "playername-" + tokenPlayer.getName(), "option2-to", "amount-" + amount);
MessageManager.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-added", "playername-" + name, "option2-to", "amount-" + amount);
MessageManager.sendFMessage(player, MessageKey.NORMAL_TOKENS_CHANGED, "option-Added", "%playerName%-" + tokenPlayer.getName(), "option2-to", "amount-" + amount);
MessageManager.sendFMessage(tokenPlayer, MessageKey.NORMAL_TOKENS_CHANGED_PERSON, "option-added", "%playerName%-" + name, "option2-to", "amount-" + amount);
} else if (option.equalsIgnoreCase("take")) {
int tokens = 0;
if (MemoryStorage.shop.getFile().getInt(tokenPlayer.getName() + ".tokens") != 0) {
@ -68,10 +57,10 @@ public class TokensCommand extends DefaultCommand {
}
MemoryStorage.shop.getFile().set(tokenPlayer.getName() + ".tokens", tokens - amount);
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_tokensChanged, "option-Took", "playername-" + tokenPlayer.getName(), "option2-from", "amount-" + amount);
MessageManager.sendFMessage(tokenPlayer, ConfigC.normal_tokensChangedPerson, "option-took", "playername-" + name, "option2-from", "amount-" + amount);
MessageManager.sendFMessage(player, MessageKey.NORMAL_TOKENS_CHANGED, "option-Took", "%playerName%-" + tokenPlayer.getName(), "option2-from", "amount-" + amount);
MessageManager.sendFMessage(tokenPlayer, MessageKey.NORMAL_TOKENS_CHANGED_PERSON, "option-took", "%playerName%-" + name, "option2-from", "amount-" + amount);
} else {
MessageManager.sendFMessage(player, ConfigC.error_tokensUnknownsetting, "option-" + option);
MessageManager.sendFMessage(player, MessageKey.ERROR_TOKENS_UNKNOWN_SETTING, "option-" + option);
}
}
return true;

View File

@ -1,7 +1,8 @@
package net.knarcraft.blockhunt.command;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -18,23 +19,23 @@ public class WandCommand extends DefaultCommand {
@Override
public boolean execute(Player player, Command cmd, String label, String[] args) {
if (player != null) {
ItemStack wand = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigC.wandIDname)));
ItemStack wand = new ItemStack(Material.getMaterial((String) MemoryStorage.config.get(ConfigKey.WAND_ID_NAME)));
ItemMeta im = wand.getItemMeta();
im.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.wandName)));
im.setDisplayName(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.WAND_NAME)));
MemoryStorage.config.load();
List<String> lores = MemoryStorage.config.getFile().getStringList(ConfigC.wandDescription.location);
List<String> lores2 = new ArrayList<>();
for (String lore : lores) {
lores2.add(MessageManager.replaceAll(lore));
List<String> loreLines = MemoryStorage.config.getFile().getStringList(ConfigKey.WAND_DESCRIPTION.getPath());
List<String> loreLines2 = new ArrayList<>();
for (String lore : loreLines) {
loreLines2.add(MessageManager.replaceAll(lore));
}
im.setLore(lores2);
im.setLore(loreLines2);
wand.setItemMeta(im);
player.getInventory().addItem(wand);
player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 5, 0);
MessageManager.sendFMessage(player, ConfigC.normal_wandGaveWand, "type-" + wand.getType().toString().replaceAll("_", " ").toLowerCase());
MessageManager.sendFMessage(player, MessageKey.NORMAL_WAND_GAVE_WAND, "type-" + wand.getType().toString().replaceAll("_", " ").toLowerCase());
} else {
MessageManager.sendFMessage(player, ConfigC.error_onlyIngame);
MessageManager.sendFMessage(null, MessageKey.ERROR_ONLY_IN_GAME);
}
return true;
}

View File

@ -0,0 +1,114 @@
package net.knarcraft.blockhunt.config;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.manager.ConfigManager;
/**
* A key pointing to a value in config.yml
*/
public enum ConfigKey implements Key {
CHAT_TAG("[" + BlockHunt.getPluginDescriptionFile().getName() + "] ", "chat.tag"),
CHAT_NORMAL("&b", "chat.normal"),
CHAT_WARNING("&c", "chat.warning"),
CHAT_ERROR("&c", "chat.error"),
CHAT_ARGUMENT("&e", "chat.arg"),
CHAT_HEADER("&9", "chat.header"),
CHAT_HEADER_HIGH("%H_______.[ %A%header%%H ]._______", "chat.headerHigh"),
COMMAND_ENABLED_INFO(true, "commandEnabled.info"),
COMMAND_ENABLED_HELP(true, "commandEnabled.help"),
COMMAND_ENABLED_RELOAD(true, "commandEnabled.reload"),
COMMAND_ENABLED_JOIN(true, "commandEnabled.join"),
COMMAND_ENABLED_LEAVE(true, "commandEnabled.leave"),
COMMAND_ENABLED_LIST(true, "commandEnabled.list"),
COMMAND_ENABLED_SHOP(true, "commandEnabled.shop"),
COMMAND_ENABLED_START(true, "commandEnabled.start"),
COMMAND_ENABLED_WAND(true, "commandEnabled.wand"),
COMMAND_ENABLED_CREATE(true, "commandEnabled.create"),
COMMAND_ENABLED_SET(true, "commandEnabled.set"),
COMMAND_ENABLED_SET_WARP(true, "commandEnabled.setWarp"),
COMMAND_ENABLED_REMOVE(true, "commandEnabled.remove"),
COMMAND_ENABLED_TOKENS(true, "commandEnabled.tokens"),
AUTO_UPDATE_CHECK(true, "autoUpdateCheck"),
AUTO_DOWNLOAD_UPDATE(false, "autoDownloadUpdate"),
WAND_ID_NAME("STICK", "wandIdName"),
WAND_NAME("%A&l" + BlockHunt.getPluginDescriptionFile().getName() + "%N's selection wand", "wandName"),
WAND_DESCRIPTION(new String[]{"%NUse this item to select an arena for your arena.",
"%ALeft-Click%N to select point #1.", "%ARight-Click%N to select point #2.",
"%NUse the create command to define your arena.", "%A/" + BlockHunt.getPluginDescriptionFile().getName() + " <help|h>"},
"wandDescription"),
SHOP_TITLE("%H&lBlockHunt %NShop", "shop.title"),
SHOP_PRICE("%NPrice: %A%amount% %Ntokens.", "shop.price"),
SHOP_BLOCK_CHOOSER_V_1_ENABLED(true, "shop.blockChooserV1Enabled"),
SHOP_BLOCK_CHOOSER_V_1_ID_NAME("BOOK", "shop.blockChooserV1IdName"),
SHOP_BLOCK_CHOOSER_V_1_PRICE(3000, "shop.blockChooserV1Price"),
SHOP_BLOCK_CHOOSER_V_1_NAME("%H&lBlockHunt Chooser", "shop.blockChooserV1Name"),
SHOP_BLOCK_CHOOSER_V_1_DESCRIPTION(new String[]{"%NUse this item before the arena starts.",
"%ARight-Click%N in the lobby and choose", "%Nthe block you want to be!", "&6Unlimited uses."},
"shop.blockChooserV1Description"),
SHOP_BLOCK_HUNT_PASS_V_2_ENABLED(true, "shop.blockHuntPassV2Enabled"),
SHOP_BLOCK_HUNT_PASS_V_2_ID_NAME("NAME_TAG", "shop.blockHuntPassV2IdName"),
SHOP_BLOCK_HUNT_PASS_V_2_PRICE(150, "shop.blockHuntPassV2Price"),
SHOP_BLOCK_HUNT_PASS_V_2_NAME("%H&lBlockHunt Pass", "shop.blockHuntPassV2Name"),
SHOP_BLOCK_HUNT_PASS_V_2_DESCRIPTION(new String[]{"%NUse this item before the arena starts.",
"%ARight-Click%N in the lobby and choose", "%Nif you want to be a Hider or a Seeker!", "&61 time use.",},
"shop.blockHuntPassV2Description"),
SIGN_LEAVE(new String[]{"%H[" + BlockHunt.getPluginDescriptionFile().getName() + "%H]", "&4LEAVE", "&8Right-Click", "&8To leave."},
"sign.leave"),
SIGN_SHOP(new String[]{"%H[" + BlockHunt.getPluginDescriptionFile().getName() + "%H]", "&4SHOP", "&8Right-Click", "&8To shop."},
"sign.shop"),
SIGN_WAITING(new String[]{"%H[" + BlockHunt.getPluginDescriptionFile().getName() + "%H]", "%A%arenaName%",
"%A%players%%N/%A%maxplayers%", "&8Waiting..."}, "sign.waiting"),
SIGN_STARTING(new String[]{"%H[" + BlockHunt.getPluginDescriptionFile().getName() + "%H]", "%A%arenaName%",
"%A%players%%N/%A%maxplayers%", "&2Start: %A%timeleft%"}, "sign.starting"),
SIGN_IN_GAME(new String[]{"%H[" + BlockHunt.getPluginDescriptionFile().getName() + "%H]", "%A%arenaName%",
"%A%players%%N/%A%maxplayers%", "%EInGame: %A%timeleft%"}, "sign.inGame"),
SCOREBOARD_ENABLED(true, "scoreboard.enabled"),
SCOREBOARD_TITLE("%H[" + BlockHunt.getPluginDescriptionFile().getName() + "]", "scoreboard.title"),
SCOREBOARD_TIME_LEFT("%ATime left:", "scoreboard.timeLeft"),
SCOREBOARD_SEEKERS("%NSeekers:", "scoreboard.seekers"),
SCOREBOARD_HIDERS("%NHiders:", "scoreboard.hiders"),
REQUIRE_INVENTORY_CLEAR_ON_JOIN(false, "requireInventoryClearOnJoin"),
;
private final Object defaultValue;
private final ConfigManager configManager = MemoryStorage.config;
private final String path;
/**
* Instantiates a new config key
*
* @param defaultValue <p>The default value of this config key</p>
* @param path <p>The path of this value in the configuration file</p>
*/
ConfigKey(Object defaultValue, String path) {
this.defaultValue = defaultValue;
this.path = path;
}
@Override
public String getPath() {
return this.path;
}
@Override
public ConfigManager getConfigManager() {
return this.configManager;
}
@Override
public Object getDefaultValue() {
return defaultValue;
}
}

View File

@ -0,0 +1,31 @@
package net.knarcraft.blockhunt.config;
import net.knarcraft.blockhunt.manager.ConfigManager;
/**
* A key pointing to some configuration value
*/
public interface Key {
/**
* Gets the path to this key's value
*
* @return <p>This key's path</p>
*/
String getPath();
/**
* The config manager managing this key
*
* @return <p>This key's config manager</p>
*/
ConfigManager getConfigManager();
/**
* Gets the default value of this configuration key
*
* @return <p>The default value</p>
*/
Object getDefaultValue();
}

View File

@ -0,0 +1,171 @@
package net.knarcraft.blockhunt.config;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.manager.ConfigManager;
/**
* A key pointing to a value in messages.properties
*/
public enum MessageKey implements Key {
LOG_ENABLED_PLUGIN("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%authors%%N.",
"log.enabledPlugin"),
LOG_DISABLED_PLUGIN("%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%authors%%N.",
"log.disabledPlugin"),
HELP_INFO("%NDisplays the plugin's info.", "help.info"),
HELP_HELP("%NShows a list of commands.", "help.help"),
HELP_RELOAD("%NReloads all configs.", "help.reload"),
HELP_JOIN("%NJoins a " + BlockHunt.getPluginDescriptionFile().getName() + " game.", "help.join"),
HELP_LEAVE("%NLeave a " + BlockHunt.getPluginDescriptionFile().getName() + " game.", "help.leave"),
HELP_LIST("%NShows a list of available arenas.", "help.list"),
HELP_SHOP("%NOpens the " + BlockHunt.getPluginDescriptionFile().getName() + " shop.", "help.shop"),
HELP_START("%NForces an arena to start.", "help.start"),
HELP_WAND("%NGives you the wand selection tool.", "help.wand"),
HELP_CREATE("%NCreates an arena from your selection.", "help.create"),
HELP_SET("%NOpens a panel to set settings.", "help.set"),
HELP_SET_WARP("%NSets warps for your arena.", "help.setWarp"),
HELP_REMOVE("%NDeletes an Arena.", "help.remove"),
HELP_TOKENS("%NChange someones tokens.", "help.tokens"),
BUTTON_ADD("%NAdd %A%1%%N to %A%2%%N", "button.add"),
BUTTON_ADD_2("Add", "button.add2"),
BUTTON_SETTING("%NSetting %A%1%%N is now: %A%2%%N.", "button.setting"),
BUTTON_REMOVE("%NRemove %A%1%%N from %A%2%%N", "button.remove"),
BUTTON_REMOVE_2("Remove", "button.remove2"),
NORMAL_RELOADED_CONFIGS("%TAG&aReloaded all configs!", "normal.reloadedConfigs"),
NORMAL_JOIN_JOINED_ARENA("%TAG%A%%playerName%%%N joined your arena. (%A%1%%N/%A%2%%N)",
"normal.joinJoinedArena"),
NORMAL_LEAVE_YOU_LEFT("%TAG%NYou left the arena! Thanks for playing!", "normal.leaveYouLeft"),
NORMAL_LEAVE_LEFT_ARENA("%TAG%A%%playerName%%%N left your arena. (%A%1%%N/%A%2%%N)",
"normal.leaveLeftArena"),
NORMAL_START_FORCED("%TAG%NYou forced to start arena '%A%arenaName%%N'!", "normal.startForced"),
NORMAL_WAND_GAVE_WAND("%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)", "normal.wandGaveWand"),
NORMAL_WAND_SET_POSITION("%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N, %A%z%%N).",
"normal.wandSetPosition"),
NORMAL_CREATE_CREATED_ARENA("%TAG%NCreated an arena with the name '%A%name%%N'.",
"normal.createCreatedArena"),
NORMAL_LOBBY_ARENA_IS_STARTING("%TAG%NThe arena will start in %A%1%%N second(s)!",
"normal.lobbyArenaIsStarting"),
NORMAL_LOBBY_ARENA_STARTED("%TAG%NThe arena has been started! The seeker is coming to find you in " +
"%A%secs%%N seconds!", "normal.lobbyArenaStarted"),
NORMAL_IN_GAME_SEEKER_CHOSEN("%TAG%NPlayer %A%seeker%%N has been chosen as seeker!",
"normal.inGameSeekerChosen"),
NORMAL_IN_GAME_BLOCK("%TAG%NYou're disguised as a(n) '%A%block%%N' block.", "normal.inGameBlock"),
NORMAL_IN_GAME_ARENA_END("%TAG%NThe arena will end in %A%1%%N second(s)!", "normal.inGameArenaEnd"),
NORMAL_IN_GAME_SEEKER_SPAWNED("%TAG%A%%playerName%%%N has spawned as a seeker!",
"normal.inGameSeekerSpawned"),
NORMAL_IN_GAME_GIVEN_SWORD("%TAG%NYou were given a sword!", "normal.inGameGivenSword"),
NORMAL_IN_GAME_HIDER_DIED("%TAG%NHider %A%%playerName%%%N was killed by %A%killer%%N!",
"normal.inGameHiderDied"),
NORMAL_IN_GAME_HIDERS_LEFT("%NHider(s) left: %A%left%%N", "normal.inGameHidersLeft"),
NORMAL_IN_GAME_SEEKER_DIED("%TAG%NSeeker %A%%playerName%%%N died and will respawn in %A%secs%%N" +
"seconds!", "normal.inGameSeekerDied"),
normal_winSeekers("%TAG%NThe %ASEEKERS%N have won!", "normal.winSeekers"),
NORMAL_WIN_HIDERS("%TAG%NThe %AHIDERS%N have won!", "normal.winHiders"),
NORMAL_SET_WARP_WARP_SET("%TAG%NSet warp '%A%warp%%N' to your location!", "normal.setWarpWarpSet"),
NORMAL_ADDED_TOKEN("%TAG%A%amount%%N tokens were added to your account!", "normal.addedToken"),
NORMAL_REMOVE_REMOVED_ARENA("%TAG%NRemoved arena '%A%name%%N'!", "normal.removeRemovedArena"),
NORMAL_TOKENS_CHANGED("%TAG%N%option% %A%amount%%N tokens %option2% %A%%playerName%%%N.",
"normal.tokensChanged"),
NORMAL_TOKENS_CHANGED_PERSON("%TAG%NPlayer %A%%playerName%%%N %N%option% %A%amount%%N %option2% your " +
"tokens.", "normal.tokensChangedPerson"),
NORMAL_IN_GAME_NOW_SOLID("%TAG%NYou're now a solid '%A%block%%N' block!", "normal.inGameNowSolid"),
NORMAL_IN_GAME_NO_MORE_SOLID("%TAG%NYou're no longer a solid block!", "normal.inGameNoMoreSolid"),
NORMAL_SHOP_BOUGHT_ITEM("%TAG%NYou've bought the '%A%itemName%%N' item!", "normal.shopBoughtItem"),
NORMAL_SHOP_CHOSEN_BLOCK("%TAG%NYou've chosen to be a(n) '%A%block%%N' block!",
"normal.shopChosenBlock"),
NORMAL_SHOP_CHOSEN_SEEKER("%TAG%NYou've chosen to be a %Aseeker%N!", "normal.shopChosenSeeker"),
NORMAL_SHOP_CHOSEN_HIDERS("%TAG%NYou've chosen to be a %Ahider%N!", "normal.shopChosenHiders"),
NORMAL_IN_GAME_BLOCKS_LEFT("%TAG%NRemaining blocks: %A%1%%N", "normal.inGameBlocksLeft"),
WARNING_LOBBY_NEED_AT_LEAST("%TAG%WYou need at least %A%1% player(s) to start the game!",
"warning.lobbyNeedAtLeast"),
WARNING_IN_GAME_NEW_SEEKER_CHOSEN("%TAG%WThe last seeker left and a new seeker has been chosen!",
"warning.inGameNewSeekerChosen"),
WARNING_UNABLE_TO_COMMAND("%TAG%WSorry but that command is disabled in the arena.",
"warning.unableToCommand"),
WARNING_IN_GAME_NO_SOLID_PLACE("%TAG%WThat's not a valid place to become solid!",
"warning.inGameNoSolidPlace"),
WARNING_ARENA_STOPPED("%TAG%WThe arena has been forced to stop!", "warning.arenaStopped"),
ERROR_NO_PERMISSION("%TAG%EYou don't have the permissions to do that!", "error.noPermission"),
ERROR_NOT_A_NUMBER("%TAG%E'%A%1%%E' is not a number!", "error.notANumber"),
ERROR_COMMAND_NOT_ENABLED("%TAG%EThis command has been disabled!", "error.commandNotEnabled"),
ERROR_COMMAND_NOT_FOUND("%TAG%ECouldn't find the command. Try %A/" + BlockHunt.getPluginDescriptionFile().getName() +
" help %Efor more info.", "error.commandNotFound"),
ERROR_NOT_ENOUGH_ARGUMENTS("%TAG%EYou're missing arguments, correct syntax: %A%syntax%",
"error.notEnoughArguments"),
ERROR_LIBS_DISGUISES_NOT_INSTALLED("%TAG%EThe plugin '%ALib's Disguises%E' is required to run this " +
"plugin! Install it or it won't work!", "error.libsDisguisesNotInstalled"),
ERROR_PROTOCOL_LIB_NOT_INSTALLED("%TAG%EThe plugin '%AProtocolLib%E' is required to run this plugin!" +
" Install it or it won't work!", "error.protocolLibNotInstalled"),
ERROR_NO_ARENA("%TAG%ENo arena found with the name '%A%name%%E'.", "error.noArena"),
ERROR_ONLY_IN_GAME("%TAG%EThis is an only in-game command!", "error.onlyInGame"),
ERROR_JOIN_ALREADY_JOINED("%TAG%EYou've already joined an arena!", "error.joinAlreadyJoined"),
ERROR_JOIN_NO_BLOCKS_SET("%TAG%EThere are none blocks set for this arena. Notify the administrator.",
"error.joinNoBlocksSet"),
ERROR_JOIN_WARPS_NOT_SET("%TAG%EThere are no warps set for this arena. Notify the administrator.",
"error.joinWarpsNotSet"),
ERROR_JOIN_ARENA_IN_GAME("%TAG%EThis game has already started.", "error.joinArenaInGame"),
ERROR_JOIN_FULL("%TAG%EUnable to join this arena. It's full!", "error.joinFull"),
ERROR_JOIN_INVENTORY_NOT_EMPTY("%TAG%EYour inventory should be empty before joining!",
"error.joinInventoryNotEmpty"),
ERROR_LEAVE_NOT_IN_ARENA("%TAG%EYou're not in an arena!", "error.leaveNotInArena"),
ERROR_CREATE_SELECTION_FIRST("%TAG%EMake a selection first. Use the wand command: %A/" +
BlockHunt.getPluginDescriptionFile().getName() + " <wand|w>%E.", "error.createSelectionFirst"),
ERROR_CREATE_NOT_SAME_WORLD("%TAG%EMake your selection points in the same world!",
"error.createNotSameWorld"),
ERROR_SET_TOO_HIGH_NUMBER("%TAG%EThat amount is too high! Max amount is: %A%max%%E.",
"error.setTooHighNumber"),
ERROR_SET_TOO_LOW_NUMBER("%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.",
"error.setTooLowNumber"),
ERROR_SET_NOT_A_BLOCK("%TAG%EThat is not a block!", "error.setNotABlock"),
ERROR_SET_WARP_WARP_NOT_FOUND("%TAG%EWarp '%A%warp%%E' is not valid!", "error_setWarpWarpNotFound"),
ERROR_TOKENS_PLAYER_NOT_ONLINE("%TAG%ENo player found with the name '%A%%playerName%%%E'!",
"error.tokensPlayerNotOnline"),
ERROR_TOKENS_UNKNOWN_SETTING("%TAG%E'%A%option%%E' is not a known option!",
"error.tokensUnknownSetting"),
ERROR_SHOP_NEED_MORE_TOKENS("%TAG%EYou need more tokens before you can buy this item.",
"error.shopNeedMoreTokens"),
ERROR_SHOP_MAX_SEEKERS_REACHED("%TAG%ESorry, the maximum amount of seekers has been reached!",
"error.shopMaxSeekersReached"),
ERROR_SHOP_MAX_HIDERS_REACHED("%TAG%ESorry, the maximum amount of hiders has been reached!",
"error.shopMaxHidersReached"),
ERROR_TELEPORT_FAILED("%TAG%EUnable to teleport you into the arena.", "error.teleportFailed"),
ERROR_TELEPORT_BLOCKED("%TAG%EYou cannot teleport while playing!", "error.teleportBlocked"),
;
private final Object defaultValue;
private final ConfigManager config = MemoryStorage.messages;
private final String location;
/**
* Instantiates a new config key
*
* @param configManager <p>Setting in the config file.</p>
* @param path <p>The path of this value in the configuration file</p>
*/
MessageKey(Object configManager, String path) {
this.defaultValue = configManager;
this.location = path;
}
@Override
public String getPath() {
return this.location;
}
@Override
public ConfigManager getConfigManager() {
return this.config;
}
@Override
public Object getDefaultValue() {
return defaultValue;
}
}

View File

@ -0,0 +1,32 @@
package net.knarcraft.blockhunt.config;
public enum Permission {
INFO("info", PermissionDefault.ALL),
HELP("help", PermissionDefault.ALL),
RELOAD("reload", PermissionDefault.ADMIN),
JOIN("join", PermissionDefault.PLAYER),
JOIN_FULL("joinfull", PermissionDefault.MODERATOR),
JOIN_SIGN("joinsign", PermissionDefault.PLAYER),
LEAVE("leave", PermissionDefault.PLAYER),
LIST("list", PermissionDefault.PLAYER),
SHOP("shop", PermissionDefault.PLAYER),
SHOP_BLOCK_CHOOSER("shop.blockchooser", PermissionDefault.ADMIN),
START("start", PermissionDefault.MODERATOR),
CREATE("create", PermissionDefault.ADMIN),
SET("set", PermissionDefault.MODERATOR),
SET_WARP("setWarp", PermissionDefault.MODERATOR),
SIGN_CREATE("signcreate", PermissionDefault.MODERATOR),
REMOVE("remove", PermissionDefault.ADMIN),
TOKENS("tokens", PermissionDefault.ADMIN),
ALL_COMMANDS("allcommands", PermissionDefault.OP);
public final String perm;
public final PermissionDefault type;
Permission(String perm, PermissionDefault type) {
this.perm = perm;
this.type = type;
}
}

View File

@ -0,0 +1,11 @@
package net.knarcraft.blockhunt.config;
public enum PermissionDefault {
ALL,
PLAYER,
MODERATOR,
ADMIN,
OP
}

View File

@ -2,12 +2,12 @@ package net.knarcraft.blockhunt.listener;
import me.libraryaddict.disguise.DisguiseAPI;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.PlayerHandler;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.arena.ArenaState;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.apache.commons.lang.StringUtils;
import org.bukkit.GameMode;
@ -110,7 +110,7 @@ public class OnEntityDamageByEntityEvent implements Listener {
MemoryStorage.shop.getFile().set(finalDamager.getName() + ".tokens", damagerTokens + arena.killTokens);
MemoryStorage.shop.save();
MessageManager.sendFMessage(finalDamager, ConfigC.normal_addedToken, "amount-" + arena.killTokens);
MessageManager.sendFMessage(finalDamager, MessageKey.NORMAL_ADDED_TOKEN, "amount-" + arena.killTokens);
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", 0);
@ -121,11 +121,11 @@ public class OnEntityDamageByEntityEvent implements Listener {
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens + (int) addingTokens);
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_addedToken, "amount-" + (int) addingTokens);
MessageManager.sendFMessage(player, MessageKey.NORMAL_ADDED_TOKEN, "amount-" + (int) addingTokens);
arena.seekers.add(player);
player.setWalkSpeed(0.3F);
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHiderDied, "playername-" + player.getDisplayName(), "killer-" + finalDamager.getDisplayName());
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_HIDER_DIED, "%playerName%-" + player.getDisplayName(), "killer-" + finalDamager.getDisplayName());
int hidercount = (arena.playersInArena.size() - arena.seekers.size());
if ((hidercount <= 3) && (hidercount > 0)) {
@ -137,9 +137,9 @@ public class OnEntityDamageByEntityEvent implements Listener {
}
Collections.sort(hiders);
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHidersLeft, "left-" + StringUtils.join(hiders.toArray(), ", "));
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_HIDERS_LEFT, "left-" + StringUtils.join(hiders.toArray(), ", "));
} else {
ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameHidersLeft, "left-" + hidercount);
ArenaHandler.sendFMessage(arena, MessageKey.NORMAL_IN_GAME_HIDERS_LEFT, "left-" + hidercount);
}
}

View File

@ -1,11 +1,12 @@
package net.knarcraft.blockhunt.listener;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.InventoryHandler;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.arena.ArenaProperty;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.apache.commons.lang.WordUtils;
import org.bukkit.Bukkit;
@ -40,7 +41,7 @@ public class OnInventoryClickEvent implements Listener {
if (!event.getCurrentItem().getType().isBlock()) {
if (!event.getCurrentItem().getType().equals(Material.FLOWER_POT)) {
event.setCancelled(true);
MessageManager.sendFMessage(player, ConfigC.error_setNotABlock);
MessageManager.sendFMessage(player, MessageKey.ERROR_SET_NOT_A_BLOCK);
}
}
}
@ -48,13 +49,13 @@ public class OnInventoryClickEvent implements Listener {
return;
}
// Early exit if this isnt a blockhunt inventory
// Early exit if this isn't a block-hunt inventory
if (!invView.getTitle().contains("BlockHunt")) {
return;
}
if (invView.getTitle().startsWith("\u00A7r")) {
if (invView.getTitle().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_title)))) {
if (invView.getTitle().equals(MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigKey.SHOP_TITLE)))) {
event.setCancelled(true);
ItemStack item = event.getCurrentItem();
if (MemoryStorage.shop.getFile().get(player.getName() + ".tokens") == null) {
@ -71,46 +72,46 @@ public class OnInventoryClickEvent implements Listener {
if (item.getItemMeta().getDisplayName() == null) {
return;
}
if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll(MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name).toString()))) {
if (playerTokens >= (Integer) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Price)) {
if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll(MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME).toString()))) {
if (playerTokens >= (Integer) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_PRICE)) {
MemoryStorage.shop.getFile().set(player.getName() + ".blockchooser", true);
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Price));
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_PRICE));
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name));
MessageManager.sendFMessage(player, MessageKey.NORMAL_SHOP_BOUGHT_ITEM, "itemName-" + MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME));
} else {
MessageManager.sendFMessage(player, ConfigC.error_shopNeedMoreTokens);
MessageManager.sendFMessage(player, MessageKey.ERROR_SHOP_NEED_MORE_TOKENS);
}
} else if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll(MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name).toString()))) {
if (playerTokens >= (Integer) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Price)) {
} else if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll(MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME).toString()))) {
if (playerTokens >= (Integer) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_PRICE)) {
if (MemoryStorage.shop.getFile().get(player.getName() + ".blockhuntpass") == null) {
MemoryStorage.shop.getFile().set(player.getName() + ".blockhuntpass", 0);
MemoryStorage.shop.save();
}
MemoryStorage.shop.getFile().set(player.getName() + ".blockhuntpass", (Integer) MemoryStorage.shop.getFile().get(player.getName() + ".blockhuntpass") + 1);
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Price));
MemoryStorage.shop.getFile().set(player.getName() + ".tokens", playerTokens - (Integer) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_PRICE));
MemoryStorage.shop.save();
MessageManager.sendFMessage(player, ConfigC.normal_shopBoughtItem, "itemname-" + MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name));
MessageManager.sendFMessage(player, MessageKey.NORMAL_SHOP_BOUGHT_ITEM, "itemName-" + MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME));
} else {
MessageManager.sendFMessage(player, ConfigC.error_shopNeedMoreTokens);
MessageManager.sendFMessage(player, MessageKey.ERROR_SHOP_NEED_MORE_TOKENS);
}
}
InventoryHandler.openShop(player);
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)))) {
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME)))) {
event.setCancelled(true);
if (event.getCurrentItem() != null) {
if (event.getCurrentItem().getType().isBlock()) {
MemoryStorage.choosenBlock.put(player, event.getCurrentItem());
MemoryStorage.chosenBlock.put(player, event.getCurrentItem());
String blockName = event.getCurrentItem().getType().name();
blockName = WordUtils.capitalizeFully(blockName.replace("_", " "));
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenBlock, "block-"
MessageManager.sendFMessage(player, MessageKey.NORMAL_SHOP_CHOSEN_BLOCK, "block-"
+ blockName);
} else {
MessageManager.sendFMessage(player, ConfigC.error_setNotABlock);
MessageManager.sendFMessage(player, MessageKey.ERROR_SET_NOT_A_BLOCK);
}
}
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
} else if (invView.getTitle().contains(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME)))) {
event.setCancelled(true);
if (event.getCurrentItem() != null) {
if (event.getCurrentItem().getType().equals(Material.BLUE_WOOL)) {
@ -118,8 +119,8 @@ public class OnInventoryClickEvent implements Listener {
for (Arena arena : MemoryStorage.arenaList) {
if (arena.playersInArena.contains(player)) {
for (Player playerCheck : arena.playersInArena) {
if (MemoryStorage.choosenSeeker.get(playerCheck) != null) {
if (MemoryStorage.choosenSeeker.get(playerCheck)) {
if (MemoryStorage.chosenSeeker.get(playerCheck) != null) {
if (MemoryStorage.chosenSeeker.get(playerCheck)) {
i = i + 1;
}
}
@ -127,12 +128,12 @@ public class OnInventoryClickEvent implements Listener {
}
if (i >= arena.amountSeekersOnStart) {
MessageManager.sendFMessage(player, ConfigC.error_shopMaxSeekersReached);
MessageManager.sendFMessage(player, MessageKey.ERROR_SHOP_MAX_SEEKERS_REACHED);
} else {
MemoryStorage.choosenSeeker.put(player, true);
MemoryStorage.chosenSeeker.put(player, true);
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
player.updateInventory();
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenSeeker);
MessageManager.sendFMessage(player, MessageKey.NORMAL_SHOP_CHOSEN_SEEKER);
inv.clear();
if (MemoryStorage.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) {
MemoryStorage.shop.getFile().set(player.getName() + ".blockhuntpass", null);
@ -149,8 +150,8 @@ public class OnInventoryClickEvent implements Listener {
for (Arena arena : MemoryStorage.arenaList) {
if (arena.playersInArena.contains(player)) {
for (Player playerCheck : arena.playersInArena) {
if (MemoryStorage.choosenSeeker.get(playerCheck) != null) {
if (!MemoryStorage.choosenSeeker.get(playerCheck)) {
if (MemoryStorage.chosenSeeker.get(playerCheck) != null) {
if (!MemoryStorage.chosenSeeker.get(playerCheck)) {
i = i + 1;
}
}
@ -158,12 +159,12 @@ public class OnInventoryClickEvent implements Listener {
}
if (i >= (arena.playersInArena.size() - 1)) {
MessageManager.sendFMessage(player, ConfigC.error_shopMaxHidersReached);
MessageManager.sendFMessage(player, MessageKey.ERROR_SHOP_MAX_HIDERS_REACHED);
} else {
MemoryStorage.choosenSeeker.put(player, false);
MemoryStorage.chosenSeeker.put(player, false);
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
player.updateInventory();
MessageManager.sendFMessage(player, ConfigC.normal_shopChoosenHiders);
MessageManager.sendFMessage(player, MessageKey.NORMAL_SHOP_CHOSEN_HIDERS);
inv.clear();
if (MemoryStorage.shop.getFile().getInt(player.getName() + ".blockhuntpass") == 1) {
MemoryStorage.shop.getFile().set(player.getName() + ".blockhuntpass", null);
@ -179,11 +180,11 @@ public class OnInventoryClickEvent implements Listener {
} else {
event.setCancelled(true);
ItemStack item = event.getCurrentItem();
String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NBlockHunt arena: %A"), "");
String arenaName = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NBlockHunt arena: %A"), "");
Arena arena = null;
for (Arena arena2 : MemoryStorage.arenaList) {
if (arena2.arenaName.equalsIgnoreCase(arenaname)) {
if (arena2.arenaName.equalsIgnoreCase(arenaName)) {
arena = arena2;
}
}
@ -242,7 +243,7 @@ public class OnInventoryClickEvent implements Listener {
}
public static void updownButton(Player player, ItemStack item, Arena arena, ArenaProperty at, int option, int max, int min, int add, int remove) {
if (item.getItemMeta().getDisplayName().contains((String) MemoryStorage.messages.get(ConfigC.button_add2))) {
if (item.getItemMeta().getDisplayName().contains((String) MemoryStorage.messages.get(MessageKey.BUTTON_ADD_2))) {
if (option < max) {
switch (at) {
case MAX_PLAYERS -> arena.maxPlayers = option + add;
@ -258,9 +259,9 @@ public class OnInventoryClickEvent implements Listener {
case KILL_TOKENS -> arena.killTokens = option + add;
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_setTooHighNumber, "max-" + max);
MessageManager.sendFMessage(player, MessageKey.ERROR_SET_TOO_HIGH_NUMBER, "max-" + max);
}
} else if (item.getItemMeta().getDisplayName().contains((String) MemoryStorage.messages.get(ConfigC.button_remove2))) {
} else if (item.getItemMeta().getDisplayName().contains((String) MemoryStorage.messages.get(MessageKey.BUTTON_REMOVE_2))) {
if (option > min) {
switch (at) {
case MAX_PLAYERS -> arena.maxPlayers = option - remove;
@ -276,7 +277,7 @@ public class OnInventoryClickEvent implements Listener {
case KILL_TOKENS -> arena.killTokens = option - remove;
}
} else {
MessageManager.sendFMessage(player, ConfigC.error_setTooLowNumber, "min-" + min);
MessageManager.sendFMessage(player, MessageKey.ERROR_SET_TOO_LOW_NUMBER, "min-" + min);
}
}
}

View File

@ -24,11 +24,11 @@ public class OnInventoryCloseEvent implements Listener {
InventoryView invView = event.getView();
if (inv.getType().equals(InventoryType.CHEST)) {
if (invView.getTitle().contains("DisguiseBlocks")) {
String arenaname = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), "");
String arenaName = inv.getItem(0).getItemMeta().getDisplayName().replaceAll(MessageManager.replaceAll("%NDisguiseBlocks of arena: %A"), "");
Arena arena = null;
for (Arena arena2 : MemoryStorage.arenaList) {
if (arena2.arenaName.equalsIgnoreCase(arenaname)) {
if (arena2.arenaName.equalsIgnoreCase(arenaName)) {
arena = arena2;
}
}

View File

@ -1,14 +1,15 @@
package net.knarcraft.blockhunt.listener;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.InventoryHandler;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.PermissionsC;
import net.knarcraft.blockhunt.SignsHandler;
import net.knarcraft.blockhunt.SolidBlockHandler;
import net.knarcraft.blockhunt.arena.Arena;
import net.knarcraft.blockhunt.arena.ArenaHandler;
import net.knarcraft.blockhunt.arena.ArenaState;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.config.Permission;
import net.knarcraft.blockhunt.manager.MessageManager;
import net.knarcraft.blockhunt.manager.PermissionsManager;
import org.bukkit.Bukkit;
@ -33,19 +34,19 @@ public class OnPlayerInteractEvent implements Listener {
public void onPlayerInteractEvent(PlayerInteractEvent event) {
Player player = event.getPlayer();
Block block = event.getClickedBlock();
if (PermissionsManager.hasPerm(player, PermissionsC.Permissions.create, false)) {
if (PermissionsManager.hasPerm(player, Permission.CREATE, false)) {
ItemStack item = player.getInventory().getItemInMainHand();
if (item.getType() != Material.AIR) {
if (item.getItemMeta().hasDisplayName()) {
ItemMeta im = item.getItemMeta();
if (im.getDisplayName().equals(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.wandName)))) {
if (im.getDisplayName().equals(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.WAND_NAME)))) {
Action action = event.getAction();
if (event.hasBlock()) {
Location location = event.getClickedBlock().getLocation();
if (action.equals(Action.LEFT_CLICK_BLOCK)) {
event.setCancelled(true);
if (MemoryStorage.pos1.get(player) == null || !MemoryStorage.pos1.get(player).equals(location)) {
MessageManager.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-1",
MessageManager.sendFMessage(player, MessageKey.NORMAL_WAND_SET_POSITION, "number-1",
"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-"
+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ());
MemoryStorage.pos1.put(player, location);
@ -53,7 +54,7 @@ public class OnPlayerInteractEvent implements Listener {
} else if (action.equals(Action.RIGHT_CLICK_BLOCK)) {
event.setCancelled(true);
if (MemoryStorage.pos2.get(player) == null || !MemoryStorage.pos2.get(player).equals(location)) {
MessageManager.sendFMessage(player, ConfigC.normal_wandSetPosition, "number-2",
MessageManager.sendFMessage(player, MessageKey.NORMAL_WAND_SET_POSITION, "number-2",
"pos-%N(%A" + location.getBlockX() + "%N, %A" + location.getBlockY() + "%N, %A" + location.getBlockZ() + "%N)", "x-"
+ location.getBlockX(), "y-" + location.getBlockY(), "z-" + location.getBlockZ());
MemoryStorage.pos2.put(player, location);
@ -71,18 +72,18 @@ public class OnPlayerInteractEvent implements Listener {
if (SignsHandler.isSign(event.getClickedBlock().getLocation())) {
Sign sign = (Sign) event.getClickedBlock().getState();
if (sign.getLine(1) != null) {
if (sign.getLine(1).equals(MessageManager.replaceAll(MemoryStorage.config.getFile().getStringList(ConfigC.sign_LEAVE.location).get(1)))) {
if (PermissionsManager.hasPerm(player, PermissionsC.Permissions.joinsign, true)) {
if (sign.getLine(1).equals(MessageManager.replaceAll(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_LEAVE.getPath()).get(1)))) {
if (PermissionsManager.hasPerm(player, Permission.JOIN_SIGN, true)) {
ArenaHandler.playerLeaveArena(player, true, true);
}
} else if (sign.getLine(1).equals(MessageManager.replaceAll(MemoryStorage.config.getFile().getStringList(ConfigC.sign_SHOP.location).get(1)))) {
if (PermissionsManager.hasPerm(player, PermissionsC.Permissions.shop, true)) {
} else if (sign.getLine(1).equals(MessageManager.replaceAll(MemoryStorage.config.getFile().getStringList(ConfigKey.SIGN_SHOP.getPath()).get(1)))) {
if (PermissionsManager.hasPerm(player, Permission.SHOP, true)) {
InventoryHandler.openShop(player);
}
} else {
for (Arena arena : MemoryStorage.arenaList) {
if (sign.getLines()[1].contains(arena.arenaName)) {
if (PermissionsManager.hasPerm(player, PermissionsC.Permissions.joinsign, true)) {
if (PermissionsManager.hasPerm(player, Permission.JOIN_SIGN, true)) {
ArenaHandler.playerJoinArena(player, arena.arenaName);
}
}
@ -133,8 +134,8 @@ public class OnPlayerInteractEvent implements Listener {
ItemStack item = player.getInventory().getItemInMainHand();
if (item.getType() != Material.AIR) {
if (item.getItemMeta().getDisplayName() != null) {
if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)))) {
Inventory blockChooser = Bukkit.createInventory(null, 36, MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_blockChooserv1Name)));
if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME)))) {
Inventory blockChooser = Bukkit.createInventory(null, 36, MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_CHOOSER_V_1_NAME)));
if (arena.disguiseBlocks != null) {
for (int i = arena.disguiseBlocks.size(); i > 0; i = i - 1) {
blockChooser.setItem(i - 1, arena.disguiseBlocks.get(i - 1));
@ -144,8 +145,8 @@ public class OnPlayerInteractEvent implements Listener {
player.openInventory(blockChooser);
}
if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)))) {
Inventory BlockHuntPass = Bukkit.createInventory(null, 9, MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigC.shop_BlockHuntPassv2Name)));
if (item.getItemMeta().getDisplayName().equals(MessageManager.replaceAll((String) MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME)))) {
Inventory BlockHuntPass = Bukkit.createInventory(null, 9, MessageManager.replaceAll("\u00A7r" + MemoryStorage.config.get(ConfigKey.SHOP_BLOCK_HUNT_PASS_V_2_NAME)));
ItemStack BlockHuntPassSEEKER = new ItemStack(Material.BLUE_WOOL, 1);
ItemMeta BlockHuntPassIM = BlockHuntPassSEEKER.getItemMeta();
BlockHuntPassIM.setDisplayName(MessageManager.replaceAll("&eSEEKER"));

View File

@ -1,7 +1,7 @@
package net.knarcraft.blockhunt.listener;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.manager.MessageManager;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -30,7 +30,7 @@ public class OnPlayerTeleportEvent implements Listener {
Location storedLoc = MemoryStorage.teleportLoc.remove(player);
Location to = event.getTo();
if (storedLoc == null || storedLoc.getWorld() != to.getWorld() || to.distanceSquared(storedLoc) > 1) {
MessageManager.sendFMessage(player, ConfigC.error_teleportBlocked);
MessageManager.sendFMessage(player, MessageKey.ERROR_TELEPORT_BLOCKED);
event.setCancelled(true);
}
}

View File

@ -1,8 +1,8 @@
package net.knarcraft.blockhunt.listener;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.PermissionsC;
import net.knarcraft.blockhunt.SignsHandler;
import net.knarcraft.blockhunt.config.Permission;
import net.knarcraft.blockhunt.manager.PermissionsManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -17,8 +17,8 @@ public class OnSignChangeEvent implements Listener {
Player player = event.getPlayer();
String[] lines = event.getLines();
if (lines[0] != null) {
if (lines[0].equalsIgnoreCase("[" + BlockHunt.pdfFile.getName() + "]")) {
if (PermissionsManager.hasPerm(player, PermissionsC.Permissions.signcreate, true)) {
if (lines[0].equalsIgnoreCase("[" + BlockHunt.getPluginDescriptionFile().getName() + "]")) {
if (PermissionsManager.hasPerm(player, Permission.SIGN_CREATE, true)) {
SignsHandler.createSign(event, lines, event.getBlock().getLocation());
}
}

View File

@ -1,20 +1,9 @@
package net.knarcraft.blockhunt.manager;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.PermissionsC;
import net.knarcraft.blockhunt.command.DefaultCommand;
import net.knarcraft.blockhunt.config.Key;
import net.knarcraft.blockhunt.config.Permission;
import java.util.List;
@ -25,14 +14,14 @@ public class CommandManager {
public final String label;
public final String args;
public final String argsalias;
public final PermissionsC.Permissions permission;
public final ConfigC help;
public final Permission permission;
public final Key help;
public final boolean enabled;
public final List<String> mainTABlist;
public final DefaultCommand CMD;
public final String usage;
public CommandManager(String name, String label, String args, String argsalias, PermissionsC.Permissions permission, ConfigC help, Boolean enabled, List<String> mainTABlist,
public CommandManager(String name, String label, String args, String argsalias, Permission permission, Key help, Boolean enabled, List<String> mainTABlist,
DefaultCommand CMD, String usage) {
this.name = name;
this.label = label;

View File

@ -1,19 +1,9 @@
package net.knarcraft.blockhunt.manager;
/**
* Steffion's Engine - Made by Steffion.
* <p>
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
* <p>
* Thanks for your cooperate!
*
* @author Steffion
*/
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.Key;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
@ -78,11 +68,11 @@ public class ConfigManager {
* Add config settings to the files if they don't exist.
*/
public static void setDefaults() {
for (ConfigC value : ConfigC.values()) {
value.config.load();
if (value.config.getFile().get(value.location) == null) {
value.config.getFile().set(value.location, value.value);
value.config.save();
for (ConfigKey value : ConfigKey.values()) {
value.getConfigManager().load();
if (value.getConfigManager().getFile().get(value.getPath()) == null) {
value.getConfigManager().getFile().set(value.getPath(), value.getDefaultValue());
value.getConfigManager().save();
}
}
}
@ -143,7 +133,8 @@ public class ConfigManager {
* @param location Config location.
* @return Object
*/
public Object get(ConfigC location) {
return this.getFile().get(location.location);
public Object get(Key location) {
return this.getFile().get(location.getPath());
}
}

View File

@ -1,22 +1,12 @@
package net.knarcraft.blockhunt.manager;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.MemoryStorage;
import net.knarcraft.blockhunt.config.ConfigKey;
import net.knarcraft.blockhunt.config.Key;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class MessageManager {
/**
* Steffion's Engine - Made by Steffion.
*
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
*
* Thanks for your cooperate!
*
* @author Steffion
*/
/**
* Send a message to a player. Also replaces the "%player%" variable to the
@ -40,16 +30,18 @@ public class MessageManager {
* variable to the player's name.
*
* @param player The player receiving the message.
* @param location Location in the config of the message being send.
* @param vars Variables. Seperated with a - . Ex: "playerName-" +
* @param location Location in the config of the message being sent.
* @param vars Variables. Separated with a - . Ex: "playerName-" +
* player.getName();
*/
public static void sendFMessage(Player player, ConfigC location, String... vars) {
public static void sendFMessage(Player player, Key location, String... vars) {
if (player == null) {
Bukkit.getConsoleSender().sendMessage(
MessageManager.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", "Console"), vars));
MessageManager.replaceAll(location.getConfigManager().getFile().get(
location.getPath()).toString().replaceAll("%player%", "Console"), vars));
} else {
player.sendMessage(MessageManager.replaceAll(location.config.getFile().get(location.location).toString().replaceAll("%player%", player.getDisplayName()), vars));
player.sendMessage(MessageManager.replaceAll(location.getConfigManager().getFile().get(
location.getPath()).toString().replaceAll("%player%", player.getDisplayName()), vars));
}
}
@ -57,7 +49,7 @@ public class MessageManager {
* Send a message to all players online. Also replaces the "%player%"
* variable to the player's name.
*
* @param message Message which needs to be send to the player.
* @param message Message which needs to be sent to the player.
* @param vars Variables. Seperated with a - . Ex: "playerName-" +
* player.getName();
*/
@ -72,18 +64,18 @@ public class MessageManager {
* Send a message to all players online from a Config. Also replaces the
* "%player%" variable to the player's name.
*
* @param location Location in the config of the message being send.
* @param vars Variables . Seperated with a - . Ex: "playerName-" +
* @param location Location in the config of the message being sent.
* @param vars Variables . Separated with a - . Ex: "playerName-" +
* player.getName();
*/
public static void broadcastFMessage(ConfigC location, String... vars) {
public static void broadcastFMessage(Key location, String... vars) {
for (Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage(MessageManager.replaceAll(location.config.getFile().get(
location.location).toString().replaceAll("%player%", player.getDisplayName()), vars));
player.sendMessage(MessageManager.replaceAll(location.getConfigManager().getFile().get(
location.getPath()).toString().replaceAll("%player%", player.getDisplayName()), vars));
}
Bukkit.getConsoleSender().sendMessage(MessageManager.replaceAll(location.config.getFile().get(
location.location).toString().replaceAll("%player%", "Console"), vars));
Bukkit.getConsoleSender().sendMessage(MessageManager.replaceAll(location.getConfigManager().getFile().get(
location.getPath()).toString().replaceAll("%player%", "Console"), vars));
}
/**
@ -143,27 +135,27 @@ public class MessageManager {
public static class CType {
public static String NORMAL() {
return (String) MemoryStorage.config.get(ConfigC.chat_normal);
return (String) MemoryStorage.config.get(ConfigKey.CHAT_NORMAL);
}
public static String WARNING() {
return (String) MemoryStorage.config.get(ConfigC.chat_warning);
return (String) MemoryStorage.config.get(ConfigKey.CHAT_WARNING);
}
public static String ERROR() {
return (String) MemoryStorage.config.get(ConfigC.chat_error);
return (String) MemoryStorage.config.get(ConfigKey.CHAT_ERROR);
}
public static String ARG() {
return (String) MemoryStorage.config.get(ConfigC.chat_arg);
return (String) MemoryStorage.config.get(ConfigKey.CHAT_ARGUMENT);
}
public static String HEADER() {
return (String) MemoryStorage.config.get(ConfigC.chat_header);
return (String) MemoryStorage.config.get(ConfigKey.CHAT_HEADER);
}
public static String TAG() {
return (String) MemoryStorage.config.get(ConfigC.chat_header) + MemoryStorage.config.get(ConfigC.chat_tag) + MemoryStorage.config.get(ConfigC.chat_normal);
return (String) MemoryStorage.config.get(ConfigKey.CHAT_HEADER) + MemoryStorage.config.get(ConfigKey.CHAT_TAG) + MemoryStorage.config.get(ConfigKey.CHAT_NORMAL);
}
}
}

View File

@ -1,21 +1,12 @@
package net.knarcraft.blockhunt.manager;
import net.knarcraft.blockhunt.ConfigC;
import net.knarcraft.blockhunt.PermissionsC;
import net.knarcraft.blockhunt.BlockHunt;
import net.knarcraft.blockhunt.config.MessageKey;
import net.knarcraft.blockhunt.config.Permission;
import net.knarcraft.blockhunt.config.PermissionDefault;
import org.bukkit.entity.Player;
public class PermissionsManager {
/**
* Steffion's Engine - Made by Steffion.
*
* You're allowed to use this engine for own usage, you're not allowed to
* republish the engine. Using this for your own plugin is allowed when a
* credit is placed somewhere in the plugin.
*
* Thanks for your cooperate!
*
* @author Steffion
*/
/**
* Check if a player has the permission. Also checks * related permissions.
@ -27,43 +18,43 @@ public class PermissionsManager {
* permission.
* @return True/False when either the player has the permission.
*/
public static boolean hasPerm(Player player, PermissionsC.Permissions perm, Boolean message) {
PermissionsC.PType type = perm.type;
public static boolean hasPerm(Player player, Permission perm, Boolean message) {
PermissionDefault type = perm.type;
if (player == null) {
return true;
}
if (type == PermissionsC.PType.ALL) {
if (type == PermissionDefault.ALL) {
return true;
} else if (type == PermissionsC.PType.OP) {
} else if (type == PermissionDefault.OP) {
if (player.isOp()) {
return true;
}
} else if (type == PermissionsC.PType.ADMIN) {
if (player.hasPermission(PermissionsC.main + "admin")) {
} else if (type == PermissionDefault.ADMIN) {
if (player.hasPermission(BlockHunt.plugin.rootPermission + "admin")) {
return true;
}
} else if (type == PermissionsC.PType.MODERATOR) {
if (player.hasPermission(PermissionsC.main + "moderator")) {
} else if (type == PermissionDefault.MODERATOR) {
if (player.hasPermission(BlockHunt.plugin.rootPermission + "moderator")) {
return true;
}
} else if (type == PermissionsC.PType.PLAYER) {
if (player.hasPermission(PermissionsC.main + "player")) {
} else if (type == PermissionDefault.PLAYER) {
if (player.hasPermission(BlockHunt.plugin.rootPermission + "player")) {
return true;
}
}
if (player.hasPermission("*")) {
return true;
} else if (player.hasPermission(PermissionsC.main + "*")) {
} else if (player.hasPermission(BlockHunt.plugin.rootPermission + "*")) {
return true;
} else if (player.hasPermission(PermissionsC.main + perm.perm)) {
} else if (player.hasPermission(BlockHunt.plugin.rootPermission + perm.perm)) {
return true;
} else if (player.hasPermission(PermissionsC.main + perm.perm + ".*")) {
} else if (player.hasPermission(BlockHunt.plugin.rootPermission + perm.perm + ".*")) {
return true;
} else {
if (message) {
MessageManager.sendFMessage(player, ConfigC.error_noPermission);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_PERMISSION);
}
}
return false;
@ -80,34 +71,34 @@ public class PermissionsManager {
* permission.
* @return True/False when either the player has the permission.
*/
public static boolean hasRawPerm(Player player, PermissionsC.PType type, String perm, Boolean message) {
public static boolean hasRawPerm(Player player, PermissionDefault type, String perm, Boolean message) {
if (player == null) {
return true;
}
if (type == PermissionsC.PType.ALL) {
if (type == PermissionDefault.ALL) {
return true;
} else if (type == PermissionsC.PType.OP) {
} else if (type == PermissionDefault.OP) {
if (player.isOp()) {
return true;
}
} else if (type == PermissionsC.PType.ADMIN) {
if (player.hasPermission(PermissionsC.main + "admin")) {
} else if (type == PermissionDefault.ADMIN) {
if (player.hasPermission(BlockHunt.plugin.rootPermission + "admin")) {
return true;
}
} else if (type == PermissionsC.PType.MODERATOR) {
if (player.hasPermission(PermissionsC.main + "moderator")) {
} else if (type == PermissionDefault.MODERATOR) {
if (player.hasPermission(BlockHunt.plugin.rootPermission + "moderator")) {
return true;
}
} else if (type == PermissionsC.PType.PLAYER) {
if (player.hasPermission(PermissionsC.main + "player")) {
} else if (type == PermissionDefault.PLAYER) {
if (player.hasPermission(BlockHunt.plugin.rootPermission + "player")) {
return true;
}
}
if (player.hasPermission("*")) {
return true;
} else if (player.hasPermission(PermissionsC.main + "*")) {
} else if (player.hasPermission(BlockHunt.plugin.rootPermission + "*")) {
return true;
} else if (player.hasPermission(perm)) {
return true;
@ -115,7 +106,7 @@ public class PermissionsManager {
return true;
} else {
if (message) {
MessageManager.sendFMessage(player, ConfigC.error_noPermission);
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_PERMISSION);
}
}
return false;

View File

@ -11,7 +11,7 @@ start='%NForces an arena to start.'
wand='%NGives you the wand selection tool.'
create='%NCreates an arena from your selection.'
set='%NOpens a panel to set settings.'
setwarp='%NSets warps for your arena.'
setWarp='%NSets warps for your arena.'
remove='%NDeletes an Arena.'
tokens='%NChange someones tokens.'
#buttons
@ -22,56 +22,56 @@ button-remove='%NRemove %A%1%%N from %A%2%%N'
button-remove2=Remove
#Normal
reloadedConfigs='%TAG&aReloaded all configs!'
joinJoinedArena='%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)'
joinJoinedArena='%TAG%A%%playerName%%%N joined your arena. (%A%1%%N/%A%2%%N)'
leaveYouLeft='%TAG%NYou left the arena! Thanks for playing!'
leaveLeftArena='%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)'
startForced='%TAG%NYou forced to start arena ''%A%arenaname%%N''!'
leaveLeftArena='%TAG%A%%playerName%%%N left your arena. (%A%1%%N/%A%2%%N)'
startForced='%TAG%NYou forced to start arena ''%A%arenaName%%N''!'
wandGaveWand='%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)'
wandSetPosition='%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N,%A%z%%N).'
createCreatedArena='%TAG%NCreated an arena with the name ''%A%name%%N''.'
lobbyArenaIsStarting='%TAG%NThe arena will start in %A%1%%N second(s)!'
lobbyArenaStarted='%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!'
ingameSeekerChoosen='%TAG%NPlayer %A%seeker%%N has been choosen as seeker!'
ingameBlock='%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.'
ingameArenaEnd='%TAG%NThe arena will end in %A%1%%N second(s)!'
ingameSeekerSpawned='%TAG%A%playername%%N has spawned as a seeker!'
ingameGivenSword='%TAG%NYou were given a sword!'
ingameHiderDied='%TAG%NHider %A%playername%%N was killed by %A%killer%%N!'
ingameHidersLeft='%NHider(s) left: %A%left%%N'
ingameSeekerDied='%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!'
inGameSeekerChosen='%TAG%NPlayer %A%seeker%%N has been chosen as seeker!'
inGameBlock='%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.'
inGameArenaEnd='%TAG%NThe arena will end in %A%1%%N second(s)!'
inGameSeekerSpawned='%TAG%A%%playerName%%%N has spawned as a seeker!'
inGameGivenSword='%TAG%NYou were given a sword!'
inGameHiderDied='%TAG%NHider %A%%playerName%%%N was killed by %A%killer%%N!'
inGameHidersLeft='%NHider(s) left: %A%left%%N'
inGameSeekerDied='%TAG%NSeeker %A%%playerName%%%N died and will respawn in %A%secs%%N seconds!'
winSeekers='%TAG%NThe %ASEEKERS%N have won!'
winHiders='%TAG%NThe %AHIDERS%N have won!'
setwarpWarpSet='%TAG%NSet warp ''%A%warp%%N'' to your location!'
setWarpWarpSet='%TAG%NSet warp ''%A%warp%%N'' to your location!'
addedToken='%TAG%A%amount%%N tokens were added to your account!'
removeRemovedArena='%TAG%NRemoved arena ''%A%name%%N''!'
tokensChanged='%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.'
tokensChangedPerson='%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.'
ingameNowSolid='%TAG%NYou''re now a solid ''%A%block%%N'' block!'
ingameNoMoreSolid='%TAG%NYou''re no longer a solid block!'
shopBoughtItem='%TAG%NYou''ve bought the ''%A%itemname%%N'' item!'
shopChoosenBlock='%TAG%NYou''ve choosen to be a(n) ''%A%block%%N'' block!'
shopChoosenSeeker='%TAG%NYou''ve choosen to be a %Aseeker%N!'
shopChoosenHiders='%TAG%NYou''ve choosen to be a %Ahider%N!'
ingameBlocksLeft='%TAG%NRemaining blocks: %A%1%%N'
tokensChanged='%TAG%N%option% %A%amount%%N tokens %option2% %A%%playerName%%%N.'
tokensChangedPerson='%TAG%NPlayer %A%%playerName%%%N %N%option% %A%amount%%N %option2% your tokens.'
inGameNowSolid='%TAG%NYou''re now a solid ''%A%block%%N'' block!'
inGameNoMoreSolid='%TAG%NYou''re no longer a solid block!'
shopBoughtItem='%TAG%NYou''ve bought the ''%A%itemName%%N'' item!'
shopChosenBlock='%TAG%NYou''ve chosen to be a(n) ''%A%block%%N'' block!'
shopChosenSeeker='%TAG%NYou''ve chosen to be a %Aseeker%N!'
shopChosenHiders='%TAG%NYou''ve chosen to be a %Ahider%N!'
inGameBlocksLeft='%TAG%NRemaining blocks: %A%1%%N'
# Warnings
lobbyNeedAtleast='%TAG%WYou need atleast %A%1%%W player(s) to start the game!'
ingameNEWSeekerChoosen='%TAG%WThe last seeker left and a new seeker has been choosen!'
lobbyNeedAtLeast='%TAG%WYou need at least %A%1%%W player(s) to start the game!'
inGameNewSeekerChosen='%TAG%WThe last seeker left and a new seeker has been chosen!'
unableToCommand='%TAG%WSorry but that command is disabled in the arena.'
ingameNoSolidPlace='%TAG%WThat''s not a valid place to become solid!'
inGameNoSolidPlace='%TAG%WThat''s not a valid place to become solid!'
arenaStopped='%TAG%WThe arena has been forced to stop!'
error-noPermission='%TAG%EYou don''t have the permissions to do that!'
error-notANumber='%TAG%E''%A%1%%E'' is not a number!'
error-commandNotEnabled='%TAG%EThis command has been disabled!'
error-commandNotFound='%TAG%ECouldn''t find the command. Try %A/BlockHunt help %Efor more info.'
error-notEnoughArguments='%TAG%EYou''re missing arguments, correct syntax: %A%syntax%'
error-libsDisguisesNotInstalled='%TAG%EThe plugin ''%ALib''s Disguises%E'' is required to run this plugin! Intall it or it won''t work!'
error-protocolLibNotInstalled='%TAG%EThe plugin ''%AProtocolLib%E'' is required to run this plugin! Intall it or it won''t work!'
error-libsDisguisesNotInstalled='%TAG%EThe plugin ''%ALib''s Disguises%E'' is required to run this plugin! Install it or it won''t work!'
error-protocolLibNotInstalled='%TAG%EThe plugin ''%AProtocolLib%E'' is required to run this plugin! Install it or it won''t work!'
error-noArena='%TAG%ENo arena found with the name ''%A%name%%E''.'
error-onlyIngame='%TAG%EThis is an only in-game command!'
error-onlyInGame='%TAG%EThis is an only in-game command!'
error-joinAlreadyJoined='%TAG%EYou''ve already joined an arena!'
error-joinNoBlocksSet='%TAG%EThere are none blocks set for this arena. Notify the administrator.'
error-joinWarpsNotSet='%TAG%EThere are no warps set for this arena. Notify the administrator.'
error-joinArenaIngame='%TAG%EThis game has already started.'
error-joinArenaInGame='%TAG%EThis game has already started.'
error-joinFull='%TAG%EUnable to join this arena. It''s full!'
error-joinInventoryNotEmpty='%TAG%EYour inventory should be empty before joining!'
error-leaveNotInArena='%TAG%EYou''re not in an arena!'
@ -80,9 +80,9 @@ error-createNotSameWorld='%TAG%EMake your selection points in the same world!'
error-setTooHighNumber='%TAG%EThat amount is too high! Max amount is: %A%max%%E.'
error-setTooLowNumber='%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.'
error-setNotABlock='%TAG%EThat is not a block!'
error-setwarpWarpNotFound='%TAG%EWarp ''%A%warp%%E'' is not valid!'
error-tokensPlayerNotOnline='%TAG%ENo player found with the name ''%A%playername%%E''!'
error-tokensUnknownsetting='%TAG%E''%A%option%%E'' is not a known option!'
error-setWarpWarpNotFound='%TAG%EWarp ''%A%warp%%E'' is not valid!'
error-tokensPlayerNotOnline='%TAG%ENo player found with the name ''%A%%playerName%%%E''!'
error-tokensUnknownSetting='%TAG%E''%A%option%%E'' is not a known option!'
error-shopNeedMoreTokens='%TAG%EYou need more tokens before you can buy this item.'
error-shopMaxSeekersReached='%TAG%ESorry, the maximum amount of seekers has been reached!'
error-shopMaxHidersReached='%TAG%ESorry, the maximum amount of hiders has been reached!'

View File

@ -11,7 +11,7 @@ start='%NForces an arena to start.'
wand='%NGives you the wand selection tool.'
create='%NCreates an arena from your selection.'
set='%NOpens a panel to set settings.'
setwarp='%NSets warps for your arena.'
setWarp='%NSets warps for your arena.'
remove='%NDeletes an Arena.'
tokens='%NChange someones tokens.'
#buttons
@ -22,56 +22,56 @@ button-remove='%NRemove %A%1%%N from %A%2%%N'
button-remove2=Remove
#Normal
reloadedConfigs='%TAG&aReloaded all configs!'
joinJoinedArena='%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)'
joinJoinedArena='%TAG%A%%playerName%%%N joined your arena. (%A%1%%N/%A%2%%N)'
leaveYouLeft='%TAG%NYou left the arena! Thanks for playing!'
leaveLeftArena='%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)'
startForced='%TAG%NYou forced to start arena ''%A%arenaname%%N''!'
leaveLeftArena='%TAG%A%%playerName%%%N left your arena. (%A%1%%N/%A%2%%N)'
startForced='%TAG%NYou forced to start arena ''%A%arenaName%%N''!'
wandGaveWand='%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)'
wandSetPosition='%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N,%A%z%%N).'
createCreatedArena='%TAG%NCreated an arena with the name ''%A%name%%N''.'
lobbyArenaIsStarting='%TAG%NThe arena will start in %A%1%%N second(s)!'
lobbyArenaStarted='%TAG%NThe arena has been started! The seeker is coming to find you in %A%secs%%N seconds!'
ingameSeekerChoosen='%TAG%NPlayer %A%seeker%%N has been choosen as seeker!'
ingameBlock='%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.'
ingameArenaEnd='%TAG%NThe arena will end in %A%1%%N second(s)!'
ingameSeekerSpawned='%TAG%A%playername%%N has spawned as a seeker!'
ingameGivenSword='%TAG%NYou were given a sword!'
ingameHiderDied='%TAG%NHider %A%playername%%N was killed by %A%killer%%N!'
ingameHidersLeft='%NHider(s) left: %A%left%%N'
ingameSeekerDied='%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!'
inGameSeekerChosen='%TAG%NPlayer %A%seeker%%N has been chosen as seeker!'
inGameBlock='%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.'
inGameArenaEnd='%TAG%NThe arena will end in %A%1%%N second(s)!'
inGameSeekerSpawned='%TAG%A%%playerName%%%N has spawned as a seeker!'
inGameGivenSword='%TAG%NYou were given a sword!'
inGameHiderDied='%TAG%NHider %A%%playerName%%%N was killed by %A%killer%%N!'
inGameHidersLeft='%NHider(s) left: %A%left%%N'
inGameSeekerDied='%TAG%NSeeker %A%%playerName%%%N died and will respawn in %A%secs%%N seconds!'
winSeekers='%TAG%NThe %ASEEKERS%N have won!'
winHiders='%TAG%NThe %AHIDERS%N have won!'
setwarpWarpSet='%TAG%NSet warp ''%A%warp%%N'' to your location!'
setWarpWarpSet='%TAG%NSet warp ''%A%warp%%N'' to your location!'
addedToken='%TAG%A%amount%%N tokens were added to your account!'
removeRemovedArena='%TAG%NRemoved arena ''%A%name%%N''!'
tokensChanged='%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.'
tokensChangedPerson='%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.'
ingameNowSolid='%TAG%NYou''re now a solid ''%A%block%%N'' block!'
ingameNoMoreSolid='%TAG%NYou''re no longer a solid block!'
shopBoughtItem='%TAG%NYou''ve bought the ''%A%itemname%%N'' item!'
shopChoosenBlock='%TAG%NYou''ve choosen to be a(n) ''%A%block%%N'' block!'
shopChoosenSeeker='%TAG%NYou''ve choosen to be a %Aseeker%N!'
shopChoosenHiders='%TAG%NYou''ve choosen to be a %Ahider%N!'
ingameBlocksLeft='%TAG%NRemaining blocks: %A%1%%N'
tokensChanged='%TAG%N%option% %A%amount%%N tokens %option2% %A%%playerName%%%N.'
tokensChangedPerson='%TAG%NPlayer %A%%playerName%%%N %N%option% %A%amount%%N %option2% your tokens.'
inGameNowSolid='%TAG%NYou''re now a solid ''%A%block%%N'' block!'
inGameNoMoreSolid='%TAG%NYou''re no longer a solid block!'
shopBoughtItem='%TAG%NYou''ve bought the ''%A%itemName%%N'' item!'
shopChosenBlock='%TAG%NYou''ve chosen to be a(n) ''%A%block%%N'' block!'
shopChosenSeeker='%TAG%NYou''ve chosen to be a %Aseeker%N!'
shopChosenHiders='%TAG%NYou''ve chosen to be a %Ahider%N!'
inGameBlocksLeft='%TAG%NRemaining blocks: %A%1%%N'
# Warnings
lobbyNeedAtleast='%TAG%WYou need atleast %A%1%%W player(s) to start the game!'
ingameNEWSeekerChoosen='%TAG%WThe last seeker left and a new seeker has been choosen!'
lobbyNeedAtLeast='%TAG%WYou need at least %A%1%%W player(s) to start the game!'
inGameNewSeekerChosen='%TAG%WThe last seeker left and a new seeker has been chosen!'
unableToCommand='%TAG%WSorry but that command is disabled in the arena.'
ingameNoSolidPlace='%TAG%WThat''s not a valid place to become solid!'
inGameNoSolidPlace='%TAG%WThat''s not a valid place to become solid!'
arenaStopped='%TAG%WThe arena has been forced to stop!'
error-noPermission='%TAG%EYou don''t have the permissions to do that!'
error-notANumber='%TAG%E''%A%1%%E'' is not a number!'
error-commandNotEnabled='%TAG%EThis command has been disabled!'
error-commandNotFound='%TAG%ECouldn''t find the command. Try %A/BlockHunt help %Efor more info.'
error-notEnoughArguments='%TAG%EYou''re missing arguments, correct syntax: %A%syntax%'
error-libsDisguisesNotInstalled='%TAG%EThe plugin ''%ALib''s Disguises%E'' is required to run this plugin! Intall it or it won''t work!'
error-protocolLibNotInstalled='%TAG%EThe plugin ''%AProtocolLib%E'' is required to run this plugin! Intall it or it won''t work!'
error-libsDisguisesNotInstalled='%TAG%EThe plugin ''%ALib''s Disguises%E'' is required to run this plugin! Install it or it won''t work!'
error-protocolLibNotInstalled='%TAG%EThe plugin ''%AProtocolLib%E'' is required to run this plugin! Install it or it won''t work!'
error-noArena='%TAG%ENo arena found with the name ''%A%name%%E''.'
error-onlyIngame='%TAG%EThis is an only in-game command!'
error-onlyInGame='%TAG%EThis is an only in-game command!'
error-joinAlreadyJoined='%TAG%EYou''ve already joined an arena!'
error-joinNoBlocksSet='%TAG%EThere are none blocks set for this arena. Notify the administrator.'
error-joinWarpsNotSet='%TAG%EThere are no warps set for this arena. Notify the administrator.'
error-joinArenaIngame='%TAG%EThis game has already started.'
error-joinArenaInGame='%TAG%EThis game has already started.'
error-joinFull='%TAG%EUnable to join this arena. It''s full!'
error-joinInventoryNotEmpty='%TAG%EYour inventory should be empty before joining!'
error-leaveNotInArena='%TAG%EYou''re not in an arena!'
@ -80,9 +80,9 @@ error-createNotSameWorld='%TAG%EMake your selection points in the same world!'
error-setTooHighNumber='%TAG%EThat amount is too high! Max amount is: %A%max%%E.'
error-setTooLowNumber='%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.'
error-setNotABlock='%TAG%EThat is not a block!'
error-setwarpWarpNotFound='%TAG%EWarp ''%A%warp%%E'' is not valid!'
error-tokensPlayerNotOnline='%TAG%ENo player found with the name ''%A%playername%%E''!'
error-tokensUnknownsetting='%TAG%E''%A%option%%E'' is not a known option!'
error-setWarpWarpNotFound='%TAG%EWarp ''%A%warp%%E'' is not valid!'
error-tokensPlayerNotOnline='%TAG%ENo player found with the name ''%A%%playerName%%%E''!'
error-tokensUnknownSetting='%TAG%E''%A%option%%E'' is not a known option!'
error-shopNeedMoreTokens='%TAG%EYou need more tokens before you can buy this item.'
error-shopMaxSeekersReached='%TAG%ESorry, the maximum amount of seekers has been reached!'
error-shopMaxHidersReached='%TAG%ESorry, the maximum amount of hiders has been reached!'

View File

@ -6,7 +6,7 @@ authors:
- EpicKnarvik97
- Steffion
description: An easy to set up, Hide and seek plugin. Hide as blocks from the killer seekers.
softdepend: [ LibsDisguises, ProtocolLib, Multiverse-Core, My Worlds ]
softdepend: [ LibsDisguises, ProtocolLib ]
load: POSTWORLD
commands:
BlockHunt:

View File

@ -5,7 +5,7 @@ chat:
error: '&c'
arg: '&e'
header: '&9'
headerhigh: '%H_______.[ %A%header%%H ]._______'
headerHigh: '%H_______.[ %A%header%%H ]._______'
commandEnabled:
info: true
help: true
@ -18,12 +18,12 @@ commandEnabled:
wand: true
create: true
set: true
setwarp: true
setWarp: true
remove: true
tokens: true
autoUpdateCheck: true
autoDownloadUpdate: false
wandIDname: STICK
wandIdName: STICK
wandName: '%A&lBlockHunt%N''s selection wand'
wandDescription:
- '%NUse this item to select an arena for your arena.'
@ -34,54 +34,54 @@ wandDescription:
shop:
title: '%H&lBlockHunt %NShop'
price: '%NPrice: %A%amount% %Ntokens.'
blockChooserv1Enabled: true
blockChooserv1IDname: BOOK
blockChooserv1Price: 3000
blockChooserv1Name: '%H&lBlockHunt Chooser'
blockChooserv1Description:
blockChooserV1Enabled: true
blockChooserV1IdName: BOOK
blockChooserV1Price: 3000
blockChooserV1Name: '%H&lBlockHunt Chooser'
blockChooserV1Description:
- '%NUse this item before the arena starts.'
- '%ARight-Click%N in the lobby and choose'
- '%Nthe block you want to be!'
- '&6Unlimited uses.'
BlockHuntPassv2Enabled: true
BlockHuntPassv2IDName: NAME_TAG
BlockHuntPassv2Price: 150
BlockHuntPassv2Name: '%H&lBlockHunt Pass'
BlockHuntPassv2Description:
blockHuntPassV2Enabled: true
blockHuntPassV2IdName: NAME_TAG
blockHuntPassV2Price: 150
blockHuntPassV2Name: '%H&lBlockHunt Pass'
blockHuntPassV2Description:
- '%NUse this item before the arena starts.'
- '%ARight-Click%N in the lobby and choose'
- '%Nif you want to be a Hider or a Seeker!'
- '&61 time use.'
sign:
LEAVE:
leave:
- '%H[BlockHunt%H]'
- '&4LEAVE'
- '&8Right-Click'
- '&8To leave.'
SHOP:
shop:
- '%H[BlockHunt%H]'
- '&4SHOP'
- '&8Right-Click'
- '&8To shop.'
WAITING:
waiting:
- '%H[BlockHunt%H]'
- '%A%arenaname%'
- '%A%arenaName%'
- '%A%players%%N/%A%maxplayers%'
- '&8Waiting...'
STARTING:
starting:
- '%H[BlockHunt%H]'
- '%A%arenaname%'
- '%A%arenaName%'
- '%A%players%%N/%A%maxplayers%'
- '&2Start: %A%timeleft%'
INGAME:
inGame:
- '%H[BlockHunt%H]'
- '%A%arenaname%'
- '%A%arenaName%'
- '%A%players%%N/%A%maxplayers%'
- '%EIngame: %A%timeleft%'
- '%EInGame: %A%timeleft%'
scoreboard:
enabled: true
title: '%H[BlockHunt]'
timeleft: '%ATime left:'
timeLeft: '%ATime left:'
seekers: '%NSeekers:'
hiders: '%NHiders:'
requireInventoryClearOnJoin: false

View File

@ -13,7 +13,7 @@ help:
wand: '%NGives you the wand selection tool.'
create: '%NCreates an arena from your selection.'
set: '%NOpens a panel to set settings.'
setwarp: '%NSets warps for your arena.'
setWarp: '%NSets warps for your arena.'
remove: '%NDeletes an Arena.'
tokens: '%NChange someones tokens.'
button:
@ -24,10 +24,10 @@ button:
remove2: Remove
normal:
reloadedConfigs: '%TAG&aReloaded all configs!'
joinJoinedArena: '%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)'
joinJoinedArena: '%TAG%A%%playerName%%%N joined your arena. (%A%1%%N/%A%2%%N)'
leaveYouLeft: '%TAG%NYou left the arena! Thanks for playing!'
leaveLeftArena: '%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)'
startForced: '%TAG%NYou forced to start arena ''%A%arenaname%%N''!'
leaveLeftArena: '%TAG%A%%playerName%%%N left your arena. (%A%1%%N/%A%2%%N)'
startForced: '%TAG%NYou forced to start arena ''%A%arenaName%%N''!'
wandGaveWand: '%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)'
wandSetPosition: '%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N,
%A%z%%N).'
@ -35,35 +35,35 @@ normal:
lobbyArenaIsStarting: '%TAG%NThe arena will start in %A%1%%N second(s)!'
lobbyArenaStarted: '%TAG%NThe arena has been started! The seeker is coming to find
you in %A%secs%%N seconds!'
ingameSeekerChoosen: '%TAG%NPlayer %A%seeker%%N has been choosen as seeker!'
ingameBlock: '%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.'
ingameArenaEnd: '%TAG%NThe arena will end in %A%1%%N second(s)!'
ingameSeekerSpawned: '%TAG%A%playername%%N has spawned as a seeker!'
ingameGivenSword: '%TAG%NYou were given a sword!'
ingameHiderDied: '%TAG%NHider %A%playername%%N was killed by %A%killer%%N!'
ingameHidersLeft: '%NHider(s) left: %A%left%%N'
ingameSeekerDied: '%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N
inGameSeekerChosen: '%TAG%NPlayer %A%seeker%%N has been chosen as seeker!'
inGameBlock: '%TAG%NYou''re disguised as a(n) ''%A%block%%N'' block.'
inGameArenaEnd: '%TAG%NThe arena will end in %A%1%%N second(s)!'
inGameSeekerSpawned: '%TAG%A%%playerName%%%N has spawned as a seeker!'
inGameGivenSword: '%TAG%NYou were given a sword!'
inGameHiderDied: '%TAG%NHider %A%%playerName%%%N was killed by %A%killer%%N!'
inGameHidersLeft: '%NHider(s) left: %A%left%%N'
inGameSeekerDied: '%TAG%NSeeker %A%%playerName%%%N died and will respawn in %A%secs%%N
seconds!'
winSeekers: '%TAG%NThe %ASEEKERS%N have won!'
winHiders: '%TAG%NThe %AHIDERS%N have won!'
setwarpWarpSet: '%TAG%NSet warp ''%A%warp%%N'' to your location!'
setWarpWarpSet: '%TAG%NSet warp ''%A%warp%%N'' to your location!'
addedToken: '%TAG%A%amount%%N tokens were added to your account!'
removeRemovedArena: '%TAG%NRemoved arena ''%A%name%%N''!'
tokensChanged: '%TAG%N%option% %A%amount%%N tokens %option2% %A%playername%%N.'
tokensChangedPerson: '%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2%
tokensChanged: '%TAG%N%option% %A%amount%%N tokens %option2% %A%%playerName%%%N.'
tokensChangedPerson: '%TAG%NPlayer %A%%playerName%%%N %N%option% %A%amount%%N %option2%
your tokens.'
ingameNowSolid: '%TAG%NYou''re now a solid ''%A%block%%N'' block!'
ingameNoMoreSolid: '%TAG%NYou''re no longer a solid block!'
shopBoughtItem: '%TAG%NYou''ve bought the ''%A%itemname%%N'' item!'
shopChoosenBlock: '%TAG%NYou''ve choosen to be a(n) ''%A%block%%N'' block!'
shopChoosenSeeker: '%TAG%NYou''ve choosen to be a %Aseeker%N!'
shopChoosenHiders: '%TAG%NYou''ve choosen to be a %Ahider%N!'
ingameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N'
inGameNowSolid: '%TAG%NYou''re now a solid ''%A%block%%N'' block!'
inGameNoMoreSolid: '%TAG%NYou''re no longer a solid block!'
shopBoughtItem: '%TAG%NYou''ve bought the ''%A%itemName%%N'' item!'
shopChosenBlock: '%TAG%NYou''ve chosen to be a(n) ''%A%block%%N'' block!'
shopChosenSeeker: '%TAG%NYou''ve chosen to be a %Aseeker%N!'
shopChosenHiders: '%TAG%NYou''ve chosen to be a %Ahider%N!'
inGameBlocksLeft: '%TAG%NRemaining blocks: %A%1%%N'
warning:
lobbyNeedAtleast: '%TAG%WYou need atleast %A%1% player(s) to start the game!'
ingameNEWSeekerChoosen: '%TAG%WThe last seeker left and a new seeker has been choosen!'
lobbyNeedAtLeast: '%TAG%WYou need at least %A%1% player(s) to start the game!'
inGameNEWSeekerChosen: '%TAG%WThe last seeker left and a new seeker has been chosen!'
unableToCommand: '%TAG%WSorry but that command is disabled in the arena.'
ingameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!'
inGameNoSolidPlace: '%TAG%WThat''s not a valid place to become solid!'
arenaStopped: '%TAG%WThe arena has been forced to stop!'
error:
noPermission: '%TAG%EYou don''t have the permissions to do that!'
@ -73,15 +73,15 @@ error:
more info.'
notEnoughArguments: '%TAG%EYou''re missing arguments, correct syntax: %A%syntax%'
libsDisguisesNotInstalled: '%TAG%EThe plugin ''%ALib''s Disguises%E'' is required
to run this plugin! Intall it or it won''t work!'
to run this plugin! Install it or it won''t work!'
protocolLibNotInstalled: '%TAG%EThe plugin ''%AProtocolLib%E'' is required to run
this plugin! Intall it or it won''t work!'
this plugin! Install it or it won''t work!'
noArena: '%TAG%ENo arena found with the name ''%A%name%%E''.'
onlyIngame: '%TAG%EThis is an only in-game command!'
onlyInGame: '%TAG%EThis is an only in-game command!'
joinAlreadyJoined: '%TAG%EYou''ve already joined an arena!'
joinNoBlocksSet: '%TAG%EThere are none blocks set for this arena. Notify the administrator.'
joinWarpsNotSet: '%TAG%EThere are no warps set for this arena. Notify the administrator.'
joinArenaIngame: '%TAG%EThis game has already started.'
joinArenaInGame: '%TAG%EThis game has already started.'
joinFull: '%TAG%EUnable to join this arena. It''s full!'
joinInventoryNotEmpty: '%TAG%EYour inventory should be empty before joining!'
leaveNotInArena: '%TAG%EYou''re not in an arena!'
@ -91,9 +91,9 @@ error:
setTooHighNumber: '%TAG%EThat amount is too high! Max amount is: %A%max%%E.'
setTooLowNumber: '%TAG%EThat amount is too low! Minimal amount is: %A%min%%E.'
setNotABlock: '%TAG%EThat is not a block!'
setwarpWarpNotFound: '%TAG%EWarp ''%A%warp%%E'' is not valid!'
tokensPlayerNotOnline: '%TAG%ENo player found with the name ''%A%playername%%E''!'
tokensUnknownsetting: '%TAG%E''%A%option%%E'' is not a known option!'
setWarpWarpNotFound: '%TAG%EWarp ''%A%warp%%E'' is not valid!'
tokensPlayerNotOnline: '%TAG%ENo player found with the name ''%A%%playerName%%%E''!'
tokensUnknownSetting: '%TAG%E''%A%option%%E'' is not a known option!'
shopNeedMoreTokens: '%TAG%EYou need more tokens before you can buy this item.'
shopMaxSeekersReached: '%TAG%ESorry, the maximum amount of seekers has been reached!'
shopMaxHidersReached: '%TAG%ESorry, the maximum amount of hiders has been reached!'