Commit Graph

11482 Commits

Author SHA1 Message Date
Dylan K. Taylor
317a48d9b0 ItemStackRequest: expose filterStrings 2021-02-03 23:40:34 +00:00
Dylan K. Taylor
bc14660e55 Added missing ItemStackRequest protocol changes 2021-02-03 23:37:41 +00:00
Dylan K. Taylor
561fc62232 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	.github/workflows/main.yml
#	resources/vanilla
#	src/pocketmine/VersionInfo.php
#	src/world/format/io/region/RegionLoader.php
2021-02-03 17:32:47 +00:00
Dylan K. Taylor
079e794339 Armor: fixed item disappearing when switching two of the same armour pieces
Player->useHeldItem() assumes that if the old item == the new item, we want to set the item back into the inventory if it's modified in-place. Therefore, we don't modify the item in-place to bypass the problem.

closes #4022
2021-02-03 17:05:16 +00:00
Dylan K. Taylor
4771e3dc28 3.17.5 is next 2021-02-02 14:04:51 +00:00
Dylan K. Taylor
2e9117d102 Release 3.17.4 2021-02-02 14:04:50 +00:00
Dylan K. Taylor
06493da7d9 Imports cleanup 2021-02-02 13:58:07 +00:00
Dylan K. Taylor
3e1ac66abf Merge branch 'stable' 2021-02-02 13:46:29 +00:00
Dylan K. Taylor
bd303b1062 RegionLoader: fixed flaky region header validation since 3.17.3 2021-02-02 13:43:52 +00:00
Dylan K. Taylor
1a24afc6d1 InventoryTransaction: Fixed indexes persisting from balance calculation in crafting input/outputs
fixes #4019
the order of the actual items may not be the same across runs, but index 0 will at least be sure to exist.
2021-02-02 00:13:58 +00:00
yuko fuyutsuki
37e8dd6444 Fix PHP 8 optional before required parameters deprecation warnings (#4016) 2021-01-31 12:08:47 +00:00
Dylan K. Taylor
02a4f0a170 Mark metadata as nullable in resource pack manifest data
if the metadata isn't provided, it won't be initialized during decoding.
2021-01-27 22:05:43 +00:00
Dylan K. Taylor
5a1131d72d Populator: require dependencies explicitly, don't make bad assumptions about fields
this also leaks ChunkManagers on the worker threads because the generator context is long-lived.
2021-01-27 21:08:46 +00:00
Dylan K. Taylor
bbae02264d Merge branch 'stable' 2021-01-27 20:04:13 +00:00
Dylan K. Taylor
16fa958416 phpstan: better hack for any-callable parameters
variadics are a bad fit for this because what we really need is to accept callable with any number of arguments. LSP requires that the provided number of arguments must be >= than the required number of arguments.
2021-01-27 19:25:28 +00:00
Dylan K. Taylor
bac57c159f Player: fix bridging, towering and various other fast building bugs
clickPos is relative to the base block position, so if you keep aiming at the same spot on the block and jump, it thinks you're still spamming.
closes #2730
2021-01-27 00:11:14 +00:00
Dylan K. Taylor
38b2d83799 MemoryManager: fixed protected properties being dumped multiple times
we don't need to scan the parent classes for anything other than private properties, because protected and public properties will appear on the main reflection as if they were declared directly as such.
2021-01-26 20:32:23 +00:00
Dylan K. Taylor
5384e2ba9d Revert "MemoryDump: fixed duplicated properties, reduce useless noise"
This reverts commit efd67a132e.
2021-01-26 20:26:35 +00:00
Dylan K. Taylor
269a389a97 BlockTransaction: added phpstan return type info for getBlocks() 2021-01-25 18:04:42 +00:00
Dylan K. Taylor
62deafda48 CommandReader: removed readline support
readline has been borked for a long time and it's not thread safe.
2021-01-25 17:53:25 +00:00
Dylan K. Taylor
31b6df4376 3.17.4 is next 2021-01-25 17:15:43 +00:00
Dylan K. Taylor
b296ae1b87 Release 3.17.3 2021-01-25 17:15:31 +00:00
Dylan K. Taylor
34c1d455a7 phpstan: enable checkMissingCallableSignature 2021-01-24 20:27:53 +00:00
Dylan K. Taylor
2064b411f2 fix build 2021-01-20 22:53:51 +00:00
Dylan K. Taylor
69a829db91 Merge remote-tracking branch 'origin/stable' 2021-01-20 22:16:44 +00:00
SalmonDE
3fb4b30742 InventoryPickupItemEvent: rename item to itemEntity (#4007) 2021-01-20 21:09:59 +00:00
Dylan K. Taylor
e8ffab1787 RegionLoader: avoid hitting the disk twice during chunk reads
this provides some performance improvement (although it's difficult to measure because of cache).
this does mean that we read some garbage data during chunk reads, but it's less costly than hitting the disk twice.
2021-01-20 21:05:44 +00:00
Dylan K. Taylor
ecc1e1f698 RegionLoader: improve performance of region header validation
I was unaware that fseek actually makes a syscall which is rather costly, which became painfully obvious during large world conversions on PM4.
On average this problem appeared to be adding about 5ms to the load time for a newly loaded region, which is insanely expensive.
2021-01-20 20:04:21 +00:00
Dylan K. Taylor
487b5dd11d Merge branch 'stable' 2021-01-16 19:44:15 +00:00
Dylan K. Taylor
988cf7f535 Fixed PHP 8.0 deprecation error 2021-01-16 19:31:07 +00:00
Dylan K. Taylor
69fff23f1a LevelProviderManager: removed bogus @var
I'm not sure why this wasn't detected until 0.12.67...
2021-01-15 16:53:49 +00:00
Dylan K. Taylor
a9f8afa077 Banner: remove Deque usages
originally I introduced this to make it easier to implement the various APIs addPattern removePattern etc, but those were later removed in favour of simple getPatterns() and setPatterns(), allowing plugin developers to use ext-ds APIs to manipulate patterns.
However, ds poses a number of headaches because of mutability combined with by-ref semantics, which make it a pain to use these on the APIs because we can't guarantee that they won't be modified.
As much as arrays suck, they have two significant advantages over ext-ds: 1) they have copy-on-write semantics, and 2) they support PHP 8.0 without any extra work from me.
2021-01-15 00:17:56 +00:00
Dylan K. Taylor
4c0d3d68af Bump PHP requirement to 7.4.0 2021-01-12 21:53:41 +00:00
Dylan K. Taylor
97c124edf9 thanks git, this just sneaked in without any questions ................ 2021-01-12 21:43:34 +00:00
Dylan K. Taylor
c70c0b55df Separate held item index change listener logic from PlayerInventory 2021-01-12 16:44:25 +00:00
Dylan K. Taylor
01c867b608 Human: make held item sync on inventory content change more consistent
before this change, setContents() wouldn't trigger a held item sync, nor would setItem(heldItemIndex, someItem).
2021-01-10 20:30:39 +00:00
Dylan K. Taylor
c4845ab6b1 Use Player->getNetworkSession() in places where it's assumed the player will be connected 2021-01-10 19:51:41 +00:00
Dylan K. Taylor
5e73417fa9 Player::getNetworkSession() now explicitly handles disconnected state by throwing an exception
instead of just allowing return of possibly-null networkSession
2021-01-10 19:50:13 +00:00
Dylan K. Taylor
972c911485 phpstan 0.12.65 2021-01-09 18:04:42 +00:00
Dylan K. Taylor
0d8858f948 composer.json: sort packages automatically 2021-01-09 17:38:22 +00:00
Dylan K. Taylor
3ef2a19527 Player: don't kick for attacking non-attackable entities
this is quite out-of-character for PM - it usually handles bad network requests by ignoring them, not by kicking the player off the server.
2021-01-08 20:58:15 +00:00
Dylan K. Taylor
053a7a1a61 Entity: split getSyncedNetworkData() into two functions
to avoid opaque boolean parameters
2021-01-08 13:59:52 +00:00
Dylan K. Taylor
e53b57732b Entity: replace separate height/width/eyeHeight fields with an EntitySizeInfo structure
this will make it easier to implement stuff like sleeping (properly), swimming and gliding without needing to duplicate all the fields.
2021-01-08 00:11:01 +00:00
Dylan K. Taylor
574b615b4c Player: fixed attack sounds being added at the wrong position 2021-01-08 00:04:05 +00:00
Dylan K. Taylor
a3597e195a Player: extract getSaveData() from save()
this allows plugins to request this data whenever they want it (e.g. to save offline any time they want, instead of being confined to the server autosave interval).
2021-01-07 23:37:47 +00:00
Dylan K. Taylor
eaaed79b93 Player: remove useless check from save()
this exception is only thrown if the player is closed, which is already unexpected in the first place and will actually crash if it's not kosher. This prevents doing stuff like saving players during onDispose(), which crashes the server if a player is disconnected due to flagForDespawn().
2021-01-07 23:33:10 +00:00
Dylan K. Taylor
7b806e74b8 Player: use own logger for movement debug 2021-01-07 22:06:55 +00:00
Mohamed
5392ddf0b9 Fixed TNT broadcasting ignition sound (#3996)
closes #3952
2021-01-07 21:18:18 +00:00
Dylan K. Taylor
82c8fa696a Relocate teleport ACK checks to InGamePacketHandler 2021-01-07 20:43:31 +00:00
Dylan K. Taylor
d76883a5f8 Merge branch 'stable' 2020-12-29 18:00:09 +00:00