Skip to content

Releases: Strokkur424/StrokkCommands

🔮 StrokkCommands 2.0.3

01 Feb 10:01
74c1177

Choose a tag to compare

Renames the plugin method parameter in Velocity in order to not intervene with constructor parameters called plugin in Velocity.

Full Changelog: v2.0.2...v2.0.3

🔮 StrokkCommands 2.0.2

08 Jan 12:44
177ec1b

Choose a tag to compare

Another hotfix release regarding the code generation for executor wrappers surrounding the reflective method gather.

Full Changelog: v2.0.1...v2.0.2

🔮 StrokkCommands 2.0.1

08 Jan 12:22
c55a804

Choose a tag to compare

A hotfix release which fixes an issue where executor wrapper's reflection method imports were not gathered.

Full Changelog: v2.0.0...v2.0.1

🔮 StrokkCommands 2.0.0

06 Jan 19:31
2e0e207

Choose a tag to compare

🚀 What's Changed?

This release marks a major rewrite of the processor yet again. In addition to supporting Paper as a platform, we now also support Velocity.

In addition to expanding onto further platforms, new features have also been added! These include the following:

  • Custom user-defined annotations for suggestions and requirements
  • External-subcommands fields defined as final can now be initialized in the constructor
  • Improved parameters system which allows for special parameters (CommandSender, CommandSourceStack, CommandContext<CommandSourceStack>, +executor params) to be declared anywhere on the command, with the option to omit them, meaning command handlers may have no parameters now.
  • New @ExecuteWrapper annotation for any advanced wrapping needs
  • Support for "inherited" annotations

Furthermore, some bugs have been fixed and code has been moved around.

The documentation is not yet updated, however you can find the PR here: Strokkur424/strokkur.net#2. A preview can be seen at https://feat-commands-2-strokkcommands.strokkur-24.workers.dev/.

📦 Adding The Dependency

The dependency has once again moved places! You can get the updated dependency here:

dependencies {
  // Paper
  compileOnly("net.strokkur.commands:annotations-paper:2.0.0")
  annotationProcessor("net.strokkur.commands:processor-paper:2.0.0")

  // Velocity
  compileOnly("net.strokkur.commands:annotations-velocity:2.0.0")
  annotationProcessor("net.strokkur.commands:processor-velocity:2.0.0")
}

🥇 Merged Pull Requests

✨ New Contributors

Full Changelog: v1.5.0...v2.0.0

🔥 StrokkCommands 1.5.0

21 Oct 20:33
3e4f600

Choose a tag to compare

❗ Breaking Changes

Since this release, using the @Command annotation on nested classes or fields no longer has any effect. It was not intended for them to be used anywhere else than top-level classes. This release simply fixes that.

🚀 Other Noteworthy Things

This release features another relatively major rewrite of some internal stuff. Because of this, there is a chance that something might have broke. If you encounter any bugs, make sure to report them in the StrokkCommands Discord server.

🥇 What's Changed

✨ New Contributors

Full Changelog: v1.4.2...v1.5.0

🔥 StrokkCommands 1.4.2

28 Sep 10:57
3a97d5e

Choose a tag to compare

Another smaller release! This release adds published JavaDocs and sources to the maven repository. All annotations now also have proper JavaDocs which explain the usage of them. The JavaDocs are currently not published online, but you can view them inside your IDE.

The processor has been modified slightly to more dynamically support java versions. You can therefore use it with Java 25 now.

Full Changelog: v1.4.1...v1.4.2

🔥 StrokkCommands 1.4.1

21 Sep 18:22
8621402

Choose a tag to compare

A hotfix release which fixes the maven publish configuration resulting in the 1.4.0 dependency not being usable.

Full Changelog: v1.4.0...v1.4.1

🔥 StrokkCommands 1.4.0

14 Sep 18:01
85dc1ab

Choose a tag to compare

With another, minor, internal rewrite of, this time, the annotation parsing system, I am pleased to announce StrokkCommands version 1.4.0! The most notable changes are the introduction of external subcommands with command prototypes and some changes in the publishing pipeline.

What's Changed

  • feat(docs): add records and subcommands docs by @Strokkur424 in #15
  • feat: add support for declaring commands in separate files by @Strokkur424 in #19

New maven coordinates

The project's maven coordinates have now changed! You can find the new versions under the following coordinates:

compileOnly("net.strokkur:commands-annotations:1.4.0")
annotationProcessor("net.strokkur:commands-processor:1.4.0")

That's right! No more pesky -SNAPSHOT suffix and I have omitted the strokk- prefix from the artefact name, since it is clearly overkill with my domain name being there already anyways.

External subcommands (with prototypes)

You can now have external subcommands! The way it works is that you declare a separate class, with executor methods (and anything else commands support) and can use them in other commands!

For example, a prototype might look like this:

// No @Command annotation!
@NullMarked
public class SendPresetPrototype {

  private final String message;

  public SendPresetPrototype(String message) {
    this.message = message
  }
  
  @Executes
  void sendPrototype(CommandSender sender, @Executor Entity executor) {
    executor.sendMessage(MiniMessage.miniMessage().deserialize(
        this.message,
        Placeholder.component("sender", sender.name()),
        Placeholder.component("executor", executor.name())
    );
  }
}

And you can reuse this prototype like this:

@Command("sendpreset")
class SendPresetCommand {

  @Subcommand("hello")
  SendPresetPrototype hello = new SendPresetPrototype("<light_purple><sender></light_purple> said hello to you!");

  @Subcommand("1+1")
  SendPresetPrototype hello = new SendPresetPrototype("<green>1<white> + </white> 1</green> = <red>11</red>");
}

You can read up on a few more details on the designated docs page.

Full Changelog: v1.3.0...v1.4.0

🔥 StrokkCommands 1.3.0

29 Aug 17:43
ea6168b

Choose a tag to compare

This release features an almost full rewrite of the internal code base. There have been almost no annotation changes, meaning this version should be a drop-in replacement to old projects.

What's Changed

Subcommands

You can now create subcommands by nesting classes! The following two code fragments generate the same Brigadier code:

@Command("command")
class Command {

	@Executes("abc")
	void execute(CommandSender sender);
}
@Command("command")
class Command {
	
	@Command("abc")
	class Subcommand {
		
		@Executes
		void execute(CommandSender sender);
	}
}

Whilst this example shows the syntax for subcommands, it doesn't make for a logical example. But you should get the idea.

Records

You can define top-level and nested commands using records. A record (like a class) needs the @Command annotation. All record components are treated as arguments, which any executor method can use. This greatly reduces code duplication and makes your commands easier to read.

@Command("some-args")
record SomeArgsCommand(String word, @Literal String someLiteral, int anInt) {

	@Executes // --> /some-args <word> someLiteral <int>
	void standardExecutor(CommandSender sender);
	
	@Executes // --> /some-args <word> someLiteral <int> <float>
	void floatExecutor(CommandSender sender, float anotherFloat);

}

Nested/inner records can be used as subcommands as well.

Misc changes

  • The argument for the @Literal annotation can now be omitted to default to the parameter name.
  • Executor parameters (entity/player) now do an instanceof cast in generated .instanceof cast in order to make sure no errors occur, even if the requirement were to fail.
  • Permissions have been tweaked for a better use experience and now correctly inhert themselves onto the parent nodes.
  • Generated code now has JavaDocs and the system for printing has been reworked to provide human-like code style (including smarter imports).

Full Changelog: v1.2.4...v1.3.0

🔥 StrokkCommands 1.2.4

02 Jul 13:50
v1.2.4
ebd74af

Choose a tag to compare

Todays release fixes a few bugs I have encountered during usage.

Get the release

repositories { 
    maven("https://eldonexus.de/repository/maven-public/")
}

dependencies {
	compileOnly("net.strokkur", "strokk-commands-annotations", "1.2.4-SNAPSHOT")
	annotationProcessor("net.strokkur", "strokk-commands-processor", "1.2.4-SNAPSHOT")
}

What's Changed

  • fix: Single PlayerProfile argument does not compile by @Strokkur424 in #7
  • fix: Integer range argument using a double range argument type by @Strokkur424 in #8

Full Changelog: v1.2.3...v1,2,4