Adds skeleton classes for the three group commands

This commit is contained in:
Kristian Knarvik 2023-03-30 20:24:47 +02:00
parent f9008ca050
commit c29fcdc166
5 changed files with 111 additions and 18 deletions

View File

@ -9,6 +9,9 @@ import net.knarcraft.dropper.arena.DropperArenaSession;
import net.knarcraft.dropper.command.CreateArenaCommand;
import net.knarcraft.dropper.command.EditArenaCommand;
import net.knarcraft.dropper.command.EditArenaTabCompleter;
import net.knarcraft.dropper.command.GroupListCommand;
import net.knarcraft.dropper.command.GroupSetCommand;
import net.knarcraft.dropper.command.GroupSwapCommand;
import net.knarcraft.dropper.command.JoinArenaCommand;
import net.knarcraft.dropper.command.JoinArenaTabCompleter;
import net.knarcraft.dropper.command.LeaveArenaCommand;
@ -108,13 +111,16 @@ public final class Dropper extends JavaPlugin {
pluginManager.registerEvents(new PlayerLeaveListener(), this);
pluginManager.registerEvents(new CommandListener(), this);
registerCommand("dropperreload", new ReloadCommand(), null);
registerCommand("droppercreate", new CreateArenaCommand(), null);
registerCommand("dropperlist", new ListArenaCommand(), null);
registerCommand("dropperjoin", new JoinArenaCommand(), new JoinArenaTabCompleter());
registerCommand("dropperleave", new LeaveArenaCommand(), null);
registerCommand("dropperedit", new EditArenaCommand(), new EditArenaTabCompleter());
registerCommand("dropperremove", new RemoveArenaCommand(), new RemoveArenaTabCompleter());
registerCommand("dropperReload", new ReloadCommand(), null);
registerCommand("dropperCreate", new CreateArenaCommand(), null);
registerCommand("dropperList", new ListArenaCommand(), null);
registerCommand("dropperJoin", new JoinArenaCommand(), new JoinArenaTabCompleter());
registerCommand("dropperLeave", new LeaveArenaCommand(), null);
registerCommand("dropperEdit", new EditArenaCommand(), new EditArenaTabCompleter());
registerCommand("dropperRemove", new RemoveArenaCommand(), new RemoveArenaTabCompleter());
registerCommand("dropperGroupSet", new GroupSetCommand(), null);
registerCommand("dropperGroupSwap", new GroupSwapCommand(), null);
registerCommand("dropperGroupList", new GroupListCommand(), null);
}
@Override

View File

@ -0,0 +1,19 @@
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;
public class GroupListCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] arguments) {
// TODO: Display all groups if no argument is specified.
// TODO: If a group is set and it exists, list all arenas in the correct order, and numbered (the order denotes
// the order players need to complete the arenas in)
return false;
}
}

View File

@ -0,0 +1,21 @@
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;
public class GroupSetCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] arguments) {
// TODO: Check if the given group is valid
// TODO: Try and get the group from ArenaHandler.getGroup
// TODO: Create a new group if not found
// TODO: Set the group of the arena
// TODO: Announce success
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;
public class GroupSwapCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] arguments) {
// TODO: Make sure the two arenas exist
// TODO: Make sure the two arenas belong to the same group
// TODO: Swap the order of the two groups
// TODO: Announce success
return false;
}
}

View File

@ -4,50 +4,77 @@ main: net.knarcraft.dropper.Dropper
api-version: 1.19
description: A plugin for dropper mini-games
# Note to self: Aliases must be lowercase!
commands:
dropperreload:
dropperGroupSet:
aliases:
- dgset
permission: dropper.edit
usage: |
/<command> <arena> <group>
- The group will be created if it doesn't already exist
- Use "none" or "null" as the group to release the arena from its group
description: Sets the group of the given arena
dropperGroupSwap:
aliases:
- dgswap
permission: dropper.edit
usage: |
/<command> <arena1> <arena2>
- The two arenas must be in the same group
description: Swaps the order of two arenas in the same group
dropperGroupList:
aliases:
- dglist
permission: dropper.edit
usage: |
/<command> [group]
- Existing groups will be listed if used without an argument
- Supplying a group shows the group's arenas
description: Lists existing groups and their arenas
dropperReload:
aliases:
- dreload
permission: dropper.admin
usage: /<command>
description: Reloads all data from disk
dropperlist:
dropperList:
aliases:
- dlist
permission: dropper.join
usage: /<command>
description: Used to list all current dropper arenas
dropperjoin:
dropperJoin:
aliases:
- djoin
permission: dropper.join
usage: |
/<command> <arena> [mode]
Mode can be used to select challenge modes which can be played after beating the arena.
inverted = A game-mode where the WASD buttons are inverted
random = A game-mode where the WASD buttons toggle between being inverted and not
- Mode can be used to select challenge modes which can be played after beating the arena.
- inverted = A game-mode where the WASD buttons are inverted
- random = A game-mode where the WASD buttons toggle between being inverted and not
description: Used to join a dropper arena
dropperleave:
dropperLeave:
aliases:
- dleave
permission: dropper.join
usage: /<command>
description: Used to leave the current dropper arena
droppercreate:
dropperCreate:
aliases:
- dcreate
permission: dropper.create
usage: |
/<command> <arena> <property> [new value]
Valid properties: name, spawnLocation, exitLocation, verticalVelocity, horizontalVelocity, winBlockType
- Valid properties: name, spawnLocation, exitLocation, verticalVelocity, horizontalVelocity, winBlockType
description: Used to create a new dropper arena
dropperedit:
dropperEdit:
aliases:
- dedit
permission: dropper.edit
usage: /<command> (Details not finalized)
description: Used to edit an existing dropper arena
dropperremove:
dropperRemove:
aliases:
- dremove
permission: dropper.remove