9681 Commits

Author SHA1 Message Date
Dylan K. Taylor
d554d8060b fixed absorption hearts not being consumed, closes #3546
this was caused by a bad fix for switching. we can't consider zero-damage attacks as cancelled because zero-damage might have been the result of things like consuming absorption hearts, so the aftereffects need to be processed even when the net damage is zero.
2020-06-02 10:09:18 +01:00
dependabot-preview[bot]
b48243fd09
Bump phpstan/phpstan-phpunit from 0.12.10 to 0.12.11 (#3547) 2020-06-01 18:05:51 +00:00
Dylan K. Taylor
5c63e06b0f piece together a changelog for release 2020-06-01 14:57:27 +01:00
Dylan K. Taylor
3be83e09f2 Revert BC-breaking backport from b38c81c96
this can't be applied to a minor version because it places additional requirements on the Inventory contract.
2020-06-01 13:51:36 +01:00
Dylan K. Taylor
f24be2b055 Merge branch 'stable' into next-minor
# Conflicts:
#	src/pocketmine/Player.php
#	src/pocketmine/block/SnowLayer.php
2020-06-01 13:42:59 +01:00
Dylan K. Taylor
92cffc00d0 3.12.4 is next 2020-06-01 13:18:28 +01:00
Dylan K. Taylor
e87e974323 Release 3.12.3 3.12.3 2020-06-01 13:18:28 +01:00
Dylan K. Taylor
a3f6338626 Player: fixed internal server error when using insert-before on a client-sided book page 2020-06-01 12:59:18 +01:00
Dylan K. Taylor
21aef97ba7 Player: fixed swapping book pages that only exist client-side, closes #3322 2020-06-01 12:50:39 +01:00
Dylan K. Taylor
ed0d1978aa WritableBook: fixed thrown exception when asking for a page that doesn't exist (it's allowed to return null for a reason ...) 2020-06-01 12:46:41 +01:00
Dylan K. Taylor
d64561b0b1 Fixed internal server error when deleting book pages that only exist client side 2020-06-01 12:39:17 +01:00
Dylan K. Taylor
d234d3e45e ParticleCommand: added mobflame, closes #3102 2020-05-31 20:28:57 +01:00
Dylan K. Taylor
5056754cea NetworkBinaryStream: do not round vectors directly on reading
fixes #3199
2020-05-31 20:17:42 +01:00
Dylan K. Taylor
2dc3cf8162 InventoryTransaction: sync inventories before throwing validation exception to caller
fixes #3226

really the transaction shouldn't be handling inventory sync at all, but that's a job for another commit.
2020-05-31 20:10:29 +01:00
Dylan K. Taylor
8c5a81cf5c Living: improved projectile knockback
this isn't pretty, but it works. I have a nicer idea how to do this on PM4, but it's going to involve BC breaks (as usual).
closes #3382
2020-05-31 20:04:12 +01:00
Dylan K. Taylor
2b58f2bafd FallingBlock: remove superfluous transparent check, closes #3339 2020-05-31 19:54:47 +01:00
Dylan K. Taylor
5dadf12374 Living: fixed cooldown damage logic, closes #2939 2020-05-31 19:46:51 +01:00
Dylan K. Taylor
0d4e473bdd Reduce ResourcePackChunkData chunk size to 128 KB
while this is slightly less bandwidth efficient (1 in 92 datagrams not full vs 1 in 733), this is significantly less memory-hard.
I made this decision looking at the memory pressures that 1MB chunks exert - especially on RakNet. Client-side, these resource pack chunks all hang around in RakNet memory until the whole thing is received, and it's a lot more costly to receive 733 datagrams than it is to receive 92, especially since it's much more likely that some of the 733 will disappear along the way.
If, for example, the first couple of hundred KB split parts arrived out of 1MB, and then one of the parts got lost, all the already-received parts would hang around in memory not getting processed. With smaller chunks this is much less of a problem.
I explored taking the chunk size all the way down to 1KB to reduce the bandwidth waste caused by split packets (split headers), but this made resource pack downloading unbearably slow, so it wasn't acceptable.
2020-05-31 19:29:26 +01:00
Dylan K. Taylor
11cedc4011 Player: added a constant for resource pack chunk sending size 2020-05-31 19:23:21 +01:00
Dylan K. Taylor
3f2455f090 SnowLayer: fixed layer stacking, closes #2775 2020-05-31 17:38:24 +01:00
Dylan K. Taylor
9d26a224a2 DoublePlant: add flammability info, closes #2465 2020-05-31 17:04:50 +01:00
Dylan K. Taylor
c4ad390463 pocketmine.yml: raise default population-queue-size to 32
the old limit was made in the php5 days when performance was far worse and it was much more costly to generate chunks that weren't needed. Now it's significantly less and having a higher limit allows terrain to be sent more quickly in new worlds and to fast-moving players.
This limit really ought to go away completely but considering the technical barriers in the way it'll have to stay for now.
2020-05-31 16:58:53 +01:00
Dylan K. Taylor
42e14f749e Do not blanket-ban all inventory transactions in spectator mode, fixes #2627
instead, we cancel the appropriate events before they are called, so that plugins can uncancel them if they choose.
2020-05-31 16:32:06 +01:00
Dylan K. Taylor
484557935e Level: remove dead block placement code (player movements are now always processed immediately, just not immediately broadcasted) 2020-05-31 16:06:48 +01:00
Dylan T
485f573955
Player: remove move buffering, implement simple rate limited movement… (#3167)
Introduction
This PR is a second attempt at improving movement processing to fix #1215 , #2730 and more.

This is significantly less complex than the previous attempt #2646 -- it gets rid of the movement buffering system entirely and instead relies on a simple rate limit counter to restrict on-the-fly movement processing.

Movement is rate limited to a max average of 2 per tick. It allows up to 5 seconds' backlog to accommodate network lag. The rate limit counter is increased by 2 per tick and decreased once for every movement processed. This prevents movement processing being abused for denial of service attacks.

Changes
API changes
This PR, while obviously highly beneficial for most current users, poses some BC-breaking issues because of changes to the internal Player API.

Player->processMovement() (protected) has been removed. This is a BC concern for custom player classes which overrode it and called it as a parent. In addition, child implementations won't be called every tick any more, which could break some custom movement processing systems.
Player->newPosition (protected) has been removed. This internal field may have been accessed by custom movement implementations.
Player->isTeleporting (protected) has been removed. BC concern is same as previous point.
Player->getNextPosition() (public) has been @deprecated.
Added the following protected Player class members:
int $moveRateLimit
?Vector3 $forceMoveSync
handleMovement()
processMostRecentMovements()
revertMovement()
Behavioural changes
Player movement is now subject to less rubberbanding and has more reliable behaviour.
2020-05-31 15:51:30 +01:00
Dylan K. Taylor
71e0521286 Merge branch 'stable' into next-minor
# Conflicts:
#	composer.lock
2020-05-31 14:43:53 +01:00
Dylan K. Taylor
3f07f06874 updated composer lockfile 2020-05-31 14:42:31 +01:00
Dylan K. Taylor
10279e11ed updated build/php submodule to pmmp/php-build-scripts@d475b694e4 2020-05-31 14:33:26 +01:00
Dylan K. Taylor
673e444456 phpstan: fix build failure 2020-05-31 13:02:32 +01:00
Dylan K. Taylor
89c49d77c6 ditch irstea/phpunit-shim, more trouble than it's worth 2020-05-31 12:03:38 +01:00
Govdim
c3a795e876
Fix walk sounds (#3492)
Co-authored-by: Govdim <govdim.govorek@gmail.com>
2020-05-24 14:03:14 +01:00
Muqsit Rayyan
4199c3796f
Water: Remove duplicate call to Entity->resetFallDistance() (#3524)
It's not clear what the intended goal of this code was, but the duplicate call is obviously useless.
2020-05-24 14:00:19 +01:00
Dylan K. Taylor
ecbf21acea Utils: added OS constants, remove hardcoded OS strings everywhere 2020-05-23 11:05:58 +01:00
XenialDan
45c89d084c TimeCommand: add time aliases "noon", "sunset", "midnight", "sunrise"
closes #3508
2020-05-20 20:42:21 +01:00
Dylan K. Taylor
56f90a2901 Merge branch 'stable' into next-minor 2020-05-20 20:05:00 +01:00
Dylan K. Taylor
bf6af269c8 StartGamePacket: use PUBLIC visibility by default 2020-05-20 20:04:39 +01:00
Dylan K. Taylor
73d1f84072 Merge branch 'stable' into next-minor 2020-05-20 19:36:20 +01:00
Dylan K. Taylor
a29424f5b3 UIProfile: name constants as they appear in the MC user-facing settings
I think these names are stupid, but it'll be easier for people to figure out what they refer to if they match the client-sided naming.
2020-05-20 15:06:50 +01:00
Dylan K. Taylor
ff3af492f8 Random: remove multiline formatting in nextSignedInt()
I'm sick to death of formatting tools messing with this...
2020-05-20 14:34:29 +01:00
Dylan K. Taylor
80b804f7aa automated imports cleanup 2020-05-20 14:31:31 +01:00
Dylan K. Taylor
3a78735982 added UIProfile protocol constants
these are only used in the LoginPacket, but plugin devs will probably find them useful anyway
2020-05-20 14:27:50 +01:00
Dylan K. Taylor
ab32784c74 UpdateBlockSyncedPacket: remove default values for fields 2020-05-20 13:58:36 +01:00
Dylan K. Taylor
816234a379 UpdateBlockSyncedPacket: populate missing information for second field 2020-05-20 13:57:08 +01:00
Dylan K. Taylor
b7bf92a5e9 SimpleEventPacket: added missing type constant 2020-05-20 13:50:43 +01:00
Dylan K. Taylor
dcca000ead PlayerActionPacket: added missing constant 2020-05-20 13:44:52 +01:00
Dylan K. Taylor
c4ea51f985 NpcRequestPacket: added request type constants 2020-05-20 13:42:40 +01:00
Dylan K. Taylor
8202bb1cd8 MoveActorAbsolutePacket: added missing flag 2020-05-20 13:39:56 +01:00
Dylan K. Taylor
b75758e35e MoveActorDeltaPacket: added missing flags 2020-05-20 13:39:37 +01:00
Dylan K. Taylor
38a06f76f8 LoginPacket: remove unused constant 2020-05-20 13:15:43 +01:00
Dylan K. Taylor
84f99ed418 CommandOriginData: Rename previously unknown field 2020-05-20 13:00:03 +01:00