Improves setup description
This commit is contained in:
parent
638094be33
commit
b6eb6a26d1
54
README.md
54
README.md
@ -51,9 +51,9 @@ _**Note:** Instead of using /BlockHunt you could use:_
|
||||
<> = Required [] = Optional
|
||||
|
||||
| Command | Description | Permission | Default allowed |
|
||||
|--------------------------------------------------------------------|---------------------------------------------------|-----------------------------|-------------------------------------------------|
|
||||
| `/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 [info/i]` | Displays the plugin's info. | blockhunt.info | All players have this permission by default. |
|
||||
| `/BlockHunt <help/h>` | Shows a list of commands. | blockhunt.help | All players have this permission by default. |
|
||||
| `/BlockHunt <reload/r>` | Reloads all 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 |
|
||||
@ -100,11 +100,33 @@ and then left-click with the wand on the opposite corner. Make sure one corner i
|
||||
that the other is above the top of the arena.
|
||||
|
||||
Use `/bh create \<name>` to create your new arena with name \<name>. Use `/bh set \<name>` to get a GUI for setting the
|
||||
properties of the arena. You can set the maximum number of players that can play at once, the minimum amount of players
|
||||
for a game to start, the amount of seekers required to start, the amount of seconds to keep the players in the lobby (
|
||||
allowing other players to join) before starting the arena, the number of seconds to wait until seekers can start
|
||||
seeking, the amount of time a game will last, the amount of seconds between each time the number of remaining hiders is
|
||||
announced, the number of seconds before the game ends the hiders will be given swords.
|
||||
properties of the arena. See [this](#arena-interface-descriptions) for information about the various settable values.
|
||||
When you've set the values as wanted, click the book. In the inventory, put all blocks you want hiders to use.
|
||||
|
||||
The last step in the setup is to set the warps. Use `/bh sw lobby \<name>` to set the lobby at your current location.
|
||||
The lobby is the location players are teleported to after joining, before the arena starts. Use `/bh sw hiders \<name>`
|
||||
to set the hiders spawn. This is where hiders are teleported once the arena starts. Use `/bh sw seekers \<name>`
|
||||
to set the seekers location at your current location. The seekers location is where seekers are teleported when the
|
||||
arena starts. Choose a place where they cannot reach or see the hiders, as they are teleported to the hiders warp once
|
||||
they are allowed to start seeking. Use `/bh sw spawn \<name>` to set the locations players will go to when exiting the
|
||||
arena.
|
||||
|
||||
You can set up a join sign, which also displays current players, by creating a sign like:
|
||||
|
||||
1. \[BlockHunt]
|
||||
2. \<name>
|
||||
|
||||
You can set up a leave sign, by creating a sign, in the arena and/or lobby, like:
|
||||
|
||||
1. \[BlockHunt]
|
||||
2. Leave
|
||||
|
||||
You can set up a shop sign, by creating a sign like:
|
||||
|
||||
1. \[BlockHunt]
|
||||
2. Shop
|
||||
|
||||
Join your new arena with `/bh join \<name>`.
|
||||
|
||||
### Arena interface descriptions
|
||||
|
||||
@ -136,8 +158,20 @@ The amount of seconds a game will last. If the hiders are alive after this time,
|
||||
|
||||
#### blockAnnouncerTime
|
||||
|
||||
The amount of seconds
|
||||
The amount of seconds left when announcing the number of currently hiding players.
|
||||
|
||||
#### sword
|
||||
#### timeUntilHidersSword
|
||||
|
||||
The amount of seconds to wait before allowing hiders to defend themselves with a wooden sword.
|
||||
|
||||
#### hidersTokenWin
|
||||
|
||||
The number of tokens rewarded if the hiders win.
|
||||
|
||||
#### seekersTokenWin
|
||||
|
||||
The number of tokens rewarded if the seekers win.
|
||||
|
||||
#### killTokens
|
||||
|
||||
The number of tokens rewarded if a seeker kills a hider.
|
@ -19,8 +19,8 @@ import java.util.Map;
|
||||
public class Arena implements ConfigurationSerializable {
|
||||
|
||||
public final String arenaName;
|
||||
public final Location pos1;
|
||||
public final Location pos2;
|
||||
public final Location corner1;
|
||||
public final Location corner2;
|
||||
public int maxPlayers;
|
||||
public int minPlayers;
|
||||
public int amountSeekersOnStart;
|
||||
@ -52,7 +52,7 @@ public class Arena implements ConfigurationSerializable {
|
||||
public final List<Player> seekers;
|
||||
public final Scoreboard scoreboard;
|
||||
|
||||
public Arena(String arenaName, Location pos1, Location pos2, int maxPlayers, int minPlayers, int amountSeekersOnStart,
|
||||
public Arena(String arenaName, Location corner1, Location corner2, int maxPlayers, int minPlayers, int amountSeekersOnStart,
|
||||
int timeInLobbyUntilStart, int waitingTimeSeeker, int gameTime, int timeUntilHidersSword,
|
||||
int blockAnnouncerTime, boolean seekersCanHurtSeekers, boolean hidersCanHurtSeekers,
|
||||
boolean hidersCanHurtHiders, boolean seekersTakeFallDamage, boolean hidersTakeFallDamage,
|
||||
@ -62,8 +62,8 @@ public class Arena implements ConfigurationSerializable {
|
||||
List<Player> playersInArena, ArenaState gameState, int timer, List<Player> seekers,
|
||||
Scoreboard scoreboard) {
|
||||
this.arenaName = arenaName;
|
||||
this.pos1 = pos1;
|
||||
this.pos2 = pos2;
|
||||
this.corner1 = corner1;
|
||||
this.corner2 = corner2;
|
||||
this.maxPlayers = maxPlayers;
|
||||
this.minPlayers = minPlayers;
|
||||
this.amountSeekersOnStart = amountSeekersOnStart;
|
||||
@ -99,8 +99,8 @@ public class Arena implements ConfigurationSerializable {
|
||||
public @NotNull Map<String, Object> serialize() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("arenaName", arenaName);
|
||||
map.put("pos1", pos1);
|
||||
map.put("pos2", pos2);
|
||||
map.put("pos1", corner1);
|
||||
map.put("pos2", corner2);
|
||||
map.put("maxPlayers", maxPlayers);
|
||||
map.put("minPlayers", minPlayers);
|
||||
map.put("amountSeekersOnStart", amountSeekersOnStart);
|
||||
|
@ -73,9 +73,15 @@ public class ArenaHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if (!alreadyJoined) {
|
||||
if (alreadyJoined) {
|
||||
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_ALREADY_JOINED);
|
||||
return;
|
||||
}
|
||||
|
||||
for (Arena arena : MemoryStorage.arenaList) {
|
||||
if (arena.arenaName.equalsIgnoreCase(arenaName)) {
|
||||
if (!arena.arenaName.equalsIgnoreCase(arenaName)) {
|
||||
continue;
|
||||
}
|
||||
found = true;
|
||||
if (arena.disguiseBlocks.isEmpty()) {
|
||||
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_NO_BLOCKS_SET);
|
||||
@ -104,14 +110,14 @@ public class ArenaHandler {
|
||||
|
||||
Location zero = new Location(Bukkit.getWorld(player.getWorld().getName()), 0, 0, 0, 0, 0);
|
||||
if (arena.lobbyWarp != null && arena.hidersWarp != null && arena.seekersWarp != null && arena.spawnWarp != null) {
|
||||
if (!arena.lobbyWarp.equals(zero) && !arena.hidersWarp.equals(zero) && !arena.seekersWarp.equals(zero) && !arena.spawnWarp.equals(zero)) {
|
||||
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.hasPermission(player, Permission.JOIN_FULL, false)) {
|
||||
if (arena.playersInArena.size() >= arena.maxPlayers &&
|
||||
!PermissionsManager.hasPermission(player, Permission.JOIN_FULL, false)) {
|
||||
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_FULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
boolean canWarp = PlayerHandler.teleport(player, arena.lobbyWarp);
|
||||
if (!canWarp) {
|
||||
@ -227,11 +233,6 @@ public class ArenaHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MessageManager.sendFMessage(player, MessageKey.ERROR_JOIN_ALREADY_JOINED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
MessageManager.sendFMessage(player, MessageKey.ERROR_NO_ARENA, "name-" + arenaName);
|
||||
@ -258,9 +259,7 @@ public class ArenaHandler {
|
||||
|
||||
if (cleanup) {
|
||||
arena.playersInArena.remove(player);
|
||||
if (arena.seekers.contains(player)) {
|
||||
arena.seekers.remove(player);
|
||||
}
|
||||
|
||||
if (arena.playersInArena.size() < arena.minPlayers && arena.gameState.equals(ArenaState.STARTING)) {
|
||||
arena.gameState = ArenaState.WAITING;
|
||||
|
@ -13,15 +13,11 @@ public class BlockHuntTabCompleter implements TabCompleter {
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command cmd, @NotNull String label,
|
||||
String[] args) {
|
||||
|
||||
for (Command command : MemoryStorage.commands) {
|
||||
if (cmd.getName().equalsIgnoreCase(command.label())) {
|
||||
if (args.length == 1) {
|
||||
if (cmd.getName().equalsIgnoreCase(command.label()) && args.length == 1) {
|
||||
return command.mainTabList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class HelpCommand extends DefaultCommand {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean execute(Player player, String[] args) {
|
||||
int amountCommands = 0;
|
||||
|
@ -28,11 +28,11 @@ public class OnPlayerMoveEvent implements Listener {
|
||||
if (arena.playersInArena.contains(player)) {
|
||||
if (arena.gameState == ArenaState.IN_GAME) {
|
||||
MemoryStorage.moveLoc.put(player, player.getLocation());
|
||||
if (arena.pos1 == null || arena.pos2 == null) {
|
||||
if (arena.corner1 == null || arena.corner2 == null) {
|
||||
BlockHunt.plugin.getLogger().info("Arena:" +
|
||||
arena.arenaName + " appears to have bad coords : pos1:" +
|
||||
((arena.pos1 != null) ? arena.pos1.toString() : " NULL") + " Pos2:" +
|
||||
((arena.pos2 != null) ? arena.pos2.toString() : " NULL"));
|
||||
((arena.corner1 != null) ? arena.corner1.toString() : " NULL") + " Pos2:" +
|
||||
((arena.corner2 != null) ? arena.corner2.toString() : " NULL"));
|
||||
BlockHunt.plugin.getLogger().info("Player has been returned to hiderswarp due to bad arena state");
|
||||
//event.setCancelled(true);
|
||||
Location loc = player.getLocation();
|
||||
@ -41,12 +41,12 @@ public class OnPlayerMoveEvent implements Listener {
|
||||
PlayerHandler.teleport(player, arena.hidersWarp);
|
||||
return;
|
||||
}
|
||||
double maxX = Math.max(arena.pos1.getX(), arena.pos2.getX());
|
||||
double minX = Math.min(arena.pos1.getX(), arena.pos2.getX());
|
||||
double maxY = Math.max(arena.pos1.getY(), arena.pos2.getY());
|
||||
double minY = Math.min(arena.pos1.getY(), arena.pos2.getY());
|
||||
double maxZ = Math.max(arena.pos1.getZ(), arena.pos2.getZ());
|
||||
double minZ = Math.min(arena.pos1.getZ(), arena.pos2.getZ());
|
||||
double maxX = Math.max(arena.corner1.getX(), arena.corner2.getX());
|
||||
double minX = Math.min(arena.corner1.getX(), arena.corner2.getX());
|
||||
double maxY = Math.max(arena.corner1.getY(), arena.corner2.getY());
|
||||
double minY = Math.min(arena.corner1.getY(), arena.corner2.getY());
|
||||
double maxZ = Math.max(arena.corner1.getZ(), arena.corner2.getZ());
|
||||
double minZ = Math.min(arena.corner1.getZ(), arena.corner2.getZ());
|
||||
|
||||
Location loc = player.getLocation();
|
||||
if (loc.getBlockX() > maxX) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user