Since it only compares the exact literal bytes, it's possible to have trailing characters that don't match.
For example, /timings ons would crash because the 'on' overload would match, but leave a trailing 's' behind.
this was a problem with cmdalias, where just writing cmdalias alone would invoke cmdalias list.
In itself this wasn't particularly harmful, but it could've been a problem for other commands like timings.
This PR started out as an effort to decouple Command and CommandMap, but it's turned into a bit more than that.
A summary of changes:
## UX
- Added `cmdalias create`, `cmdalias delete` and `cmdalias list` commands
- `/help` now shows prefixed names such as `pocketmine:help`
- Prefixed command name (e.g. `pocketmine:help`) are now visible to Minecraft clients
- Permission denied messages are now able to show more useful context when e.g. checking subcommand permissions
- Multiple commands claiming an alias make the alias unusable (an error will be shown when used telling the user to pick from the namespaced names), instead of whichever plugin loaded last getting lucky
## API
- Added `CommandAliasMap`, which handles mapping of aliases to namespaced command IDs
- Added `CommandSender->getCommandAliasMap()` for user-specific aliases
- Added `CommandMap->getAliasMap()` for global fallback aliases
- `Command` no longer tracks its own registered aliases (now the job of `CommandMap`), breaking circular dependency
- Aliases must now be provided to `CommandMap->register()`
- Aliases can now be individually registered and unregistered without re-registering/unregistering the whole command using `CommandAliasMap` APIs
- Aliases are no longer namespaced, only the main command name (e.g. `pocketmine:?` is now gone while `pocketmine:help` still exists)
- `Command` now requires a `$namespace` parameter, which replaces the old `$fallbackPrefix` parameter of `register()`. It should be set to the name of the plugin.
Relevant issues
- #6508
- #3371 - this PR doesn't implement storage, but allows configuration of per-user aliases during server runtime
Initially proposed in #6575
This shows about a 10% performance improvement to both SubChunk->getBlockStateId() and SubChunk->setBlockStateId(), so definitely worth doing. It does result in increased complexity, but for a double digits performance gain, I think it's worth it.
Closes#6575
this fixes rendering of underwater TNT and possibly other chemistry blocks.
There doesn't seem to be a shortcut for this, and BDS also appears not to account for
this requirement, which is why underwater TNT also doesn't have the right texture in BDS.
fixes#6494