466 Commits

Author SHA1 Message Date
Dylan K. Taylor
1ba32c98c7 protocol: avoid potential constructor refactoring packet decode bug
if the order of the constructor parameters were changed, it would cause these statements to be reordered, causing packet fields to be decoded in the wrong order.
2020-07-17 23:19:33 +01:00
Dylan K. Taylor
d9c3ec5f91 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
2020-07-11 20:14:42 +01:00
Dylan K. Taylor
279abb871d Remove all usages of CompoundTag->hasTag()
in pretty much every case, these usages really wanted to read the tag's contents anyway, which can be combined with a getTag() and instanceof call for more concise and static analysis friendly code.
In the few cases where the tag contents wasn't needed, it still wanted to check the type, which, again, can be done in a more static analysis friendly way by just using getTag() and instanceof.
2020-07-10 21:01:43 +01:00
Dylan K. Taylor
600ef033ab PlayerSkinPacket: added ::create() 2020-07-09 13:24:31 +01:00
Dylan K. Taylor
b22cc4875e Player: Accept NBT data in constructor, instead of asking for it from the server directly
this allows custom implementations to provide custom data to the constructor (or none at all).
2020-07-09 13:09:46 +01:00
Dylan K. Taylor
ad99dc5884 ChunkSerializer micro optimisation: reduce indirections when writing runtime IDs 2020-07-05 22:00:42 +01:00
Dylan K. Taylor
ae179e5039 fix interacting with anvil & enchanting table inventories 2020-07-04 23:46:26 +01:00
Dylan K. Taylor
d840e8c4d4 Merge commit 'a34f3261c'
# Conflicts:
#	resources/vanilla
#	src/event/entity/EntityExplodeEvent.php
#	src/pocketmine/event/block/SignChangeEvent.php
#	src/utils/Utils.php
2020-07-04 22:39:40 +01:00
Dylan K. Taylor
c35a596079 Merge commit '8ce0022de'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/types/inventory/NetworkInventoryAction.php
2020-07-04 22:34:01 +01:00
Dylan K. Taylor
172830fc44 Merge commit '8cf025a2d'
# Conflicts:
#	resources/vanilla
2020-07-04 22:20:42 +01:00
Dylan K. Taylor
e9eadd3a26 Merge commit '8480ee82e'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
#	src/pocketmine/block/CraftingTable.php
2020-07-04 22:19:43 +01:00
Dylan K. Taylor
cf5e31c619 InventoryTransaction::execute() now throws exceptions instead of returning true/false 2020-07-01 14:08:28 +01:00
Dylan K. Taylor
30591d047c PacketBatch: added a getPackets() method which encapsulates some logic 2020-07-01 13:38:06 +01:00
Dylan K. Taylor
29612cded3 CraftingTransaction: make CraftingManager injectable
this becomes a bit easier to unit-test.
2020-07-01 13:38:06 +01:00
Dylan K. Taylor
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
Dylan K. Taylor
01d221b794 imports cleanup 2020-06-28 17:50:49 +01:00
Dylan K. Taylor
27511ac3ec updated network item ID constants 2020-06-28 17:37:51 +01:00
Dylan K. Taylor
74b0c411c4 regenerated network entity ID constants 2020-06-28 17:37:25 +01:00
Dylan K. Taylor
0d13a3fbdb NetworkSession: do not respond to death before player spawn, fixes #3513
there's a few changes that can be made to avoid this problem, the
primary one being to separate this API from NetworkSession and abstract
it away... but this is a reasonable, although not great, solution.
2020-06-28 17:35:12 +01:00
alvin0319
45b4e3cd7a
EmoteListPacket can be ServerboundPacket (#3635) 2020-06-27 10:04:23 +01:00
Dylan K. Taylor
9f323bc480 phpstorm, stop messing with my code pls 2020-06-26 22:25:09 +01:00
Dylan K. Taylor
0caf99445b Merge commit '4fed08bcd4655d7eec8d2cdf88950789f99ed2ee'
# Conflicts:
#	resources/vanilla
2020-06-26 22:21:49 +01:00
Dylan K. Taylor
7e6adc41f0 Merge 1.16 support into PM4 (with changes) 2020-06-26 22:21:09 +01:00
Dylan K. Taylor
18f04d6d96 Merge commit '3ecae0db1964562a8a13346df3593744d2288b81'
# Conflicts:
#	resources/vanilla
2020-06-26 19:19:20 +01:00
Dylan K. Taylor
9887a8b778 Merge commit 'c5bbb2bcbc4ecc8bcfd9bfaefd27c1b51e482d77'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
#	src/pocketmine/network/mcpe/protocol/InventoryTransactionPacket.php
2020-06-26 19:18:58 +01:00
Dylan K. Taylor
05bd92a94b Merge commit '60b26a7ea8939a85db9af0a99dd5a4b13e1a562d'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
2020-06-26 19:16:53 +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
d38c17835d Properly switch to string entity IDs 2020-06-20 13:43:31 +01:00
Dylan K. Taylor
a988578ee0 protocol: move PotionType and PotionContainerChange recipes to types/recipe namespace 2020-06-20 11:43:47 +01:00
Dylan K. Taylor
d5db163208 protocol: added proper object wrappers for gamerules 2020-06-20 11:24:39 +01:00
Dylan K. Taylor
954e8e6e6f update pocketmine/math dependency 2020-06-19 11:33:10 +01:00
Dylan K. Taylor
64e9647334 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/convert/LegacySkinAdapter.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/phpstan-bugs.neon
2020-06-19 10:48:27 +01:00
Dylan K. Taylor
b3df5f4e95 CS: strip unneeded phpdoc 2020-06-18 20:01:49 +01:00
Dylan K. Taylor
11eb1f1c5e imports cleanup 2020-06-18 20:01:19 +01:00
Dylan K. Taylor
755e53cd71 JwtUtils: added a split() function to reduce code duplication 2020-06-18 12:05:54 +01:00
Dylan K. Taylor
222399d178 EncryptionContext: fix exception message 2020-06-18 11:52:05 +01:00
Dylan K. Taylor
95114dcc1e EncryptionContext: fixed a phpstan level 7 error (openssl_digest() might return false for god knows what reason) 2020-06-18 11:50:43 +01:00
Dylan K. Taylor
edc3156bea Rename NetworkCipher -> EncryptionContext 2020-06-18 11:37:53 +01:00
Dylan K. Taylor
82b3e3398b make more use of igbinary_serialize() and igbinary_unserialize() 2020-06-17 23:03:03 +01:00
Dylan K. Taylor
6f4d4be3da InGamePacketHandler: handle InvalidSkinException thrown by SkinAdapter::fromSkinData() 2020-06-17 22:31:44 +01:00
Dylan K. Taylor
05615b3eb7 ClientDataToSkinDataHelper: move safeB64Decode to its own function 2020-06-17 22:27:13 +01:00
Dylan K. Taylor
e6a3f7baa2 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
2020-06-17 22:23:17 +01:00
Dylan K. Taylor
a686840e5e RuntimeBlockMapping: fixed palette cache never being initialized
I must have been very tired when I wrote this code
2020-06-17 21:33:56 +01:00
Dylan K. Taylor
333ed8ed2f RuntimeBlockMapping: remove unnecessary nullable flag 2020-06-17 21:32:51 +01:00
Dylan K. Taylor
715fca8986 LoginPacketHandler: use playerInfo directly again, fix another 2 PHPStan level 8 errors 2020-06-17 21:30:34 +01:00
Dylan K. Taylor
eefb6ae8e7 LoginPacketHandler: use reference to new PlayerInfo directly, fixes a PHPStan level 8 error 2020-06-17 21:29:16 +01:00
Dylan K. Taylor
503782d67c moved skin-parsing code from LoginPacketHandler to its own dedicated helper class 2020-06-17 21:24:12 +01:00
Dylan K. Taylor
55e6b2dfbc Merge commit '1c13ba565660e0985c08f2c6b59e26f8216f87e4'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
2020-06-17 21:14:04 +01:00
Dylan K. Taylor
5c94c6992d Merge commit 'f970be0e4ddf90e64c2e87cc6b2123aa933b3ab1'
# Conflicts:
#	resources/vanilla
2020-06-17 21:12:46 +01:00
Dylan K. Taylor
6a8bb89734 Merge commit '11a3f9f1b906d0a73adb5a81a6eff120b56cf6fa'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/network/mcpe/VerifyLoginTask.php
2020-06-17 21:12:27 +01:00