-
-
Notifications
You must be signed in to change notification settings - Fork 127
feat: Command for placing Waystones #1103 #1112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.21.11
Are you sure you want to change the base?
Conversation
| .then(argument("name", StringArgumentType.word()).executes(context -> { | ||
| final var pos = BlockPosArgument.getLoadedBlockPos(context, "pos"); | ||
| final var name = StringArgumentType.getString(context, "name"); | ||
| ServerLevel level = context.getSource().getLevel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
level variable should be used below if we're already creating it anyways. Currently seems to be unused?
| final var pos = BlockPosArgument.getLoadedBlockPos(context, "pos"); | ||
| final var name = StringArgumentType.getString(context, "name"); | ||
| ServerLevel level = context.getSource().getLevel(); | ||
| WaystonesAPI.placeWaystone(context.getSource().getLevel(), pos, WaystoneStyles.DEFAULT).ifPresent(waystone -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of always using WaystoneStyles.DEFAULT, there should be a parameter for the style to use
| .then(Commands.literal("place") | ||
| .requires(BalmCommands.requirePermission(PERMISSION_WAYSTONES_ACTIVATE)) | ||
| .then(argument("pos", BlockPosArgument.blockPos()) | ||
| .then(argument("name", StringArgumentType.word()).executes(context -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.word() limits it to a single word in a name, but waystone names can have multiple words too
| })))) | ||
|
|
||
| .then(Commands.literal("place") | ||
| .requires(BalmCommands.requirePermission(PERMISSION_WAYSTONES_ACTIVATE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use its own permission rather than reusing the /waystones activate permission
No description provided.