Dylan K. Taylor
4aa1a3da8b
Moving more stuff around
2022-06-08 15:57:02 +01:00
Dylan K. Taylor
680615eed8
Namespace rename
2022-06-08 15:54:45 +01:00
Dylan K. Taylor
e956cfed1c
Branch-specific 1.19.0 stuff
2022-06-07 20:14:00 +01:00
Dylan K. Taylor
cf7d42b3ea
Fix CS according to new rules
2022-06-07 20:02:24 +01:00
Dylan K. Taylor
1ff69136a3
Merge branch 'next-major' into modern-world-support
2022-06-07 20:01:40 +01:00
Dylan K. Taylor
aa9f8781ff
Merge branch 'next-minor' into next-major
2022-06-07 19:56:26 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
dab7686656
Merge branch 'next-major' into modern-world-support
2022-06-04 18:43:11 +01:00
Dylan K. Taylor
083a35f970
Modernize property type declarations
2022-06-04 18:16:32 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
Dylan K. Taylor
01af70f671
Merge branch 'next-major' into modern-world-support
2022-06-02 20:24:25 +01:00
Dylan K. Taylor
23695fb900
RegionLoader: remove dead static property
...
[bc break]
2022-06-02 16:55:22 +01:00
Dylan K. Taylor
68491be847
Merge branch 'next-major' into modern-world-support
2022-05-20 11:21:35 +01:00
Dylan K. Taylor
d4b7f66e15
Promote some constructors
2022-05-17 22:34:58 +01:00
Dylan K. Taylor
0326c4964b
Merge branch 'next-major' into modern-world-support
2022-04-28 21:06:44 +01:00
Dylan K. Taylor
de12b701ac
Modernize type declarations in src/world/format
2022-04-28 13:07:58 +01:00
Dylan K. Taylor
43e61336cf
Support 1.18.30 worlds
2022-04-20 14:58:32 +01:00
Dylan K. Taylor
eafbc3a468
Expand height range to include -64 to 320
2022-04-15 19:10:24 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
ed95679953
Merge branch 'next-minor' into modern-world-support
2022-03-23 13:42:46 +00:00
Dylan K. Taylor
70f923714c
Merge branch 'stable' into next-minor
2022-03-02 18:43:34 +00:00
Dylan K. Taylor
a95749f968
Now using new repository for block upgrade schemas
2022-02-22 22:09:47 +00:00
Dylan K. Taylor
c816bbdb6e
Remove unused import that php-cs-fixer doesn't see
2022-02-22 16:46:23 +00:00
Dylan K. Taylor
75d4c47384
LevelDB: fixed incorrectly writing always newest protocol version in world saves
...
this made it impossible to tell the difference between PM worlds and bedrock worlds modified post-1.12.
2022-02-20 21:08:31 +00:00
Dylan K. Taylor
e58b3ba46c
First look at loading 1.13+ worlds
2022-02-07 03:06:59 +00:00
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
889d048ca3
Make use of Utils::assumeNotFalse() in a bunch of places
...
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
Dylan K. Taylor
8e37f86480
Avoid file_put_contents() when overwriting files
...
this fixes many cases of corruption during disk-full situations - file_put_contents() would write an empty file, destroying the original data.
fixes #3152
2021-12-05 00:26:48 +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
d8f0fd0a7e
McRegion: skip chunks with TerrainGenerated=false
...
legacy PM used to save even ungenerated chunks, and omitted some tags when doing so which we expect to always be present.
2021-11-23 01:49:48 +00:00
Dylan K. Taylor
fb0eebc0dc
RegionWorldProvider: Show a more specific message on missing required ByteArrayTags
2021-11-23 01:39:35 +00:00
Dylan K. Taylor
269231c228
Ban foreach(arrayWithStringKeys as k => v)
...
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
2021-11-15 22:52:05 +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
a62ce64fdd
Revert "Chunk: added modification counter"
...
This reverts commit a5418a019dc2a83210084632130db8ce06f529ea.
The more I assessed this, the more I realized that this implementation
doesn't actually offer any value. Since modcounters don't persist after
chunk unload + reload, they can't be reliably used to detect changes in
chunks without additional event subscriptions.
For the purpose I actually intended to use them for (population task
cancellation) there's a) another solution, and b) modcounts are
unreliable for that too, because of the aforementioned potential for
chunks to get unloaded and reloaded.
For the case of detecting dirty chunks within PopulationTask itself,
they are also unnecessary, since the dirty flags are sufficient within
there, since FastChunkSerializer doesn't copy dirty flags.
In conclusion, this was a misbegotten addition with little real value,
but does impact performance in hot paths.
2021-10-28 21:02:04 +01:00
Dylan K. Taylor
a5418a019d
Chunk: added modification counter
...
this is independent from the terrain dirty flags (which are specifically used to track state of chunks needing to be saved).
2021-10-25 20:53:11 +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
34f54750c8
Added support for creation-time validation of generator options, closes #2717
2021-10-11 17:37:47 +01:00
Dylan K. Taylor
7b6632941d
GeneratorManager::getGenerator() now returns null for unknown generator aliases
...
instead of returning Normal::class (indistinguishable from successful match) or throwing an exception (pain in the ass to handle).
2021-10-11 16:04:36 +01:00
Dylan K. Taylor
308d7c126a
Fixed world data ::generate() functions putting level.dat in the wrong place if the world path didn't end with a /
2021-10-08 23:39:25 +01:00
Dylan K. Taylor
8de30e8162
FastChunkSerializer no longer serializes light by default
...
the core doesn't use this anywhere.
serializeWithoutLight() has been renamed to serializeTerrain() to more accurately describe what it does.
2021-10-01 22:57:22 +01:00
Dylan K. Taylor
5b818827db
Chunk: stop exposing SplFixedArray<SubChunk> to the API
...
this fixes a large number of PHPStan errors, and also brings us a step closer to negative-build-height readiness.
2021-10-01 22:17:28 +01:00
Dylan K. Taylor
42bf9578ce
Remove unused constants
2021-10-01 22:05:03 +01:00