Commit Graph

464 Commits

Author SHA1 Message Date
8d1a1628de Item: Remove "ench" tag when all enchantments are removed from an item (#4184)
fixes #4144
2021-04-18 20:56:07 +01:00
dd2c3db285 Fixed a bucket of lava disappearing when used in a furnace (#3973)
fixes #2385
2020-12-17 23:57:34 +00:00
1c43538238 Fix that a hoe gets damage applied to it, when it's used to break a block (#3967)
closes #3965
2020-12-11 21:14:52 +00:00
09eb904f6b fixed explicit-mixed errors exposed by upgrading pocketmine/nbt 2020-08-28 15:47:41 +01:00
e990c5a0a5 Protocol changes for 1.16.0 2020-06-26 14:06:41 +01:00
df13e967fd imports cleanup 2020-06-14 10:27:15 +01:00
097c260dbb Eradicate all usages of strtoupper()
strtoupper() is an evil function whose behaviour depends on the system locale. mb_strtoupper() has more consistent behaviour.
2020-06-13 19:47:00 +01:00
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
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
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
da4a2d8552 Fixed a bunch of missed Position->getLevel() usages
these were not in the usage search because PhpStorm decided to refer to ChunkLoader->getLevel() for any Player references, which caused them to only show when that was searched.

There's also an undetected LSP violation with ChunkLoader because it requires returning Level and Position->getLevel() returns Level|null. I don't know why PHPStan doesn't complain about that.
2020-05-19 21:01:18 +01:00
dc9351b024 Merge remote-tracking branch 'origin/stable' into next-minor 2020-05-19 11:26:25 +01:00
a67d2ae978 parity: burning players no longer shoot burning arrows (#3509)
this behaviour doesn't exist in vanilla.
2020-05-19 10:31:39 +01:00
1579f41056 Added missing Enchantment IDs (#3419) 2020-04-19 15:42:27 +01:00
a2543ff80d Position: add getLevelNonNull()
this allows assuming that a position has a valid world in places where it's never expected to not be valid. Since this is the vast majority of usages, it eliminates a lot of possible null-pointer warnings given by static analysers.
TODO: Consider whether we can make Position->getLevel/World use this behaviour out of the box in the next major version.
2020-04-14 11:08:37 +01:00
f8ce01e2fd ItemFactory: extract fromStringSingle() from fromString()
on PM4, the multiple functionality is removed, but on PM3 this is a problem for phpstan.
2020-03-13 17:54:25 +00:00
7aa8bd18d3 Revert "Item: restrict bounds of count to 0-255"
This reverts commit 10317527e4.

this breaks user code which exceeds stack limits in legitimate
circumstances. For example, it should be OK to add 6000x diamond to a
player's inventory without being forced to manually split the count up
for addItem().
2020-02-25 20:42:03 +00:00
2d7f37ac47 avoid direct mutation of Item->count field, use Item->pop() instead
I think this change was already applied on the master branch, but I don't remember for sure.
2020-02-23 17:37:25 +00:00
50fcdd6e7e Item: fixed documentation of pop() return type (it's not fluent) 2020-02-23 17:32:50 +00:00
10317527e4 Item: restrict bounds of count to 0-255 2020-02-23 17:23:53 +00:00
2f1fad2745 Bucket: implement MaybeConsumable, fixes #3306
this is a nauseating fix, but it's only needed for stable.
2020-02-21 17:49:55 +00:00
1257378198 clean up function imports 2020-02-08 09:31:15 +00:00
758a68aa2c ItemFactory: add Item[] as type for list field (for auto complete) 2020-02-07 20:11:31 +00:00
9b02b8e51e Item: do not compare serialized NBT in equals()
this isn't cached anymore, and would be a performance drag.
It would be nice to have some kind of fast path for this, but comparing NBT binary isn't it.
2020-02-06 20:23:58 +00:00
0ec869932f Item: clean up internal NBT storage, discard useless legacy network cache
this will now bail if the NBT string given is invalid upon setCompoundTag(), rather than shitting the bed when it's accessed.
2020-02-06 17:59:05 +00:00
4518d9d9ce Item: drop useless @var confusing PHPStan 2020-02-05 20:55:58 +00:00
1a5228e7a6 Fixed property types with missing null PhpDoc types 2020-02-05 20:55:03 +00:00
495bfda044 Drop a bunch of invalid null defaults
phpstan doesn't report these out of the box, for reasons I'm not clear on. It's also not clear if having null defaults has any effect on nullability behaviour, so they are best removed. In addition, these would be problematic on 7.4.
2020-02-05 20:53:54 +00:00
3f7e7352fb added SplFixedArray generics for phpstan 0.12.9 2020-02-05 11:57:37 +00:00
260ac47588 add some phpstan array types 2020-01-30 22:23:11 +00:00
5d8bb84269 add more mixed[] to item namespace 2020-01-30 21:48:11 +00:00
3b9a5c5ccc populate missing array value types in item namespace 2020-01-30 20:54:38 +00:00
24ed823d96 WritableBook: remove extra line from phpdoc on setPages() 2020-01-22 14:51:14 +00:00
f624871b3f strip extra blank lines (php-cs-fixer) 2020-01-22 14:50:29 +00:00
c4793241f5 Mass removal of useless @param/@return PHPDoc annotations, pass 1 2020-01-21 15:10:18 +00:00
e6ba3ce8a6 item: populate missing return type information 2020-01-19 17:13:33 +00:00
e544bc0d4b Item: added missing return type info for clearCustomBlockData() 2020-01-18 20:11:47 +00:00
fd27227cc7 Item: fix @return annotations for fluent methods (needed for correct auto complete) 2020-01-18 20:10:46 +00:00
494660102e Replace empty() usages with count() 2019-12-18 11:23:24 +00:00
2cb6990698 Enchantment: don't throw exceptions on out of range IDs
this function is used for data deserialization, and data may have bad enchantment IDs in it.
2019-12-14 10:04:51 +00:00
8ecf5e02b9 bad fix for WritableBook phpstan warning
master has this shit so much better
2019-12-04 22:00:19 +00:00
8a7017fd6b Enchantment: fixed doc comment for static enchantments field 2019-12-01 20:16:45 +00:00
bb05cfb36c Shears: fixed always-false hardness check
thanks PHPStan
2019-10-21 15:21:22 +01:00
ee60a7bc36 Item: add documentation for addCreativeItem(), removeCreativeItem() and clearCreativeItems()
[ci skip]
2019-10-07 09:37:59 +01:00
e93d034a4e fix bucket empty sound position, close #3051 2019-07-22 17:17:15 +01:00
b788982d60 Item: fixed setCustomName() not removing display NBT tag with empty name (#3049) 2019-07-19 20:07:53 +01:00
eb161f8e1c Use base64 instead of hex to display binary in some places
base64 takes less space than hex, which is beneficial for logging larger payloads.
2019-06-06 14:43:20 +01:00
cce99b07af 1.10.0 updates 2019-03-20 19:17:41 +00:00
30b49e0d22 Merge branch '3.5' into 3.6 2019-02-08 15:32:20 +00:00
769cc91543 ItemFactory: fix crash when getting negative item IDs
these are now treated the same as any unknown item, and are now not possible to place.
2019-02-08 13:51:41 +00:00