diff --git a/src/main/java/org/spongepowered/api/event/SpongeEventFactory.java b/src/main/java/org/spongepowered/api/event/SpongeEventFactory.java index 18933512010..26f69529700 100644 --- a/src/main/java/org/spongepowered/api/event/SpongeEventFactory.java +++ b/src/main/java/org/spongepowered/api/event/SpongeEventFactory.java @@ -88,7 +88,7 @@ import org.spongepowered.api.event.cause.Cause; import org.spongepowered.api.event.cause.entity.damage.DamageModifier; import org.spongepowered.api.event.cause.entity.health.HealthModifier; -import org.spongepowered.api.event.command.SendCommandEvent; +import org.spongepowered.api.event.command.CommandProcessEvent; import org.spongepowered.api.event.command.TabCompleteEvent; import org.spongepowered.api.event.data.ChangeDataHolderEvent; import org.spongepowered.api.event.economy.EconomyTransactionEvent; @@ -1015,21 +1015,39 @@ public static TargetTileEntityEvent createTargetTileEntityEvent(Cause cause, Til /** * AUTOMATICALLY GENERATED, DO NOT EDIT. * Creates a new instance of - * {@link org.spongepowered.api.event.command.SendCommandEvent}. + * {@link org.spongepowered.api.event.command.CommandProcessEvent.Post}. * * @param cause The cause * @param arguments The arguments * @param command The command * @param result The result - * @return A new send command event + * @return A new post command process event */ - public static SendCommandEvent createSendCommandEvent(Cause cause, String arguments, String command, CommandResult result) { + public static CommandProcessEvent.Post createCommandProcessEventPost(Cause cause, String arguments, String command, CommandResult result) { HashMap values = new HashMap<>(); values.put("cause", cause); values.put("arguments", arguments); values.put("command", command); values.put("result", result); - return SpongeEventFactoryUtils.createEventImpl(SendCommandEvent.class, values); + return SpongeEventFactoryUtils.createEventImpl(CommandProcessEvent.Post.class, values); + } + + /** + * AUTOMATICALLY GENERATED, DO NOT EDIT. + * Creates a new instance of + * {@link org.spongepowered.api.event.command.CommandProcessEvent.Pre}. + * + * @param cause The cause + * @param arguments The arguments + * @param command The command + * @return A new pre command process event + */ + public static CommandProcessEvent.Pre createCommandProcessEventPre(Cause cause, String arguments, String command) { + HashMap values = new HashMap<>(); + values.put("cause", cause); + values.put("arguments", arguments); + values.put("command", command); + return SpongeEventFactoryUtils.createEventImpl(CommandProcessEvent.Pre.class, values); } /** diff --git a/src/main/java/org/spongepowered/api/event/command/SendCommandEvent.java b/src/main/java/org/spongepowered/api/event/command/CommandProcessEvent.java similarity index 64% rename from src/main/java/org/spongepowered/api/event/command/SendCommandEvent.java rename to src/main/java/org/spongepowered/api/event/command/CommandProcessEvent.java index 6c2d7fdc30f..1d148b24c96 100644 --- a/src/main/java/org/spongepowered/api/event/command/SendCommandEvent.java +++ b/src/main/java/org/spongepowered/api/event/command/CommandProcessEvent.java @@ -29,29 +29,60 @@ import org.spongepowered.api.event.Event; /** - * Fired when a command is sent + * Fired when a command is processed */ -public interface SendCommandEvent extends Event, Cancellable { +public interface CommandProcessEvent extends Event { /** - * Get the command as a string, without any sort of command prefix. - * - *

For example, if the message was {@code /example bob 3 -f}, then - * the command would be {@code example}.

- * - * @return The command + * Fired before the command is processed */ - String getCommand(); + public interface Pre extends CommandProcessEvent, Cancellable { + + /** + * Set the command as a string, without any sort of command prefix. + * + *

For example, if the message was {@code /example bob 3 -f}, then + * the command would be {@code example}.

+ * + * @param command The command + */ + void setCommand(String command); + + /** + * Set the arguments as a string. + * + *

For example, if the message was {@code /example bob 3 -f}, then + * the arguments would be {@code bob 3 -f}.

+ * + * @param arguments The arguments + */ + void setArguments(String arguments); + + } + + /** + * Fired after the command is processed + */ + public interface Post extends CommandProcessEvent { + + /** + * The result of the command. + * + * @return The result of the command + */ + CommandResult getResult(); + + } /** - * Set the command as a string, without any sort of command prefix. + * Get the command as a string, without any sort of command prefix. * *

For example, if the message was {@code /example bob 3 -f}, then * the command would be {@code example}.

* - * @param command The command + * @return The command */ - void setCommand(String command); + String getCommand(); /** * Get the arguments as a string. @@ -63,28 +94,4 @@ public interface SendCommandEvent extends Event, Cancellable { */ String getArguments(); - /** - * Set the arguments as a string. - * - *

For example, if the message was {@code /example bob 3 -f}, then - * the arguments would be {@code bob 3 -f}.

- * - * @param arguments The arguments - */ - void setArguments(String arguments); - - /** - * The result of the command. - * - * @return The result of the command - */ - CommandResult getResult(); - - /** - * Sets the result of the command. - * - * @param result The result of the command - */ - void setResult(CommandResult result); - }