103 Commits

Author SHA1 Message Date
Dylan K. Taylor
5fcf5e0c40
LevelDB: log more stuff, stop bailing on recoverable errors 2023-05-02 16:46:45 +01:00
Dylan K. Taylor
29694c19af
BlockStateUpgradeSchemaUtils: Use independent suffixes for each property mapping list 2023-05-01 14:46:30 +01:00
Dylan K. Taylor
a1d44de487
Added support for compressing blockstate remaps using copiedState
this significantly reduces the size of schemas when state remaps are used (see pmmp/BedrockBlockUpgradeSchema@85b83b360e).

in addition, this will likely offer a substantial performance and memory saving when walls get flattened, which will eventually happen.
2023-04-28 20:35:37 +01:00
Dylan K. Taylor
2121152b76
Fix CS 2023-04-28 20:03:53 +01:00
Dylan K. Taylor
a1cd1d7433
... 2023-04-28 19:35:03 +01:00
Dylan K. Taylor
04aabaee5e
Fix CS 2023-04-28 19:31:08 +01:00
Dylan K. Taylor
75410a5412
BlockStateUpgradeSchemaUtils: sort data before emitting JSON
this makes it easier to see what's changing, as well as making the order stable across multiple regenerations.
2023-04-28 19:31:00 +01:00
Dylan K. Taylor
e2108557ab
BlockStateUpgrader: make sure the returned state always has an updated version ID
PM itself doesn't require this, but it's useful for tools to know whether to upgrade the schema again (e.g. in testing scenarios).
2023-04-28 17:26:19 +01:00
Dylan K. Taylor
ff8301b86c
BlockStateData: fixed outdated version ID 2023-04-28 17:23:32 +01:00
Dylan K. Taylor
869c836e2d
BlockStateUpgradeSchemaUtils: ensure that remapped values are generated in a consistent order
this uses lexical order, which isn't ideal for numeric values (1, 10, 2, etc), but it's good enough to ensure that the order is stable.
2023-04-28 17:12:52 +01:00
Dylan K. Taylor
a8dec1adb1
PM5-specific changes for 1.19.80 2023-04-26 23:30:56 +01:00
Dylan K. Taylor
0818388bd5
Allow remapped oldState and newState to accept null, to make it easier for third-party tools to use the schemas
since PHP emits empty JSON objects as arrays, this makes it pretty annoying to work with the schemas in other languages. However, nullability is something most languages understand pretty easily.

This should continue to support old schemas.
2023-03-25 19:41:40 +00:00
Dylan K. Taylor
777b4d6ac3
PM5-specific updates for 1.19.70 2023-03-14 18:50:04 +00:00
Dylan K. Taylor
a123194368
BlockStateData: added getVersionAsString() 2023-03-13 16:14:19 +00:00
ipad54
75f74454c6
Implemented reinforced deepslate (#5553) 2023-02-15 15:15:04 +00:00
Dylan K. Taylor
c0f3dbdd70
Regenerate constants for block and item data handling 2023-02-15 15:12:53 +00:00
Dylan K. Taylor
da5302ca86
BlockStateData: introduce and use current() 2023-02-02 16:21:50 +00:00
Dylan K. Taylor
0e15a8698a
BlockStateUpgrader: do not use blockstate version to manage internal schemas
these are no longer reliable.
2023-02-01 22:35:59 +00:00
Dylan K. Taylor
d3fff4e0b2
Updated to newer BedrockBlockUpgradeSchema 2023-02-01 21:21:55 +00:00
Dylan K. Taylor
0a3ecfdae9
Clean up terminology around block state IDs and their handling 2023-01-25 19:01:15 +00:00
Dylan K. Taylor
2f469ef4a0
Added mangrove, azalea and flowering azalea leaves 2023-01-25 18:50:14 +00:00
Dylan K. Taylor
ecd8f151f1
Merge branch 'next-minor' into next-major 2023-01-12 22:08:25 +00:00
Dylan K. Taylor
ca1f1bf09f
Fixed glowing item frames
due to technical limitations, this requires separating them back into two different block types. However, this isn't too egregious since it's just one flag, and actually simplifies some code.

closes #5478
2023-01-12 21:52:52 +00:00
ipad54
85231215e7
Implemented Sculk (#5489) 2023-01-04 20:10:46 +00:00
Dylan K. Taylor
8fd4918429
Use Filesystem::fileGetContents() in more places 2022-12-25 18:26:53 +00:00
ipad54
b3473960b4
Implemented chain (#5454) 2022-12-22 15:22:04 +00:00
ipad54
858d3dce8e
Implement Weeping & Twisting vines (#5396) 2022-11-15 15:29:42 +00: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
1bc8fb1851
BlockStateToObjectDeserializer: reduce code duplication in legacy slab handling 2022-09-24 16:32:02 +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
cf9610c710
BlockStateToBlockObjectDeserializer: added mapSimple() for symmetry's sake
this will also make it marginally easier to switch to a unified system.
2022-09-24 13:41:41 +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
d4f96a155a
Support axis rotation of Muddy Mangrove Roots (implemented in 1.19.20) 2022-08-14 18:53:01 +01:00
Dylan K. Taylor
43a3151de3
Merge branch 'next-minor' into next-major 2022-08-14 18:49:19 +01:00
Dylan K. Taylor
102406ee79
Added froglights 2022-07-23 17:40:38 +01:00
Dylan K. Taylor
38e495babf
Added mangrove roots and muddy mangrove roots 2022-07-23 17:20:23 +01:00
Dylan K. Taylor
b13f333b2e
Added mud and packed mud 2022-07-23 16:40:46 +01:00
Dylan K. Taylor
a7313ed9d9
Added rooted dirt 2022-07-23 16:12:17 +01:00
Dylan K. Taylor
67682cbf27
Added chorus plant and flower 2022-07-20 20:19:36 +01:00
Dylan T
c1acf44337
Implement cauldrons (#5163)
the following things are currently not implemented:

- particle/sound effects when an entity extinguishes itself
- particle/sound effects when mixing different stuff in a cauldron
- powder snow cauldron

both of these things are contingent on #5169, but for the time being, the PR is functionally complete and I want to move on to something else without being stalled by the particle+sound problem (which I haven't yet decided how to solve).
2022-07-20 16:12:58 +01:00
Dylan K. Taylor
fa201b081c
Added spore blossoms
I got tired of the flood of warning messages every time someone joined the dev server...
2022-07-19 20:28:12 +01:00
Dylan K. Taylor
87b840ff97
Added a hack to allow tiles to trigger client-side render updates on blocks without actually changing the block
Bedrock block entity updates don't directly trigger block rendering
updates. This is a problem when the block entity data affects the
block's appearance directly (e.g. cauldron water colour, flower pot
contents), because it means changing them won't directly result in a
client-side render update.

This hack allows tiles to spoof block updates without actually changing
the server-side block, keeping the internals and API clean of random
shitbox workarounds.

fixes #5174
fixes #4944
2022-07-19 17:47:46 +01:00
Dylan K. Taylor
f64e306fb8
Make BlockIdMetaUpgrader API less dumb
the old impl prevented registering more than one meta -> state mapping since the legacy numeric ID map would throw an exception if attempting to map the same ID more than once.
2022-07-19 16:21:56 +01:00
Dylan K. Taylor
b36b65927c
BlockDataUpgrader: expose BlockIdMetaUpgrader via getter 2022-07-19 16:02:35 +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
b0a492c063
Move simple block (de)serializer registrations into their own functions 2022-07-18 18:47:30 +01:00
Dylan K. Taylor
ba2baba7cc
Added netherite blocks and items 2022-07-14 20:39:09 +01:00
Dylan K. Taylor
eb8fb63409
Added cartography and smithing tables
these have working inventories, and their crafting menus will 'just work' once the items for the associated recipes have been implemented (maps, netherite).
2022-07-14 18:01:47 +01:00
Dylan K. Taylor
91719051e2
BlockStateToBlockObjectDeserializer: removed TODO mess
these were useful when writing the initial version from scratch; not so much for implementing random blocks
2022-07-14 16:50:08 +01:00
Dylan K. Taylor
d321094081
Added hanging roots 2022-07-14 16:47:55 +01:00