Skip to content
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

Pull upstream #1

Open
wants to merge 1,796 commits into
base: dev/tooltips
Choose a base branch
from
Open

Pull upstream #1

wants to merge 1,796 commits into from

Conversation

469512345
Copy link
Owner

No description provided.

DerEchtePilz and others added 30 commits January 8, 2024 19:19
- Make all previously failing tests succeed
- Merge tests for registering before and after server enables using `@ParameterizedTest`
- Update test method names to match other test classes
- Add assertions that thoroughly inspect the Brigadier `CommandDispatcher` and Bukkit `CommandMap`
- Add TODO mentioning additional tests

Also, removed unnecessary diff in `CommandRegistrationTests`
This adds tests for CommandTrees and adds an initial try of tests for conflicting command names but different namespaces.
While the tests for the CommandTrees work with namespaces, the other one currently doesn't and is disabled.
Tests are still failing though and I have no idea why.
In-game tests, however, seem to confirm that everything works.

I am not sure how to continue.
Also adds a regex to only allow lowercase letters, numbers, underscores, hyphens and periods as per https://minecraft.wiki/w/Resource_location#Java_Edition
Part of #509

Expanded namespace+permissions tests

Fixed bug where `fixPermissions` would not do anything. This happened because the `registeredPermissions` map refers to commands with their namespace, while the `registeredCommandMap` refers to commands without their namespace. So, `fixPermissions` thought all the commands were aliases and skipped everything.

 The fix I did removed the `registeredCommandMap` #509 (comment). Instead, all command name and permissions are kept track of in the `registeredPermissions` map.

 I also made some changes to the test setup, so the mocked `CraftPlayer` returned by `enableWithNamespaces` worked properly with setting and updating permissions.

 Note the test is not yet fully working. There is one assertion that still fails if commands are registered after the server enables. I think `CommandAPIBukkit#postCommandRegistration` is still doing something incorrect, as discussed on the CommandAPI discord https://discord.com/channels/745416925924032523/745419648970784821/1192439010132496474.
… minecraft namespace

This makes all the tests work as expected

When VanillaCommandWrappers are executed, they defer to the Brigadier dispatcher using their name. This was causing problems with permissions and conflicts when the minecraft namespace was involved. In certain cases, CommandMap commands were referencing different commands in the Brigadier dispatcher.

The changes here fix all that so CommandMap commands are always referencing the correct node in the Brigadier dispatcher.
Add support for custom namespaces for commands
SB2DD and others added 30 commits July 21, 2024 17:16
…eption

Made NullCommandSender not throw an exception on Paper
Fixed a grammatical mistake in arguments.md at line 20 in the second sentence. More specifically there was a duplicate 'is' word.
* Fix Folia implementation

* oops
Update latest.html with link to 9.5.2 (again)
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.