41 Commits

Author SHA1 Message Date
Dylan K. Taylor
c19a038d47
LevelDB: Added a whole bunch of constants 2022-02-07 00:54:00 +00:00
Dylan K. Taylor
7ddd547190
Merge remote-tracking branch 'origin/stable' into staging/4.1 2022-02-06 23:55:52 +00:00
Dylan K. Taylor
7846ea8acc
LevelDB: do not barf on chunk version 8
this covers a wide range from 1.2.13 to 1.8.
2022-02-05 04:18:37 +00:00
Dylan K. Taylor
aae5962f6a
Replace disallowed operators in src/world/ 2022-01-20 19:05:23 +00:00
Dylan K. Taylor
1a046c6cd5
LevelDB: fixed server crash when corrupted / invalid blockstate NBT is encountered 2021-12-04 18:17:17 +00:00
Dylan K. Taylor
e61aaaccca
LevelDB: removed hack for problem fixed by 1f9400f9011546ab914090853069aaa76192a722 2021-12-04 16:20:57 +00:00
Dylan K. Taylor
c6c992a1f0
Preparations for negative Y support 2021-11-08 17:28:22 +00:00
Dylan K. Taylor
d410db4302
Chunk: rename DIRTY_FLAG_TERRAIN to DIRTY_FLAG_BLOCKS
we use the word 'terrain' elsewhere to refer to the combination of blocks and biomes, so using TERRAIN here is misleading.
2021-10-28 22:11:07 +01:00
Dylan K. Taylor
baba25953f
Chunk: make all parameters of __construct() mandatory and non-nullable
having the constructor fill in defaults for these invariably causes bugs.
2021-10-25 20:22:50 +01:00
Dylan K. Taylor
9835d75f65
Chunk: removed heighArray parameter from constructor
we don't pass this anywhere, and really it should be dynamically initialized anyway, just like light.
2021-10-25 20:13:50 +01:00
Dylan K. Taylor
b8519d1af4
World: fixed every chunk having terrain saved at least once, even if unmodified
setPopulated() sets dirty flags on the chunk, causing the autosave sweep
to think they've been changed when they haven't. We now pass
terrainPopulated to the constructor to avoid this ambiguity recurring in
the future.
2021-10-25 19:53:47 +01:00
Dylan K. Taylor
6cf181b579
LevelDB: Use arrow functions for better readability 2021-09-16 14:44:56 +01:00
Dylan T
4111d92b98
Stop hardcoding chunk dimensions everywhere (#4443) 2021-09-10 16:13:25 +01:00
Dylan K. Taylor
11d2e1ef08
Require ext-chunkutils ^0.3.0 2021-09-07 22:53:50 +01:00
Dylan K. Taylor
0289b45202
Chunk: Drop dirty flags for tiles and entities
instead, just ungate this and allow the provider to decide what to do.
Any chunk that contains entities or tiles is already always considered dirty, so the only thing the flags are good for is flagging chunks that previously had tiles and/or entities but no longer do.
In those cases, it's just removing keys from LevelDB anyway, so it's already very cheap.
Avoiding these redundant deletions is not worth the extra complexity and fragility of relying on flags to track this stuff.
2021-08-30 00:09:36 +01:00
Dylan K. Taylor
994a2c9eb9
Clean up entity/tile data loading from world providers 2021-08-29 23:11:18 +01:00
Dylan K. Taylor
91cb374220
LevelDB: fixed isPopulated state getting lost after chunk unload/reload 2021-08-08 16:01:45 +01:00
Dylan T
32d7b1e6af
Start using webmozart/pathutil for joining paths (#4287) 2021-06-29 19:40:43 +01:00
Dylan K. Taylor
61c59be299
Replace hardcoded block metadata shifts and masks with constants
we might want to make these bigger than 4 bits in the future.
2021-06-16 12:48:09 +01:00
Dylan K. Taylor
e6fb6b1f27
BaseLevelProvider: Remove obsolete proxy methods 2021-04-15 15:15:16 +01:00
Dylan K. Taylor
7b21fc8e9d
WorldCreationOptions are now mandatory during creation of worlds 2021-04-15 13:54:58 +01:00
Dylan K. Taylor
9c1b274499
WorldManager::createWorld() now accepts WorldCreationOptions instead of mixed[] 2021-04-13 21:03:25 +01:00
Dylan K. Taylor
eb9a68edee
Further refactors to prepare for y=-64 lower limit 2021-03-18 00:08:16 +00:00
Dylan K. Taylor
9a1cef0d4f
Merge branch 'stable' 2021-02-11 22:35:33 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
b9cd633cee Chunks no longer exist in un-generated state
a non-generated chunk is now always represented by NULL. This forces the case of ungenerated chunks to be handled by all code, which is necessary because ungenerated chunks cannot be interacted with or modified in any meaningful way.
2020-12-03 22:28:43 +00:00
Dylan K. Taylor
c808095978 Chunks no longer contain their own coordinates 2020-12-03 21:59:30 +00:00
Dylan K. Taylor
9191e75392 LevelDB: quick and dirty hack for air with bad metadata
this needs a proper solution, but this is a pressing issue that can't wait.
2020-10-03 16:41:26 +01:00
Dylan K. Taylor
a5d77d5106 LevelDB: remove unused function 2020-07-08 23:24:54 +01:00
Dylan K. Taylor
c618932d25 Eliminate usages of BinaryStream->setBuffer() and BinaryStream->reset() 2020-06-17 13:49:43 +01:00
Dylan K. Taylor
0d186fe42c Merge commit '725506510'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
2020-06-13 11:55:10 +01:00
Dylan K. Taylor
82d361d75f extract a BiomeArray unit from Chunk
this now also properly validates data read from disk.
2020-05-16 17:36:22 +01:00
Dylan K. Taylor
3a42c21cc1 wrap up block_id_map in a class 2020-04-24 21:28:27 +01:00
Dylan K. Taylor
aac7da6c96 eliminate remaining empty() usages 2020-02-07 21:51:50 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
3fa628f259 updated NBT dependency 2019-12-09 11:26:43 +00:00
Dylan K. Taylor
117e46f639 LevelDB: fix doc comment handling for deserializeLegacyExtraData() 2019-12-04 11:29:41 +00:00
Dylan K. Taylor
02ff8d671b Mostly phase out EmptySubChunk
copy-on-write and zero-layer SubChunk objects are much easier to manage and have less cognitive overhead.

obviously, the goal is to get rid of EmptySubChunk completely, but right now it does still serve a purpose (filling in dummy values for reading out-of-bounds on chunks), and that's a problem that takes a little more work to fix.
2019-10-22 23:00:49 +01:00
Dylan K. Taylor
42ffc45c1c world providers: don't assume that getPath() has a trailing directory separator 2019-08-25 15:45:40 +01:00
Dylan T
c533f6a0bd
Implemented partial chunk saving on LevelDB (#3078) 2019-08-07 17:39:36 +01:00
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00