mirror of
https://github.com/SunNetservers/Launchpad.git
synced 2024-12-05 01:43:15 +01:00
Adds /launchpad abort #3
This commit is contained in:
parent
d9c9813994
commit
11f969a3f8
@ -19,8 +19,6 @@ public class LaunchpadCommand implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Add an abort action to clear the player's modification requests
|
||||
|
||||
// TODO: Properly allow nulling (unsetting) values
|
||||
|
||||
if (arguments.length < 1) {
|
||||
@ -44,6 +42,12 @@ public class LaunchpadCommand implements CommandExecutor {
|
||||
case ADD, REMOVE -> request = new ModificationRequest(action, null);
|
||||
case VERTICAL_VELOCITY, HORIZONTAL_VELOCITY, FIXED_DIRECTION ->
|
||||
request = new ModificationRequest(action, arguments[1]);
|
||||
case ABORT -> {
|
||||
// Retrieving modification requests also removes them
|
||||
ModificationRequestHandler.getRequests(player.getUniqueId());
|
||||
commandSender.sendMessage("Launchpad modifications cleared");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
ModificationRequestHandler.addRequest(player.getUniqueId(), request);
|
||||
commandSender.sendMessage("Right-click the block to modify launchpad properties for");
|
||||
|
@ -33,6 +33,11 @@ public enum ModificationAction {
|
||||
* The action of setting the fixed direction of a launchpad
|
||||
*/
|
||||
FIXED_DIRECTION("fixedDirection", true),
|
||||
|
||||
/**
|
||||
* The action of aborting previous actions
|
||||
*/
|
||||
ABORT("abort", false),
|
||||
;
|
||||
|
||||
private final @NotNull String commandName;
|
||||
|
@ -12,7 +12,7 @@ commands:
|
||||
description: Used to reload the Launchpad plugin
|
||||
permission: launchpad.reload
|
||||
launchpad:
|
||||
usage: /<command> <add|remove|verticalVelocity|horizontalVelocity|fixedDirection> [value]
|
||||
usage: /<command> <add | remove | abort | verticalVelocity | horizontalVelocity | fixedDirection> [value]
|
||||
description: Used to alter launchpads
|
||||
permission: launchpad.modify
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user