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