Commit Graph

464 Commits

Author SHA1 Message Date
Dylan K. Taylor
e31fd122d9 BlockStateReader: micro optimize unread properties check
this has a pretty much insignificant performance impact, but reduces the cost of this check to basically 0.
2024-03-14 17:54:26 +00:00
Dylan K. Taylor
a835069564 Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-14 12:47:04 +00:00
Dylan K. Taylor
7ff0ae19d6 BlockStateUpgrader: a simple yet hard-to-explain optimization
Prior to this commit, upgrade schemas would be applied to blockstates with the same version, as there wasn't any way to know if they should be applied or not given Mojang's tendency to forget to bump the version.
However, it occurred to me that we only need to do this if there are multiple schemas present for the same version ID, which is rarely the case.
This allows skipping costly logic for blockstates on the newest version (the common case), reducing the time taken to process the blockstate for upgrading by over 30%.
Overall, this translates into less than 10% real performance improvement for chunk loading, but it's still a worthwhile improvement.
2024-03-13 18:19:51 +00:00
Dylan K. Taylor
c11c0679e3 Fix CS 2024-03-13 14:55:54 +00:00
Dylan K. Taylor
ba48f258f3 Support for 1.20.70 2024-03-13 14:53:27 +00:00
Dylan K. Taylor
a6202d0442 BlockStateUpgrader: calculate output version ID in a less stupid way
this improves the performance by a conservative 10%.
2024-03-12 11:48:48 +00:00
Dylan K. Taylor
8ec304e66e BlockStateUpgradeSchema: avoid unnecessary property access and calculation
this was costing a surprisingly large 5-10% of the processing time for blockstate data.
2024-03-12 11:45:08 +00:00
Dylan K. Taylor
ac8dbf8640 BlockStateUpgrader: extract state remap to its own function 2024-03-06 12:56:49 +00:00
Dylan K. Taylor
98042f844f Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-28 17:36:21 +00:00
Dylan K. Taylor
db665fefdb Harden JsonMapper defaults in general 2024-02-23 14:10:24 +00:00
IvanCraft623
920341668f Implemented working Name tag (#5209) 2024-02-19 18:46:48 +00:00
Dylan K. Taylor
2616d8c5ad New biome IDs, courtesy of build/generate-biome-ids 2024-02-19 16:10:46 +00:00
Dylan K. Taylor
d211392b67 Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-12 11:46:48 +00:00
Dylan K. Taylor
fe06bfcda0 Import alias cleanup courtesy of newest php-cs-fixer 2024-02-07 12:50:37 +00:00
Dylan K. Taylor
6492e7f4a2 1.20.60 support 2024-02-07 12:33:44 +00:00
Dylan K. Taylor
57f3a04bc5 data: Use statically analyzable ways of ensuring all cases are registered
PHPStan will verify that these matches cover all cases, which guarantees that all cases will be covered.
In addition, if PHPStan is not used, the constructors will immediately bail out when they hit a case that isn't covered.
The only downside is the extra indentation :(
2023-12-20 16:07:05 +00:00
Dylan K. Taylor
8dc28b7ea8 RuntimeDataDescriber: remove useless template parameter 2023-12-20 15:15:43 +00:00
Dylan K. Taylor
06b2e61d3c Merge remote-tracking branch 'origin/stable' into minor-next 2023-12-14 14:02:15 +00:00
Dylan K. Taylor
25cca1b63f Changes for 1.20.50 2023-12-06 14:29:23 +00:00
ace
d596dc571d Fix pitcher pod wrongly registered as a block (#6162) 2023-11-27 14:46:20 +00:00
Dylan K. Taylor
50592dc269 Merge branch 'stable' into minor-next 2023-11-09 18:05:38 +00:00
pandaa-be
4103631bc1 Added Smithing Template items (#6132) 2023-11-09 14:25:49 +00:00
Dylan K. Taylor
5f3a2a5096 BlockStateUpgrader: fixed undefined array key when flattening a block whose new ID is the same as the old
this came up during 1.20.50 testing, where minecraft:stone[stone_type=stone] continues to have an ID minecraft:stone without the stone_type property.
This could have appeared in other ways, such as with an invalid legacy blockstate.
2023-11-08 18:52:22 +00:00
Dylan K. Taylor
b41960dfec Merge branch 'stable' into minor-next 2023-10-26 12:55:47 +01:00
Dylan K. Taylor
53a740433f Changes for 1.20.40 2023-10-26 12:32:59 +01:00
Dylan K. Taylor
d0d16cdeb7 RuntimeDataDescriber: Introduce boundedIntAuto, replacing boundedInt
closes #6096
boundedIntAuto automatically calculates the correct number of bits to use based on the given bounds. The bounds must be constant, of course.
2023-10-17 12:03:43 +01:00
Dylan K. Taylor
628d77f8d7 Implemented pitcher plants, crops and pods 2023-09-29 12:30:52 +01:00
Dylan K. Taylor
31cd096b4b Implement torchflower, its seeds and its crop 2023-09-28 17:13:33 +01:00
Dylan K. Taylor
78cc5ba635 CS again 2023-09-28 16:06:38 +01:00
Dylan K. Taylor
4b9d170954 RuntimeDataDescriber: added dynamic method for reading and writing enum sets
this was previously only needed for brewing stands, but it's now become needed for chiselled bookshelves too.
2023-09-28 16:06:17 +01:00
HimmelKreis4865
d94391af57 Implement Chiseled Bookshelf (#5827) 2023-09-28 15:56:46 +01:00
Dylan K. Taylor
56d7039086 Implemented budding amethyst and amethyst clusters 2023-09-27 17:02:37 +01:00
Dylan K. Taylor
6ec340359b Implemented crimson and warped roots 2023-09-27 13:07:46 +01:00
Dylan K. Taylor
fe3e2cc90a Merge branch 'stable' into minor-next 2023-09-20 19:14:34 +01:00
Dylan K. Taylor
6553852d99 Updated for 1.20.30 release 2023-09-20 18:34:12 +01:00
Dylan K. Taylor
7ce33d9375 Migrate final remaining EnumTrait users to native enums 2023-09-08 10:34:12 +01:00
Dylan T
7dcd2592d4 RuntimeDataDescriber: Support dynamically describing arbitrary enums (#6039)
Previously, we were using codegen to support describing a fixed set of enums.

Instead, we implement an enum() function, allowing any native PHP enum to be described.
All enums used in runtime data have been migrated to native PHP 8.1 enums in minor-next to facilitate this.

This implementation:

- is faster (in extreme cases by 40x, such as with PotionType)
- requires way less code
- does not require a build step
- is way more flexible

This fixes #5877, increasing the range of stuff that plugins are now able to do.

EnumTrait enums are not supported, as it's easier and cleaner to just support native enums. Most core EnumTrait enums have been migrated to native enums by now to facilitate this.
2023-09-07 20:07:14 +01:00
Dylan K. Taylor
6887fcd590 RuntimeEnum(De)SerializerTrait no longer uses legacy accessors for enum members 2023-09-07 19:40:14 +01:00
Dylan K. Taylor
c168818311 missed one 2023-09-07 19:39:13 +01:00
Dylan K. Taylor
94d98fb5c4 Migrate all but two remaining legacy enums to native PHP 8.1 enums 2023-09-07 19:32:45 +01:00
Dylan K. Taylor
ae564e445d Start migrating EnumTrait enums to PHP 8.1 native enums 2023-09-07 17:20:52 +01:00
Dylan K. Taylor
506d8d1064 CS 2023-08-25 12:49:56 +01:00
Dylan K. Taylor
b56f1b679e Deduplicate a bunch of repeated type ID map code 2023-08-25 12:30:54 +01:00
S3v3Nice
39867b97c5 Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
ipad54
77dfbc4e23 Implemented pink petals (#5940) 2023-08-09 11:33:33 +01:00
ipad54
83d11c7429 Implemented Big & Small dripleaf (#5835) 2023-07-17 16:30:52 +01:00
ShockedPlot7560
fb6a7d279f Implement fortune enchantment (#5757) 2023-07-17 11:13:45 +01:00
Dylan K. Taylor
dca752c72f Stem: implement facing property
fixes #5858

technically speaking, the sideways states for non-fully-grown stems shouldn't exist, but they do in Bedrock, and changing this code to split non-fully-grown stems from fully grown ones would likely require BC breaks.
This was the minimum necessary to achieve the desired functionality.
2023-07-13 14:50:26 +01:00
ace
7132ac0ad3 Implemented strong slowness potion (#5888) 2023-07-13 13:22:01 +01:00
Dylan K. Taylor
b7210755a7 1.20.10 2023-07-12 13:39:39 +01:00