8941 Commits

Author SHA1 Message Date
Dylan K. Taylor
ef034f2d68 PermissionAttachment: better document the apparently nonsensical code responsible for making sure the entire permission system doesn't burn down 2020-11-28 16:05:16 +00:00
Dylan K. Taylor
ab18332572 PermissionManager: fixed nonsensical PHPDoc type 2020-11-27 19:54:05 +00:00
Dylan K. Taylor
4102205ba6 Enhance type information in PlayerCreationEvent 2020-11-24 16:28:36 +00:00
Dylan K. Taylor
9e85ee4a7a Fixed missing field on Persona skin encode 2020-11-21 18:01:56 +00:00
Dylan K. Taylor
23849b7f63 3.16.1 is next 2020-11-21 01:25:06 +00:00
Dylan K. Taylor
d2f68836c6 Release 3.16.0 2020-11-21 01:25:06 +00:00
Dylan K. Taylor
d19db5d2e4 fix phpstan warnings 2020-11-21 01:16:04 +00:00
Dylan K. Taylor
98cdc80d37 Protocol changes for 1.16.100 2020-11-21 01:07:25 +00:00
Dylan K. Taylor
8273f789ee Backport SingletonTrait to PM3 2020-11-20 21:00:47 +00:00
Dylan K. Taylor
e30b1ee2c7 Clean up entity and tile saveID handling
we only ever need the first entry, so there's no point storing all of them. In addition, the field is private, which guarantees that nothing else needs the array either.
This also fixes phpstan/phpstan@c50650c5dd.
2020-11-12 21:49:12 +00:00
Dylan K. Taylor
574b7f6343 3.15.5 is next 2020-11-10 16:48:18 +00:00
Dylan K. Taylor
e8b6b56330 Release 3.15.4 2020-11-10 16:48:18 +00:00
Dylan K. Taylor
c368ebb5e7 InventoryTransaction: beware of conflicting slot change actions with the same origin/target
these types of chains would never normally occur, but they've been seen in the wild. Attempting to resolve such chains has exponentially increasing complexity.
2020-11-10 16:45:20 +00:00
Dylan K. Taylor
a421d32273 3.15.4 is next 2020-11-08 14:48:31 +00:00
Dylan K. Taylor
6c21c23444 Release 3.15.3 2020-11-08 14:48:31 +00:00
Dylan K. Taylor
55e0d9c520 Properly time chunk loading and chunk sending on timings reports, closes #3895 2020-11-08 14:30:12 +00:00
Dylan K. Taylor
37ee3f2775 Player: fixed orderChunks performance issue on newly-generated maps
every time a chunk passed through Level->generateChunkCallback(), it fired onChunkChanged() for chunk listeners, which in turn caused players to rerun chunk orders even though the target chunk had not been sent yet anyway.
2020-11-05 16:17:39 +00:00
Dylan K. Taylor
6cff08cd65 Chunk: fixed hasChanged being set on fastDeserialize() chunks (caused by 2bb497b7162719507184e0e3a36027cedd7bbe29)
this caused some performance issues and silent bugs with the generator, notably that the generator would always think all chunks had been changed, causing them to be re-set back into the world 9 times.
2020-11-01 15:50:21 +00:00
Dylan K. Taylor
fec42f16ba Level: properly define type of generator field 2020-11-01 14:36:05 +00:00
Nick
deb0cee8a0
BaseInventory::canAddItem(): consider item max stack size (#3881)
this fixes addItem() failing when canAddItem() reported that an item can be added.
2020-11-01 13:49:13 +00:00
Dylan K. Taylor
c0dafe7872 Explosion: remove dead code
this was needed for the old ExplodePacket, which was removed a few versions back.
2020-10-29 13:32:56 +00:00
Dylan K. Taylor
0b550b346b imports cleanup 2020-10-26 15:43:25 +00:00
Dylan T
69aa7c5ac1
Support for Composer v2 (#3880) 2020-10-24 16:42:38 +01:00
Dylan K. Taylor
11b74868ee CraftingTransaction: remove impossible condition
this is never hit thanks to the logic flow above - recipeItems is never empty.
2020-10-24 11:22:02 +01:00
Dylan K. Taylor
9a53de0903 Utils: explode() never returns an empty array 2020-10-24 11:19:37 +01:00
Dylan K. Taylor
0f8101d4a6 McRegion: Ignore files which don't have a valid file extension
previously a file with a 4-letter name ending in 'mca' in the region folder of a PMAnvil world would cause the world format to be unrecognized. This happens because strrpos() returns false when the substring isn't found, which gets coerced to 0 when used in addition.
2020-10-24 11:15:07 +01:00
Dylan K. Taylor
55ecac4c80 Fixed always-true condition in world loading
this has a couple of side effects which need to be explored.
- first of all, this bug prevented generateLevel() from filling in the preset from server.properties. With this fix, worlds which don't have any extra generator settings will start to be generated using server.properties settings, which is almost certainly not expected behaviour.
- preset can now be specified separately from generator in pocketmine.yml, which is nicer for users.
2020-10-24 11:10:35 +01:00
Dylan K. Taylor
2a1d1e90a2 php-cs-fixer nits 2020-10-21 16:44:57 +01:00
Dylan K. Taylor
a251960c1c AsyncPool: expose workerUsage to the API
this allows plugins (and maybe later on the core) to detect async worker overload and warn the user about potential performance issues.
I planned to implement such detection in the core directly, but it turned out to be a bit more complex than I anticipated. At the least, this API might be useful to someone else.
2020-10-16 21:20:49 +01:00
Dylan K. Taylor
52f734799e Human: do not modify totalXp unless setting XP succeeds 2020-10-16 20:43:03 +01:00
Dylan K. Taylor
42171f6e06 Human: beware negative values in addXp() 2020-10-16 20:42:13 +01:00
Dylan K. Taylor
1fe4fdc67c PluginDescription: fixed some very old refactoring errors 2020-10-15 13:55:40 +01:00
Dylan K. Taylor
3e2926441d PluginDescription: make sure that extensions constraints are actually strings 2020-10-13 17:21:10 +01:00
Dylan K. Taylor
0b33762be0 PluginDescription: fixed type of extensions (reported by phpstan 0.12.49) 2020-10-13 17:21:10 +01:00
Dylan T
e6f89213dc
Entity: properly account for upwards motion when calculating fall distance (#3867)
Previously, upwards movement wouldn't be considered, but downwards would, so if an entity bobbed up and down in the air for a while (e.g. while being comboed in PvP), the downwards distance would accumulate and deal a large amount of fall damage on touchdown.
This commit changes fall distance measurement to correctly account for upwards movement.

A better way of measuring fall distance would simply be to record the highest Y coordinate reached while in the air, and then measure the distance between that and the point of contact when landing. This would also remove the need to constantly update the fallDistance field. However, this would involve a BC break and will therefore have to wait until PM4.
2020-10-13 14:16:09 +01:00
jasonwynn10
7027a9b972
camelCase 2020-10-12 08:25:34 -04:00
Jason
b02f3f4090
Isolate and always show IP details on install 2020-10-11 18:57:30 -04:00
Dylan K. Taylor
873535f719 Timezone: explicitly check result of getURL()
phpstan-strict-rules should report this, but it doesn't ...
2020-10-09 17:23:22 +01:00
Dylan K. Taylor
78f4fcf6ab StatusCommand: removed "Maximum memory (system)"
it's not clear what this was actually supposed to represent, but it actually reports VmSize, which is already reported by "Total virtual memory". This line confuses users and is misleading.
2020-10-08 22:58:37 +01:00
Dylan K. Taylor
90b749c260 net: reduce default compression level to 6
On larger packets, this worsens compression ratio by 1-2%, but reduces CPU load due to compression by 15-20%. Higher levels than 6 are far more expensive for diminishing returns.
Level 5 produces a further 25-30% CPU reduction, but increases bandwidth usage by 20-25%, so 6 is the sweet spot.
2020-10-08 16:51:10 +01:00
Dylan K. Taylor
d5398b2781 3.15.3 is next 2020-10-06 13:33:42 +01:00
Dylan K. Taylor
d7a66ad755 Release 3.15.2 2020-10-06 13:33:42 +01:00
Dylan K. Taylor
b3f88e7b73 Updated language submodule to pmmp/Language@c85a7b79f3 2020-10-06 13:28:51 +01:00
Dylan K. Taylor
b169d89291 Added some documentation to FurnaceBurnEvent 2020-10-04 21:40:52 +01:00
Dylan K. Taylor
d084b7a34b RegionGarbageMap: add an extra overlap check
this shouldn't ever be triggered, but we want to know if it does.
2020-09-12 01:38:13 +01:00
Dylan K. Taylor
c2d0605b1e Entity: avoid implicit float truncation in getDirection()
this didn't cause any bugs because of the way the function is written, but it might have in other circumstances.
2020-09-11 21:01:22 +01:00
Dylan K. Taylor
0ff0b33047 StatusCommand: avoid modulo operator on float
this was detected by a custom PHPStan extension.
2020-09-11 20:56:18 +01:00
Dylan K. Taylor
114df07622 RegionLoader: specify type of unpack() return
PHPStan has no idea what is going on in this code because unpack() returns mixed[].
Possibly it might be a good idea to implement a dynamic return type extension for this.
2020-09-11 20:48:37 +01:00
Dylan K. Taylor
d3ea29d527 Release memory to OS on garbage collection
ZMM often holds onto big chunks of memory after they aren't used anymore, which is fine in a webserver, but it's not OK for PM.
2020-09-09 01:40:18 +01:00
Dylan K. Taylor
d2f1a3cf5b SubChunk: workaround opcache preloading constant issue
non-class constants aren't stored during preloading phase and for some reason they aren't pre-resolved in opcode arrays. However, they are resolved by value when referenced by class constants, and class constants stick, so we can use those instead.
2020-09-04 17:53:22 +01:00