Prepares for command implementation

Removes some finished TODOs
Registers all listeners
Registers all commands
Adds more descriptive TODO comments to each command
Removes unintended double storage of dropper arena sessions in DropperArenaHandler
This commit is contained in:
2023-03-24 02:03:18 +01:00
parent ee8f232b0b
commit 906543f017
11 changed files with 126 additions and 58 deletions

View File

@ -5,12 +5,19 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
/**
* The command for creating a new dropper arena
*/
public class CreateArenaCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] strings) {
//TODO: Implement command behavior
//TODO: Make sure the console cannot run this
//TODO: Make sure the arena name isn't a duplicate and doesn't contain any unwanted characters
//TODO: Create a new arena
//TODO: Register the new arena in the arena handler
//TODO: Tell the user of success
return false;
}

View File

@ -5,12 +5,17 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
/**
* The command for editing an existing dropper arena
*/
public class EditArenaCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] strings) {
//TODO: Implement command behavior
//TODO: Make sure the console cannot run this
//TODO: If an arena name and a property is given, display the current value
//TODO: If an arena name, a property and a value is given, check if it's valid, and update the property
return false;
}

View File

@ -0,0 +1,24 @@
package net.knarcraft.dropper.command;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
/**
* The tab-completer for the edit arena command
*/
public class EditArenaTabCompleter implements TabCompleter {
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command,
@NotNull String label, @NotNull String[] args) {
//TODO: Tab-complete existing arena names
//TODO: If an arena name is given, tab-complete change-able properties
return null;
}
}

View File

@ -18,8 +18,10 @@ public class JoinArenaCommand implements CommandExecutor {
commandSender.sendMessage("This command must be used by a player");
return false;
}
//TODO: Implement command behavior
//TODO: Remember to check if the player is already in an arena first!
//TODO: Create a new arena session
//TODO: Register the session in the arena player registry
//TODO: Teleport the player to the arena's start location
return true;
}

View File

@ -5,13 +5,17 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
/**
* The command used to leave the current dropper arena
*/
public class LeaveArenaCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] strings) {
//TODO: Implement command behavior
//TODO: Make sure the console cannot run this
//TODO: If the player isn't currently in an arena, just display an error message
//TODO: Trigger the player's session's triggerQuit() method
return false;
}

View File

@ -0,0 +1,20 @@
package net.knarcraft.dropper.command;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
/**
* A command for listing existing dropper arenas
*/
public class ListArenaCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label,
@NotNull String[] args) {
//TODO: List all existing arenas, and possibly information about a specified arena
return false;
}
}

View File

@ -5,13 +5,18 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
/**
* The method used for removing an existing arena
*/
public class RemoveArenaCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] strings) {
//TODO: Implement command behavior
//TODO: Make sure to kick players if the arena is currently in use
//TODO: Make sure to kick any playing players if the arena is currently in use, by triggering their sessions'
// triggerQuit() method
//TODO: Remove the arena from DropperArenaHandler
//TODO: Notify the user of success
return false;
}