12734 Commits

Author SHA1 Message Date
Dylan K. Taylor
2e1239f77a EnchantCommand no longer accepts numeric enchantment IDs 2020-10-24 17:33:17 +01:00
Dylan K. Taylor
1424114cf2 Clean phpstan baselines
some of these are dead, others are FPs fixed by newer PHPStan versions.
2020-10-24 17:22:49 +01:00
Dylan K. Taylor
a8980a0f67 phpstan 0.12.51 2020-10-24 17:10:31 +01:00
Dylan T
69aa7c5ac1
Support for Composer v2 (#3880) 2020-10-24 16:42:38 +01:00
Dylan K. Taylor
11b74868ee CraftingTransaction: remove impossible condition
this is never hit thanks to the logic flow above - recipeItems is never empty.
2020-10-24 11:22:02 +01:00
Dylan K. Taylor
9a53de0903 Utils: explode() never returns an empty array 2020-10-24 11:19:37 +01:00
Dylan K. Taylor
0f8101d4a6 McRegion: Ignore files which don't have a valid file extension
previously a file with a 4-letter name ending in 'mca' in the region folder of a PMAnvil world would cause the world format to be unrecognized. This happens because strrpos() returns false when the substring isn't found, which gets coerced to 0 when used in addition.
2020-10-24 11:15:07 +01:00
Dylan K. Taylor
55ecac4c80 Fixed always-true condition in world loading
this has a couple of side effects which need to be explored.
- first of all, this bug prevented generateLevel() from filling in the preset from server.properties. With this fix, worlds which don't have any extra generator settings will start to be generated using server.properties settings, which is almost certainly not expected behaviour.
- preset can now be specified separately from generator in pocketmine.yml, which is nicer for users.
2020-10-24 11:10:35 +01:00
Muqsit Rayyan
3b632a8deb
Handle InvalidArgumentException thrown by VanillaEnchantments::fromString (#3878) 2020-10-24 06:43:14 +01:00
Dylan K. Taylor
9947e13121 Yank constants out of Enchantment base class 2020-10-23 21:04:27 +01:00
Dylan K. Taylor
a01c086481 Introduced VanillaEnchantments registry 2020-10-23 20:48:19 +01:00
Dylan K. Taylor
e9038336e3 EventPriority: hardcode name -> value mapping instead of using constant()
this would have caught fire if additional non-priority constants were added, or if the constants were renamed.
2020-10-23 20:14:37 +01:00
Dylan K. Taylor
f5e033ad5d AsyncPool: fixed stable merge error 2020-10-23 13:25:52 +01:00
Dylan K. Taylor
23e5ade77e Merge branch 'stable' into master
# Conflicts:
#	build/make-release.php
#	composer.lock
#	resources/vanilla
#	src/plugin/PluginDescription.php
#	src/pocketmine/entity/Human.php
2020-10-21 16:55:52 +01:00
Dylan K. Taylor
2a1d1e90a2 php-cs-fixer nits 2020-10-21 16:44:57 +01:00
Dylan K. Taylor
286ac2a975 Rework World::blockHash() to use morton3d
this uses the unused bits on the Y component to expand the X/Z axes to 2^27 blocks long instead of 2^21 permitted by a regular morton3d code. It does require the sacrifice of an additional bit on the Y axis, but the performance advantages are more than worth it.
I'm exploring how realistic it would be to just eliminate blockHash global usage (currently in lighting updates and explosions). This would allow scaling up to 2^32 without larger hashes (morton2d for chunks).
2020-10-20 20:31:10 +01:00
dependabot-preview[bot]
4444a79468
Bump phpunit/phpunit from 9.4.1 to 9.4.2 (#3875) 2020-10-20 09:06:46 +00:00
Dylan K. Taylor
4684333dee Updated build/php to pmmp/php-build-scripts@eee477802a 2020-10-18 20:14:08 +01:00
Dylan K. Taylor
9a282e2646 Noise: Improve fastNoise3D performance by ~25-30% 2020-10-17 20:03:19 +01:00
Dylan K. Taylor
095449e86a Normal (generator): micro optimisations (and readability improvements) 2020-10-17 19:24:01 +01:00
Dylan K. Taylor
0f9d5f7011 ext-morton is now required and used for World::chunkHash() and World::chunkBlockHash() 2020-10-17 16:09:30 +01:00
Dylan K. Taylor
2d839db47e fixed build failure 2020-10-17 16:05:38 +01:00
Dylan K. Taylor
de6d260b76 Fixed cactus and sugarcane trying to grow past the top of the world 2020-10-17 15:05:55 +01:00
dependabot-preview[bot]
4cbeee3ab8
Bump phpstan/phpstan from 0.12.49 to 0.12.50 (#3874) 2020-10-17 13:44:43 +00:00
Dylan K. Taylor
a251960c1c AsyncPool: expose workerUsage to the API
this allows plugins (and maybe later on the core) to detect async worker overload and warn the user about potential performance issues.
I planned to implement such detection in the core directly, but it turned out to be a bit more complex than I anticipated. At the least, this API might be useful to someone else.
2020-10-16 21:20:49 +01:00
Dylan K. Taylor
d38791e27d Listener: Drop support for @softDepend annotation
literally nobody uses this. I don't think anyone even knows it exists.
It's also an obstacle to separating event handler registration from PluginManager.
2020-10-16 21:10:57 +01:00
Dylan K. Taylor
52f734799e Human: do not modify totalXp unless setting XP succeeds 2020-10-16 20:43:03 +01:00
Dylan K. Taylor
42171f6e06 Human: beware negative values in addXp() 2020-10-16 20:42:13 +01:00
Dylan K. Taylor
792f38f474 Carpet and Wool now have dynamic colours 2020-10-15 14:45:28 +01:00
Dylan K. Taylor
0ef0848c44 Concrete and ConcretePowder colour is now dynamic 2020-10-15 14:30:07 +01:00
Dylan K. Taylor
1fe4fdc67c PluginDescription: fixed some very old refactoring errors 2020-10-15 13:55:40 +01:00
Dylan K. Taylor
3aca03d262 Player: clean up refs when forced chunk unload is detected
this might happen because of a plugin, or low memory condition.
2020-10-13 18:17:12 +01:00
Dylan K. Taylor
cc91cbd8c5 Updated build/php submodule to pmmp/php-build-scripts@bc8e1cf001 2020-10-13 17:53:31 +01:00
Dylan K. Taylor
e8ec65766c Updated resources/locale to pmmp/Language@884a0496c3 2020-10-13 17:52:47 +01:00
Dylan K. Taylor
44e446b621 Merge remote-tracking branch 'origin/stable' into master
# Conflicts:
#	build/php
#	composer.lock
#	phpstan.neon.dist
#	resources/vanilla
#	src/pocketmine/Server.php
#	src/pocketmine/VersionInfo.php
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/lang/locale
#	src/utils/Timezone.php
#	tests/phpstan/bootstrap.php
#	tests/phpstan/configs/custom-leveldb.neon
2020-10-13 17:51:49 +01:00
Dylan K. Taylor
aa00bd5e31 Updated phpstan to 0.12.49 2020-10-13 17:39:24 +01:00
Dylan K. Taylor
0186468e47 updated composer dependencies 2020-10-13 17:38:06 +01:00
dependabot-preview[bot]
af4f30d1c8
Bump phpstan/phpstan from 0.12.48 to 0.12.49 (#3873) 2020-10-13 16:31:25 +00:00
Dylan K. Taylor
03837c1b71 ZlibCompressor: use libdeflate if available
I may make libdeflate mandatory later on, but right now we haven't been able to ship it on all platforms yet.
2020-10-13 17:30:27 +01:00
Dylan K. Taylor
3e2926441d PluginDescription: make sure that extensions constraints are actually strings 2020-10-13 17:21:10 +01:00
Dylan K. Taylor
0b33762be0 PluginDescription: fixed type of extensions (reported by phpstan 0.12.49) 2020-10-13 17:21:10 +01:00
Dylan T
e6f89213dc
Entity: properly account for upwards motion when calculating fall distance (#3867)
Previously, upwards movement wouldn't be considered, but downwards would, so if an entity bobbed up and down in the air for a while (e.g. while being comboed in PvP), the downwards distance would accumulate and deal a large amount of fall damage on touchdown.
This commit changes fall distance measurement to correctly account for upwards movement.

A better way of measuring fall distance would simply be to record the highest Y coordinate reached while in the air, and then measure the distance between that and the point of contact when landing. This would also remove the need to constantly update the fallDistance field. However, this would involve a BC break and will therefore have to wait until PM4.
2020-10-13 14:16:09 +01:00
Dylan T
f8d249b240
Isolate and always show IP details on install (#3870)
* Isolate and always show IP details on install

* camelCase
2020-10-13 14:11:28 +01:00
dependabot-preview[bot]
b39afa20d1
Bump phpunit/phpunit from 9.4.0 to 9.4.1 (#3872) 2020-10-13 13:09:56 +00:00
jasonwynn10
7027a9b972
camelCase 2020-10-12 08:25:34 -04:00
Jason
b02f3f4090
Isolate and always show IP details on install 2020-10-11 18:57:30 -04:00
Dylan K. Taylor
8564912149 phpstan: define LEVELDB_ZLIB_RAW_COMPRESSION if it doesn't exist (for phpstan)
this improves the analysis quality by informing phpstan of the type of whatever should be there.
2020-10-11 23:01:21 +01:00
Dylan K. Taylor
eabfd2a37b World: replace sendBlocks() with createBlockUpdatePackets()
this allows the caller to decide how the packets should be sent.
2020-10-11 16:30:54 +01:00
Dylan K. Taylor
ca9f3020b4 World: added private broadcastPacketToPlayersUsingChunk()
this is equivalent to the old addChunkPacket, but private and with a less stupid name.
2020-10-11 15:21:15 +01:00
Dylan K. Taylor
a05b1fec7e World: rename chunkPackets -> packetBuffersByChunk 2020-10-11 15:18:57 +01:00