13596 Commits

Author SHA1 Message Date
Dylan T
0eb4231b51
Use OpenSSL for ECDH during client login, drop mdanter/ecc (#4328)
This brings a significant performance improvement to login sequence handling, reducing CPU cost of `PrepareEncryptionTask` by over 90% and `ProcessLoginTask` by over 60%. It also allows us to shed a dependency.
2021-07-22 23:04:00 +01:00
Dylan K. Taylor
83016a97bd
Added getMushroomBlockType() / setMushroomBlockType() APIs to Red/BrownMushroomBlock 2021-07-22 19:13:26 +01:00
Dylan K. Taylor
41d9bf8a2e
PthreadsChannelWriter: remove unused import 2021-07-22 19:08:21 +01:00
Dylan K. Taylor
832a156fc7
RakLib: split PthreadsChannelWriter into two implementations
this gains a very small performance improvement by avoiding unnecessary !== null checks on every packet written in either direction. It's insignificant for sure, but I just found this code in an old stash, so what the heck.
2021-07-22 18:52:58 +01:00
Dylan K. Taylor
5c609cc1c1
Added getShape() and setShape() APIs to StraightOnlyRail and Rail 2021-07-22 18:37:30 +01:00
Dylan K. Taylor
e97234d420
Refactor Rail handling to allow LSP-complaint shape handling
the reason there hasn't been any API until now is because of how inconvenient it was to expose a LSP-compliant API _and_ use the same base class for handling all the connection logic. This commit fixes that problem by abstracting shape handling away from BaseRail entirely, so that now it deals exclusively with connections. Deciding the shape of rail to use is now the job of the subclasses.
2021-07-22 17:35:10 +01:00
Dylan K. Taylor
2476f40cc6
Rail: store shape instead of connections
shape is what we'll eventually expose on the API.
2021-07-22 16:45:42 +01:00
Dylan K. Taylor
77138c5c06
Living: changed bad parameter name 2021-07-22 15:46:08 +01:00
Dylan K. Taylor
e803ca0e06
Living: Limit vertical knockback to 0.4 by default
this will break non-standard use cases with large forces, but they only have to stick a 'null' at the end of the parameter list.
Since this function should be primarily used for vanilla knockback, it makes more sense to keep the default as vanilla, but allow people to change it if they want to.

closes #4106 (this is close to #4106 anyway, but small enough that it was easier to recreate it than pull and modify it)
closes #2707
2021-07-22 14:27:20 +01:00
Dylan K. Taylor
3466fbe3e3
MemoryManager: remove unused variable declaration
it's overwritten further down anyway.
2021-07-21 19:25:01 +01:00
Angel
309bed414f
Implemented sweet berries (#4164)
this doesn't implement the server-side logic for the "stickiness" (slowdown) because we don't have the system needed for it yet.
It also doesn't have parity with vanilla on the damage.
2021-07-19 20:01:33 +01:00
Dylan K. Taylor
f64ef50ce3
ShulkerBox: fixed incorrect block-picking behaviour 2021-07-19 18:08:13 +01:00
Dylan K. Taylor
dcbc0bc2a6
BrownMushroomBlock: remove useless function 2021-07-19 17:58:24 +01:00
Dylan K. Taylor
71df15b4cc
Removed FlowerPot update_bit hack 2021-07-19 17:39:35 +01:00
Dylan K. Taylor
5874ce582a
Implemented bells 2021-07-19 17:00:56 +01:00
Dylan K. Taylor
e0a9fb6eac
Merge remote-tracking branch 'origin/stable' 2021-07-19 00:16:04 +01:00
KygekDev
8fb4d7b982
BUILDING.md: Changed pre-requisites PHP version to 7.4 or newer (#4319)
[ci skip]
2021-07-18 00:08:14 +01:00
Dylan K. Taylor
c5abae9eaa
Fixed merge error in bbf3f4c476bb203f399b7631a7d69013980bbae8
the corresponding code on PM3 was originally removed here: 485f573955 (diff-cf181dff0292664e4aa13c8a1731dc62131489fa404f4ac1357493d320264cceL2263)
2021-07-17 22:59:45 +01:00
Dylan K. Taylor
13f114f30e
bootstrap: report loaded php.ini in error, as well as php binary path
in some cases extension loading issues are caused by incorrect php.ini path, which should be easy to spot if the path is given.
2021-07-17 21:50:30 +01:00
Dylan K. Taylor
eccd258aeb
start.cmd: fixed incorrect php.ini scan dir when using a non-local binary 2021-07-17 21:49:11 +01:00
Dylan K. Taylor
bd5f379c4c
apparently opcache_get_status() may return false? 2021-07-17 21:11:12 +01:00
Dylan K. Taylor
d35e818ea0
BlockLegacyMetadata: added constants for bell attachment types 2021-07-17 19:11:28 +01:00
Dylan K. Taylor
19e81b0cd3
BlockFactory: Be aware of potential size changes to metadata bits
during testing I found the need to use more bits (for example, bells have 32 states in 1.12).
2021-07-17 19:06:49 +01:00
Dylan K. Taylor
2588895ab0
bootstrap: add a giant yellow warning about JIT 2021-07-17 19:00:19 +01:00
Dylan K. Taylor
17d0767db5
ChunkSerializer: implement support for persistent network chunk format 2021-07-17 18:45:04 +01:00
Dylan K. Taylor
e5327a0f3e
ChunkSerializer: Extract serializeSubChunk() from main serialize() routine
this will be used in the future for cache-based chunk sends.
2021-07-17 18:29:14 +01:00
dependabot[bot]
432999a7d7
Bump phpstan/phpstan-phpunit from 0.12.20 to 0.12.21 (#4313)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 0.12.20 to 0.12.21.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/0.12.20...0.12.21)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-15 22:32:47 +01:00
Dylan K. Taylor
5fbc7681b0
Allow registering multiple ClassLoaders for a thread 2021-07-15 19:00:40 +01:00
Dylan K. Taylor
68699dbff9
PlayerAuthInputFlags: Fixed a mistake in the documentation 2021-07-14 21:08:23 +01:00
Dylan K. Taylor
ac8b13ee36
actions: don't preprocess anything except dependency src 2021-07-14 20:47:07 +01:00
Dylan K. Taylor
53d7ed2b5c
these tests are now done by pocketmine/bedrock-protocol 2021-07-14 20:39:32 +01:00
Dylan K. Taylor
a2e2196a90
Start using pocketmine/bedrock-protocol library 2021-07-14 20:32:15 +01:00
Dylan K. Taylor
b86d682793
Update to released version of pocketmine/math 2021-07-14 20:14:33 +01:00
Dylan K. Taylor
9f11be25cb
LevelSoundEventPacket: fixed bad null assignment in ::create() 2021-07-14 15:21:33 +01:00
Dylan K. Taylor
c474aa42e5
ClientDataToSkinDataHelper: Remove SingletonTrait
SingletonTrait is pointless here for multiple reasons:
1) the class is final
2) this is protocol-specific translation of types, no loss of data or alternative mutation of it needs to occur

Using SingletonTrait is an obstacle to separating the protocol library from the core code, so it has to go.
2021-07-14 14:50:59 +01:00
Dylan K. Taylor
1ad38d499c
Deglobalize ItemTypeDictionary usage, at least for the protocol
while this is a bit hacky outside of the protocol namespace, it makes it much easier to use the protocol library for alternative purposes, such as for a client or MITM proxy.
It also removes all but one remaining core dependency of the protocol library, making it very close to being able to be separated from the server core entirely.
2021-07-14 14:26:32 +01:00
Dylan K. Taylor
bfbe3d83de
3.22.1 is next 2021-07-13 18:31:34 +01:00
Dylan K. Taylor
c32c21464c
Release 3.22.0 3.22.0 2021-07-13 18:31:28 +01:00
Dylan K. Taylor
0c2917f2aa
Merge branch 'pm4-bedrock-1.17.10' 2021-07-13 18:20:00 +01:00
Dylan K. Taylor
28ede7273f
Fixed CS 2021-07-13 18:16:25 +01:00
Dylan K. Taylor
16faafa1ef
Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2021-07-13 18:11:03 +01:00
Dylan K. Taylor
a182b36b71
Merge branch 'pm4-bedrock-1.17.10' 2021-07-13 18:04:24 +01:00
Dylan K. Taylor
f77da60dd3
Merge branch 'pm3-bedrock-1.17.10' into pm4-bedrock-1.17.10 2021-07-13 18:02:29 +01:00
Dylan K. Taylor
4d6ac57a26
Fixed particle IDs 2021-07-13 17:54:40 +01:00
Dylan K. Taylor
676bacbee1
Improve the flexibility of WorldProvider registration
WorldProviders now have the following requirements removed:
- __construct() is no longer required to have a specific signature
- static isValid() no longer needs to be implemented (you will still need it for registering, but it can be declared anywhere now)
- static generate() no longer needs to be implemented

This paves the way for more interesting types of world providers that use something other than local disk to store chunks (e.g. a mysql database).

WorldProviderManager no longer accepts class-string<WorldProvider>. Instead, WorldProviderManagerEntry is required, with 2 or 3 callbacks:
- ReadOnlyWorldProviderManager must provide a callback for isValid, and a callback for fromPath
- WritableWorldProviderManagerEntry must provide the same, and also a generate() callback

In practice, this requires zero changes to the WorldProviders themselves, since a WorldProviderManagerEntry can be created like this:
`new WritableWorldProviderManagerEntry(\Closure::fromCallable([LevelDB::class, 'isValid']), fn(string ) => new LevelDB(), \Closure::fromCallable([LevelDB::class, 'generate']))`

This provides identical functionality to before for the provider itself; only registration is changed.
2021-07-13 16:55:21 +01:00
dependabot[bot]
73ba1ba224
Bump phpstan/phpstan from 0.12.91 to 0.12.92 (#4309)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.91 to 0.12.92.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.91...0.12.92)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 12:35:35 +01:00
Dylan K. Taylor
654fc9a2a6
LegacyStringToItemParser: Throw more specific exceptions 2021-07-10 21:03:12 +01:00
Dylan K. Taylor
9afc5be0f5
Shulker open/close sounds != shulker box open/close sounds 2021-07-10 19:59:59 +01:00
Aericio
fc090e238d
Add Shulker Boxes (#3678)
this implementation is working, although incomplete:

- The shulker close sound should not be played until the end of the shulker closing animation, which takes approximately 1 second.
- An open shulker box has a different collision box than a closed one - it should be +0.5 in whichever direction the shulker is facing. (During the animation, the bounding box also dynamically changes size - you can see this in vanilla by shooting an arrow into the top of an open shulkerbox facing UP, and then closing it - the arrow will fall and collide with the lid multiple times.

However, resolving both of these issues requires significant internal changes which are beyond the scope of this PR.
2021-07-10 19:48:38 +01:00
Dylan K. Taylor
b07000f613
Merge branch 'pm3-bedrock-1.17.10' into pm4-bedrock-1.17.10 2021-07-09 20:02:30 +01:00