17 Commits

Author SHA1 Message Date
Dylan K. Taylor
16f29c775e
tools/generate-blockstate-upgrade-schema: added support for generating newFlattenedName with value transforms
as seen in pmmp/BedrockBlockUpgradeSchema@ebd768e5b2, this enables use of newFlattenedName in more places (by allowing the flattened values to be transformed before building the new ID), as well as reducing the number of remappedStates in general by compacting stuff which was partially transformed like color silver -> light_gray.
2024-04-05 17:13:38 +01:00
Dylan K. Taylor
8ccaf907d1
tools/generate-blockstate-upgrade-schema: do not optimize state remaps with unchanged IDs
processRemappedStates() needs to know about the full set of states to generate reliable mappings.
Without it, it may generate flattening rules or state matching criteria that unintentionally match states that it's not aware of.
Sadly, this does make some schemas bigger, but it's for the best.
2023-11-08 15:19:02 +00:00
Dylan K. Taylor
c165670e0a
Added support for using and generating blockstate upgrade schemas using newFlattenedName rules
see pmmp/BedrockBlockUpgradeSchema@f426fccbee
2023-06-26 16:20:01 +01:00
Dylan K. Taylor
882d50b14e
Reapply 470a3e1a3: tools/generate-blockstate-upgrade-schema: reduce dependencies for generating blockstate mappings 2023-06-26 16:09:51 +01:00
Dylan K. Taylor
0b0b72f596
Reapply b8788c55c: tools/generate-blockstate-upgrade-schema: improve property remapping checks
this is now able to determine which properties were renamed and/or changed when multiple renames occurred in a single version.
This also fixes unrelated properties being considered mapped to each other when there was only one property in the old and new state (e.g. mapped_type and deprecated for hay_bale in 1.10). Now, these are properly considered as unrelated.
2023-06-26 16:09:09 +01:00
Dylan K. Taylor
728e0bc869
tools/generate-blockstate-upgrade-schema: allow multi-ID remaps to be processed as regular states if their ID didn't change
this allows remappedStates to only deal with stuff that has a different ID, which reduced the size of the 1.12 -> 1.13 schema quite nicely.
2023-04-28 20:58:18 +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
769be8e140
Fix CSÂ 2023-04-20 00:18:32 +01:00
Dylan K. Taylor
4147d0dc75
tools/generate-blockstate-upgrade-schema: give better errors when a weird new blockstate version is found 2023-04-19 16:43:29 +01:00
Dylan K. Taylor
8fd4918429
Use Filesystem::fileGetContents() in more places 2022-12-25 18:26:53 +00:00
Dylan K. Taylor
4d79aced07
Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00: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
680615eed8
Namespace rename 2022-06-08 15:54:45 +01:00
Dylan K. Taylor
cf7d42b3ea
Fix CS according to new rules 2022-06-07 20:02:24 +01:00
Dylan K. Taylor
2f2ffe0aa4
fix phpstan 2022-05-13 21:03:49 +01:00
Dylan K. Taylor
45150f1a52
fix CS 2022-02-10 13:47:20 +00:00
Dylan K. Taylor
0f07b2499c
Added blockstate upgrade schema generator 2022-02-10 13:45:39 +00:00