Dylan K. Taylor
8fd4918429
Use Filesystem::fileGetContents() in more places
2022-12-25 18:26:53 +00:00
Dylan K. Taylor
c89df7eb1c
Merge remote-tracking branch 'origin/next-minor' into next-major
2022-12-25 18:22:13 +00:00
Dylan K. Taylor
0d169b4e80
Filesystem: added fileGetContents to reduce ErrorToExceptionHandler boilerplate code
2022-12-25 17:13:51 +00:00
Dylan K. Taylor
9809909072
BedrockWorldData: remove unused custom fields
2022-12-19 15:06:06 +00:00
Dylan K. Taylor
de3af9e660
Fix CS
2022-12-19 15:02:59 +00:00
Dylan K. Taylor
a30c649607
BedrockWorldData: enable commands by default
2022-12-19 14:59:55 +00:00
Dylan K. Taylor
d7ebabd771
Fixed the client asking to upgrade PM-generated worlds
2022-12-19 14:56:04 +00:00
Dylan K. Taylor
be1087c071
Accept worlds from 1.19.40 and up
2022-12-19 14:55:24 +00:00
Dylan K. Taylor
b27c47335c
JavaWorldData: remove Bedrock-compatible hacks
...
we don't need these, since we don't write to Java world formats anymore anyway.
2022-12-19 13:43:28 +00:00
Dylan K. Taylor
58eec637c1
Constify NBT keys in world data handling
...
this code is one giant mess that needs to be cleaned up though...
2022-12-19 13:39:41 +00:00
Dylan K. Taylor
4d79aced07
Merge branch 'next-minor' into next-major
2022-12-15 19:50:27 +00:00
Dylan K. Taylor
99996b62d6
Align PhpDoc @param tags according to PHP-CS-Fixer
2022-12-06 13:21:20 +00:00
Dylan K. Taylor
01bad344a0
Merge branch 'next-minor' into next-major
2022-11-04 20:47:26 +00:00
Dylan K. Taylor
cdbdcb5d67
Merge branch 'stable' into next-minor
2022-11-04 20:44:28 +00:00
Dylan K. Taylor
2fdc46c165
PHPStan 1.9 features
2022-11-04 20:23:34 +00:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
...
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
Dylan K. Taylor
f88ae93897
BC break: Replaced webmozart/path-util with symfony/filesystem, closes #5332
2022-10-13 16:43:36 +01:00
Dylan K. Taylor
1609b11c8e
Make blockstate (de)serializer names a bit less verbose
2022-09-24 13:43:00 +01:00
Dylan K. Taylor
590eb74703
Make Block(De)Serializer much less nasty to interact with
...
this makes it a lot less inconvenient to access the primary blockstate serializer/deserializer, which is necessary for registering new blocks.
2022-09-24 13:31:50 +01:00
Dylan K. Taylor
bedf79e2cd
BaseWorldProvider: don't crash the server when encountering an unknown block
2022-07-21 16:12:27 +01:00
Dylan K. Taylor
afaf9dbc88
Rename LegacyBlockStateMapper -> BlockIdMetaUpgrader
...
this more accurately describes what it's used for.
2022-07-19 15:32:08 +01:00
Dylan K. Taylor
ccb3c3cb05
BlockStateData: use array<Tag> instead of CompoundTag to store state properties
...
this reduces the footprint of RuntimeBlockMapping by a further 1 MB, as well as simplifying various parts of the code, and solidifying the immutability guarantee of BlockStateData.
2022-07-09 16:03:51 +01:00
Dylan K. Taylor
54a773be0c
SubChunk::__construct(): rename blocks to blockLayers
2022-07-07 20:04:16 +01:00
Dylan K. Taylor
f24f2d9ca9
Hit block legacy metadata with the biggest nuke you've ever seen
...
This commit completely revamps the way that blocks are represented in memory at runtime.
Instead of being represented by legacy Mojang block IDs and metadata, which are dated, limited and unchangeable, we now use custom PM block IDs, which are generated from VanillaBlocks.
This means we have full control of how they are assigned, which opens the doors to finally addressing inconsistencies like glazed terracotta, stripped logs handling, etc.
To represent state, BlockDataReader and BlockDataWriter have been introduced, and are used by blocks with state information to pack said information into a binary form that can be stored on a chunk at runtime.
Conceptually it's pretty similar to legacy metadata, but the actual format shares no resemblance whatsoever to legacy metadata, and is fully controlled by PM.
This means that the 'state data' may change in serialization format at any time, so it should **NOT** be stored on disk or in a config.
In the future, this will be improved using more auto-generated code and attributes, instead of hand-baked decodeState() and encodeState(). For now, this opens the gateway to a significant expansion of features.
It's not ideal, but it's a big step forwards.
2022-06-24 23:19:37 +01:00
Dylan K. Taylor
5ed75731f2
First (untested) look at hooking all the itemstack serializer/deserializer stuff together
...
this should address #5063 and related issues, if it works correctly.
2022-06-23 19:02:16 +01:00
Dylan K. Taylor
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
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