262 Commits

Author SHA1 Message Date
Dylan K. Taylor
7b02cc3efd Implemented #3836: Replace setCancelled() in events with cancel() and uncancel()
The motivation for this is to prevent passing a dynamic argument to cancellation, which in almost all cases is a bug in user code. This same mistake also appears in a few places in the PM core (as seen in this commit), but in those cases the mistakes were mostly harmless since they were taking place before the event was actually called.
closes #3836
2020-09-26 14:31:56 +01:00
Dylan K. Taylor
2c29634d03 Remove VERSION and GIT_COMMIT constants
these are now lazily computed in VersionInfo as needed.
2020-07-25 19:17:33 +01:00
Dylan K. Taylor
2645b19617 Convert VersionInfo into a final class
this allows it to be loaded by the autoloader without additional changes.
2020-07-25 19:00:48 +01:00
Dylan K. Taylor
bc52a38922 Improved network bandwidth data collection 2020-07-21 19:21:27 +01:00
Dylan K. Taylor
92f6967665 Command: validate permissions, require permission registration in advance of commands using them
this fixes #3200.
This causes permissions to be registered before plugin load, which changes some behaviour, but after discussions on #internals-dev we couldn't see any reason to keep the behaviour the way it was, and several reasons to change it to be something like this.
2020-07-08 13:50:38 +01:00
Dylan K. Taylor
96541763f1 ConsoleCommandSender: inject Language via constructor 2020-07-01 13:38:05 +01:00
Dylan K. Taylor
52fd1a8c1d CommandSender: export getLanguage()
this currently serves as a proxy to the server main language, but it can be used by third party implementations to choose a non-Server language.
2020-06-22 20:05:23 +01:00
Dylan K. Taylor
11eb1f1c5e imports cleanup 2020-06-18 20:01:19 +01:00
Dylan K. Taylor
edc3156bea Rename NetworkCipher -> EncryptionContext 2020-06-18 11:37:53 +01:00
Dylan K. Taylor
506f98efc4 Eliminate usages of BaseNbtSerializer->readCompressed() and BaseNbtSerializer->writeCompressed() 2020-06-17 14:31:56 +01:00
Dylan K. Taylor
13031967f4 Merge commit '0029efa37'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Server.php
2020-06-14 19:36:50 +01:00
Dylan K. Taylor
c29ed34b54 Merge commit 'f4ee2912db89c6629d4fa191e993f0798035ef20'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Server.php
2020-06-04 14:13:23 +01:00
Dylan K. Taylor
c93038f574 Inject WorldProviderManager to WorldManager's constructor, no longer singleton 2020-05-24 19:22:04 +01:00
Dylan K. Taylor
41566e8077 Server: remove unused BOOTUP_RANDOM constant
this used to be used for /dumpmemory filenames, but those were confusing and stupid, and it's not used anymore since March 2018.
2020-05-24 18:33:04 +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
5eadb0ac44 ConsoleCommandSender: be honest about Server dependency 2020-05-23 12:31:22 +01:00
Dylan K. Taylor
5f2e65d608 QueryHandler: be honest about dependency on Server 2020-05-23 12:28:12 +01:00
Dylan K. Taylor
23ab6a283b Separate QueryInfo from QueryRegenerateEvent
this removes some useless and confusing APIs from query info.
2020-05-23 11:55:29 +01:00
Dylan K. Taylor
c9af5ce7a9 Convert GeneratorManager to singleton 2020-05-23 10:13:03 +01:00
Dylan K. Taylor
640428c415 Convert WorldProviderManager to singleton 2020-05-23 10:02:09 +01:00
Dylan K. Taylor
8d9759288c WorldManager: don't hard-depend on server configuration for autosave settings 2020-05-23 09:43:59 +01:00
Dylan K. Taylor
fcea7da183 WorldManager: allow dataPath to be injected via constructor 2020-05-23 09:37:37 +01:00
Dylan K. Taylor
3795a13683 Merge commit '2eb62c85f69ebd22b36f29cfb513a579ea570b0c'
# Conflicts:
#	resources/vanilla
#	src/Server.php
2020-05-18 10:29:06 +01:00
Dylan K. Taylor
3238b4ff33 Remove PluginIdentifiableCommand in favour of a more generic PluginOwned interface 2020-05-11 19:25:52 +01:00
Dylan K. Taylor
b7cf4f01f9 remove utils\UUID, switch to pocketmine/uuid package 2020-05-11 10:46:48 +01:00
Dylan K. Taylor
1122f2a29f phpstorm can't infer these types :( 2020-04-29 13:26:49 +01:00
Dylan K. Taylor
8093a94e5d do not hardcode data deserialization into CraftingManager 2020-04-28 18:56:27 +01:00
Dylan K. Taylor
f9a587d40e imports cleanup 2020-04-28 17:27:38 +01:00
Dylan K. Taylor
3be9548b1e net: compressors are now fully dynamic (or at least the potential to be)
the compressor used by RakLibInterface when opening a session is still
hardcoded, but that's because we have no way to select the correct
compressor at that point in the login sequence, since we aren't
propagating the protocol information up from RakLib right now.
2020-04-28 16:21:18 +01:00
Dylan K. Taylor
d9e4783b24 start making network compressors dynamic
this will facilitate future multi version support where compression types are different between versions
2020-04-28 14:47:01 +01:00
Dylan K. Taylor
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
Dylan K. Taylor
f91e2f41e0 move SendUsageTask to stats namespace
maybe separate this out into a library?
2020-04-26 11:42:48 +01:00
Dylan K. Taylor
7d9df6af6f Convert EntityFactory to singleton 2020-04-24 22:43:02 +01:00
Dylan K. Taylor
08ac6a3c43 Convert CreativeInventory to singleton 2020-04-24 00:38:18 +01:00
Dylan K. Taylor
5a94af40e2 Convert ItemFactory to singleton 2020-04-24 00:18:31 +01:00
Dylan K. Taylor
13d784cd0c Convert BlockFactory to singleton 2020-04-23 23:45:13 +01:00
Dylan K. Taylor
7b3c2a3703 Merge commit '3907a2b6ba58fa49022e3e7c8256731dfa2e0d00' 2020-03-14 13:32:35 +00:00
Dylan K. Taylor
4c51f1dda3 Scrap TextContainer, make TranslationContainer immutable
TextContainer provided zero real value as a base of TranslationContainer, given that it required its own logic to be handled wherever accepted. As such, it's no better than a simple string.
Removing it also allows fixing an ambiguity when embedding translations inside other translations, allowing it to be made immutable.
2020-02-08 13:38:27 +00:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
e3833ba4f0 Merge branch 'stable' 2020-02-01 21:03:21 +00:00
Dylan K. Taylor
ff63f6d055 fill in more iterable types (master) 2020-02-01 20:19:57 +00:00
Dylan K. Taylor
cb16f5c142 Merge commit '260ac47588c76a2e6814cfba46773a990fb8c5da'
# Conflicts:
#	resources/vanilla
#	src/Server.php
#	src/lang/Language.php
#	src/network/mcpe/protocol/AddItemActorPacket.php
#	src/network/mcpe/protocol/AddPlayerPacket.php
#	src/network/mcpe/protocol/SetActorDataPacket.php
#	src/network/mcpe/serializer/NetworkBinaryStream.php
#	src/permission/Permission.php
#	src/pocketmine/block/Leaves.php
#	src/pocketmine/entity/DataPropertyManager.php
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/item/Banner.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/io/LevelProvider.php
#	src/pocketmine/level/format/io/LevelProviderManager.php
#	src/pocketmine/network/mcpe/protocol/AddActorPacket.php
#	src/pocketmine/network/mcpe/protocol/LoginPacket.php
#	src/pocketmine/tile/Banner.php
#	src/scheduler/BulkCurlTask.php
#	src/updater/AutoUpdater.php
#	src/utils/Config.php
#	src/utils/Utils.php
#	src/world/generator/Flat.php
#	src/world/generator/Generator.php
2020-01-31 21:07:34 +00:00
Dylan K. Taylor
ee4757303b Merge commit '9eebfa7cc30c8a5ac39f192c79023131623ad4b4'
# Conflicts:
#	resources/vanilla
#	src/Server.php
#	src/pocketmine/Achievement.php
2020-01-31 20:07:21 +00:00
Dylan K. Taylor
055b13a6cf strip extra blank lines (php-cs-fixer) 2020-01-22 15:14:10 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
3ee6887792 populate remaining missing return types, using native returns where possible
this is done separately to stable so that stable changes can be integrated easily using an empty merge.
2020-01-19 10:26:35 +00:00
Dylan K. Taylor
0f718ea28b Merge commit '8726604899d1a371567141e0831ed570d3233356' 2019-12-25 14:19:35 +00:00
Dylan K. Taylor
771ccbb727 Server: require a DynamicClassLoader instance 2019-12-12 20:13:51 +00:00
Dylan K. Taylor
4651bcf8c3 master: imports cleanup
it was easier to make an empty merge and re-run php-cs-fixer afterwards.
2019-12-11 23:23:03 +00:00
Dylan K. Taylor
3fa628f259 updated NBT dependency 2019-12-09 11:26:43 +00:00