Commit Graph

679 Commits

Author SHA1 Message Date
ab176264b4 ... 2021-04-13 21:06:37 +01:00
9c1b274499 WorldManager::createWorld() now accepts WorldCreationOptions instead of mixed[] 2021-04-13 21:03:25 +01:00
6ce15854af Clean up generator preset handling 2021-04-13 20:19:53 +01:00
1e6d97a157 Merge branch 'stable' 2021-04-07 21:25:39 +01:00
adbc58f326 TickingChunkLoader: use native return types 2021-03-26 22:55:48 +00:00
f047ecfd2d Fixed player spawning in ungenerated terrain (#4087)
fixes #4044
fixes #2724

this is significantly more complex than I hoped for, but it's a start... and it works.
2021-03-26 21:36:27 +00:00
64886707b2 SubChunkExplorer: avoid repeated shift-right instructions 2021-03-25 23:36:10 +00:00
5e9ce92b55 Explosion: don't depend on air having stateID 0 2021-03-25 23:17:33 +00:00
0d775f8731 Require ext-chunkutils2 at ^0.2.0 2021-03-23 22:23:17 +00:00
aa8c13ec45 Remove dynamic LightArray constants
sad, no constexpr functions :(
2021-03-23 20:23:56 +00:00
49438d360d RegistryUtils: generate ordered doc comments
this makes things easier to find, especially in the large ones like VanillaBlocks.
2021-03-22 16:16:28 +00:00
90161f24e3 Added script to update registry/enum docblocks 2021-03-22 16:00:09 +00:00
a515b5e1b8 World: remove dead constant Y_MASK 2021-03-19 21:13:56 +00:00
5dd0b3ac35 OOOPS
it's a bit too early for this
2021-03-19 21:12:46 +00:00
c092a2e836 Separate TickingChunkLoader from ChunkLoader
this makes it possible to keep chunks loaded without ticking them.
2021-03-18 23:19:27 +00:00
d1387ebd0a World: assume that the primary active chunk is not NULL in generateChunkCallback() 2021-03-18 21:56:17 +00:00
34bb225566 World: rename some poorly-named fields 2021-03-18 21:33:17 +00:00
eb9a68edee Further refactors to prepare for y=-64 lower limit 2021-03-18 00:08:16 +00:00
b844c4266d Added World::Y_MIN
preparation for Y axis expansion in 1.17
2021-03-17 23:19:49 +00:00
5a59afbe2c Place world conversion backups in <pwd>/backups/worlds instead of <pwd>/world_conversion_backups 2021-03-17 01:21:11 +00:00
72de45f0e9 Drop pocketmine/uuid for ramsey/uuid 2021-03-16 23:03:00 +00:00
a49ee0d6b0 World: mark addTile() and removeTile() as @internal 2021-02-24 23:42:09 +00:00
9a1cef0d4f Merge branch 'stable' 2021-02-11 22:35:33 +00:00
c21ec614fc Fixed PHPStan 0.12.74 error in WorldManager 2021-02-11 16:54:14 +00:00
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
3e1ac66abf Merge branch 'stable' 2021-02-02 13:46:29 +00:00
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
bbae02264d Merge branch 'stable' 2021-01-27 20:04:13 +00:00
269a389a97 BlockTransaction: added phpstan return type info for getBlocks() 2021-01-25 18:04:42 +00:00
69a829db91 Merge remote-tracking branch 'origin/stable' 2021-01-20 22:16:44 +00:00
487b5dd11d Merge branch 'stable' 2021-01-16 19:44:15 +00:00
5fa4e284bf Merge branch 'stable' 2020-12-27 19:35:27 +00:00
bcc3e87730 Timings: rename core timers to remove 'timer' from the names
this makes them shorter and more consistent.
2020-12-23 17:52:25 +00:00
9228f006d4 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	composer.json
#	composer.lock
#	resources/vanilla
#	src/CrashDump.php
#	src/PocketMine.php
#	src/pocketmine/Server.php
#	src/pocketmine/item/Bucket.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	src/pocketmine/network/mcpe/protocol/BatchPacket.php
#	src/pocketmine/tile/Furnace.php
#	src/pocketmine/utils/UUID.php
#	src/utils/ServerKiller.php
2020-12-20 20:54:13 +00:00
1e737644de World: split populateChunk() into two functions
requestChunkPopulation() respects the queue size, orderChunkPopulation() does not.
requestChunkPopulation() should be used for non-essential generation (which mainly includes generation for player use).
orderChunkPopulation() should probably be used by plugins.
2020-12-17 23:49:37 +00:00
48623f4e79 World: add additional checks to addEntity() and removeEntity() 2020-12-14 18:55:52 +00:00
6f09d472e2 WorldTimings: give timers names that actually make sense 2020-12-13 20:17:46 +00:00
1de5fc86c4 PopulationTask: assume that generator has been initialized 2020-12-13 20:00:57 +00:00
dd58a95ae5 Move last-known-position tracking to World instead of Entity 2020-12-10 18:28:40 +00:00
e925423749 Entity: fix chunk tracking consistency issues, fixed attempted chunk loading in origin world when teleporting to a different position in a different world 2020-12-10 18:13:18 +00:00
219cf2126b RegionWorldProvider: make loadRegion() return RegionLoader, fix 3 PHPStan null-reference errors 2020-12-07 19:04:52 +00:00
e810a68dd7 Merge branch 'stable'
# Conflicts:
#	build/php
#	composer.lock
#	resources/vanilla
#	src/pocketmine/VersionInfo.php
#	src/pocketmine/level/format/io/region/McRegion.php
2020-12-07 18:57:58 +00:00
59cb11dc83 ChunkManager->setChunk() no longer accepts NULL 2020-12-05 18:54:30 +00:00
b6df5b974d World->getHighestBlockAt() may still return -1 if the queried column of blocks is all air 2020-12-05 18:14:38 +00:00
1f330c0f50 World: ignore entities calling onEntityMoved() who aren't members of the world
this can happen if movement or teleportation occurs during the creation of an entity.
2020-12-05 17:49:34 +00:00
a5315991d5 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
#	src/world/biome/Biome.php
#	tests/phpstan/configs/l8-baseline.neon
2020-12-05 01:30:39 +00:00
d728160a77 Removed the cycle between Entity and Chunk
it's now the World's responsibility to manage adding/removing entities from appropriate chunks. Entities no longer know or care that chunks exist.
Entity->checkChunks() remains as-is for backwards compatibility - now it just calls the world to sync its position.
2020-12-05 00:59:16 +00:00
1c49cedc8c World: disallow block placement and breaking in unloaded, ungenerated and locked chunks 2020-12-04 15:49:35 +00:00
bacdb7bde5 Make sure generator gets preemptively registered when a worker restart is detected
if a PopulationTask took place after the target worker was garbage collected, the population would fail and the chunks it used would be copied for nothing.
This change marks workers as having unregistered generators when detecting that a worker that previously had a generator registered is restarted.
2020-12-04 15:44:17 +00:00
5ba09b6a25 fix PopulationTask crash 2020-12-03 23:48:40 +00:00