Dylan K. Taylor
7ce33d9375
Migrate final remaining EnumTrait users to native enums
2023-09-08 10:34:12 +01:00
Dylan K. Taylor
d1a7c1d453
Constify server.properties references
2023-08-25 12:49:39 +01:00
BrandPVP
9c391a6809
Declare built-in command names inside the constructor ( #5487 )
...
This increases code consistency by placing the name in the same place where everything else about the command is defined.
2023-01-09 20:43:08 +00:00
Dylan T
8e97e9dcda
SimpleCommandMap: Enforce command permissions by default ( #4681 )
...
this resolves many security issues, as well as removing a ton of boilerplate code.
It may be desirable to react to permission denied; this can be done by overriding Command->testPermission(), or by using setPermissionMessage() to set a custom permission denied message.
2022-08-15 16:42:51 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
Matthew Jordan
a41404bd8a
Allow gamemode strings for gamemode property in server.properties ( #4638 )
...
closes #2692
2021-12-14 22:56:22 +00:00
Dylan K. Taylor
fb570970a8
Localize gamemode command errors
2021-10-02 21:22:54 +01:00
Dylan K. Taylor
3b7580688c
Stop auto-translating string descriptions/usages for commands
...
Require usage of Translatable for translations.
2021-09-11 16:46:40 +01:00
Dylan K. Taylor
039c59856d
Remove % translation prefixes dotted around all over the place
2021-08-15 20:03:38 +01:00
Dylan K. Taylor
60ac76a3bc
Remove more usages of hardcoded translation keys
2021-08-15 19:22:40 +01:00
Dylan K. Taylor
2293bd948d
Added KnownTranslationFactory and use it in as many places as possible
...
this makes translation usage much more statically analysable.
The only places this isn't used are:
- places that prefix translations with colours (those are still a problem)
- places where server/client translations don't match (e.g. gameMode.changed accepts different parameters in vanilla than in PM)
2021-08-10 14:50:40 +01:00
Dylan K. Taylor
94e16f416d
Added KnownTranslationKeys (generated) and start using it
2021-06-29 22:46:04 +01:00
Dylan K. Taylor
6fb8ac211e
Make GameMode::fromString() and PluginEnableOrder::fromString() return null, instead of throwing exceptions
...
since these are always used for handling userdata, it doesn't make sense for them to throw exceptions.
2021-06-27 20:56:51 +01:00
Dylan K. Taylor
902ea515f7
Separate ID handling from GameMode
...
the aliases of 0,1,2,3 remain for user-interface level compatibility.
2021-06-27 20:32:35 +01:00
Dylan K. Taylor
bf7d69b69e
Stop hardcoding permission names everywhere
...
using strings for permission names is nearly as shitty, but this is at least cross-referencable and statically analysable.
2021-06-26 19:14:51 +01:00
Dylan K. Taylor
fe649d8d70
Extract ServerConfigGroup from Server
...
this API isn't very nice, but it's pretty much the same as the original, and at least this can be _kinda_ unit-tested...
2020-05-24 15:48:03 +01:00
Dylan K. Taylor
5499ac620c
Removed pocketmine subdirectory, map PSR-4 style
2019-07-30 19:14:57 +01:00