Skip to content

Conversation

@The-Epic
Copy link
Member

This PR aims to allow for a commands to use brigadier to its advantage while using a similar layout to how normal Commands work. It also migrates the existing registerCommands to use the short-hand provided in java plugin and converts most references of Plugin to JavaPlugin. Also adds a test plugin using a similar setup from Paper, currently includes a test for commands but will be removed prior to merge.

Not finished yet, feedback wanted.
Main points, wanted are about design and should quick getters be added for arguments, eg: getString, getPlayer, getLocation etc etc for built in argument types from brigadier or paper

this(label, CommandSettings.DEFAULT_COMMAND_SETTINGS);
}

public void execute(@NotNull CommandContext<@NotNull CommandSourceStack> context) {
Copy link
Member

@Y2Kwastaken Y2Kwastaken Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would it feel to wrap CommandContext in this case? I feel like this API could be nicer if we served something "easier" Paper has a lot of these really annoying inbetween types, which if we wrap, we could resolve in a more "beautiful manner" Mainly what comes to my mind is any form of Registry entry or Location is absolutely annoying to resolve.

It's also nice because we know we'll always have a CommandSourceStack so we can chuck away that annoying generic too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the info we actually end up needing from the context, we could technically use the arguments the command knows about to pass a CommandSourceStack with some form of argument collection, just depends on how we handle the generics on that collection

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the info we actually end up needing from the context, we could technically use the arguments the command knows about to pass a CommandSourceStack with some form of argument collection, just depends on how we handle the generics on that collection

Perhaps I'll try building something out this weekend and we see how we like it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, lmk if there's any ideas you have that I could attempt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants