1533fcf8f6
Separate block legacy data upgrading from block deserialization
...
this commit provides a central place where all block data can go to be upgraded to the latest version (currently 1.19), irrespective of how old it is.
Previously I had issues during debugging, because it wasn't possible to just upgrade a block without deserializing it into a Block object, which isn't currently supported for many blocks.
This commit solves that problem by separating the upgrading from the deserialization.
2022-06-23 16:45:02 +01:00
680615eed8
Namespace rename
2022-06-08 15:54:45 +01:00
1ff69136a3
Merge branch 'next-major' into modern-world-support
2022-06-07 20:01:40 +01:00
aa9f8781ff
Merge branch 'next-minor' into next-major
2022-06-07 19:56:26 +01:00
5c85aa6e58
Eliminate remaining usages of legacy block ID+meta on disk
...
flower pots loaded from vanilla worlds should now correctly display the plant inside
2022-06-05 21:49:51 +01:00
5a43db1c6d
LevelDB: remove stale TODO comment
...
this has been addressed by folding to state 0 in the legacy blockstate mapper.
2022-06-04 18:47:29 +01:00
dab7686656
Merge branch 'next-major' into modern-world-support
2022-06-04 18:43:11 +01:00
083a35f970
Modernize property type declarations
2022-06-04 18:16:32 +01:00
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
43e61336cf
Support 1.18.30 worlds
2022-04-20 14:58:32 +01:00
eafbc3a468
Expand height range to include -64 to 320
2022-04-15 19:10:24 +01:00
993adc8c82
LevelDB: remove deprecated constants
...
there's no point pretending we can maintain BC on this now
2022-03-24 12:59:45 +00:00
e58b3ba46c
First look at loading 1.13+ worlds
2022-02-07 03:06:59 +00:00
c19a038d47
LevelDB: Added a whole bunch of constants
2022-02-07 00:54:00 +00:00
7ddd547190
Merge remote-tracking branch 'origin/stable' into staging/4.1
2022-02-06 23:55:52 +00:00
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
aae5962f6a
Replace disallowed operators in src/world/
2022-01-20 19:05:23 +00:00
1a046c6cd5
LevelDB: fixed server crash when corrupted / invalid blockstate NBT is encountered
2021-12-04 18:17:17 +00:00
e61aaaccca
LevelDB: removed hack for problem fixed by 1f9400f901
2021-12-04 16:20:57 +00:00
c6c992a1f0
Preparations for negative Y support
2021-11-08 17:28:22 +00:00
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
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
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
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
6cf181b579
LevelDB: Use arrow functions for better readability
2021-09-16 14:44:56 +01:00
4111d92b98
Stop hardcoding chunk dimensions everywhere ( #4443 )
2021-09-10 16:13:25 +01:00
11d2e1ef08
Require ext-chunkutils ^0.3.0
2021-09-07 22:53:50 +01:00
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
994a2c9eb9
Clean up entity/tile data loading from world providers
2021-08-29 23:11:18 +01:00
91cb374220
LevelDB: fixed isPopulated state getting lost after chunk unload/reload
2021-08-08 16:01:45 +01:00
32d7b1e6af
Start using webmozart/pathutil for joining paths ( #4287 )
2021-06-29 19:40:43 +01:00
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
e6fb6b1f27
BaseLevelProvider: Remove obsolete proxy methods
2021-04-15 15:15:16 +01:00
7b21fc8e9d
WorldCreationOptions are now mandatory during creation of worlds
2021-04-15 13:54:58 +01:00
9c1b274499
WorldManager::createWorld() now accepts WorldCreationOptions instead of mixed[]
2021-04-13 21:03:25 +01:00
eb9a68edee
Further refactors to prepare for y=-64 lower limit
2021-03-18 00:08:16 +00:00
9a1cef0d4f
Merge branch 'stable'
2021-02-11 22:35:33 +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
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
c808095978
Chunks no longer contain their own coordinates
2020-12-03 21:59:30 +00:00
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
a5d77d5106
LevelDB: remove unused function
2020-07-08 23:24:54 +01:00
c618932d25
Eliminate usages of BinaryStream->setBuffer() and BinaryStream->reset()
2020-06-17 13:49:43 +01:00
0d186fe42c
Merge commit '725506510'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/level/format/io/leveldb/LevelDB.php
2020-06-13 11:55:10 +01:00
82d361d75f
extract a BiomeArray unit from Chunk
...
this now also properly validates data read from disk.
2020-05-16 17:36:22 +01:00
3a42c21cc1
wrap up block_id_map in a class
2020-04-24 21:28:27 +01:00
aac7da6c96
eliminate remaining empty() usages
2020-02-07 21:51:50 +00:00
67bcc1c0fb
phpdoc armageddon for master, pass 1
2020-01-22 11:55:03 +00:00
3fa628f259
updated NBT dependency
2019-12-09 11:26:43 +00:00
117e46f639
LevelDB: fix doc comment handling for deserializeLegacyExtraData()
2019-12-04 11:29:41 +00:00