Commit Graph

21 Commits

Author SHA1 Message Date
6aaf6b336a Make an enum for horizontal facing blocks
awkward that the interface is also called HorizontalFacing, so I had to improvise for the naming
2025-08-29 23:11:17 +01:00
6f6b23d4e4 Integrate dev-major-next version of pocketmine/math
this is a reduced version compared to the original, due to the difficulty of getting rid of Facing values internally.
2025-08-29 21:47:20 +01:00
3e69ee87e4 Remove deprecated stuff
except Permission subscriptions; turns out we still need those
perhaps they should be marked @internal
2024-12-19 00:14:18 +00:00
d565be93a8 Merge branch 'minor-next' into major-next 2023-10-24 11:57:30 +01:00
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
d4d7d02067 Merge branch 'minor-next' into major-next 2023-10-16 21:29:11 +01:00
78cc5ba635 CS again 2023-09-28 16:06:38 +01:00
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
d94391af57 Implement Chiseled Bookshelf (#5827) 2023-09-28 15:56:46 +01:00
89f42c80d4 Strip out deprecated stuff 2023-09-07 20:26:04 +01:00
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
ae564e445d Start migrating EnumTrait enums to PHP 8.1 native enums 2023-09-07 17:20:52 +01:00
6d7f44d8fe Implement glow lichen (#5401) 2023-06-04 16:04:08 +01:00
b9d62de29d Pack wall connections into 7 bits for runtime data encoding 2023-03-04 15:47:34 +00:00
c2f6d8139a Added interface RuntimeDataDescriber 2023-02-16 16:23:32 +00:00
6d4279671e A giant hack to cut down code needed for runtime block serialization by 50%
this also avoids repeated information and inconsistencies.
2022-07-18 18:25:41 +01:00
cf34f88a67 Make Block::decodeState() and encodeState() more codegen-friendly 2022-07-18 15:48:03 +01:00
8660dfe576 Generate traits for runtime enum serialization instead of helper classes 2022-07-18 15:16:33 +01:00
07786dc4bc RuntimeDataWriter: fixed doc comment 2022-07-14 22:51:12 +01:00
8b2d941502 Offset integer ranges in runtime block data serialization
this is useful for stuff like snow layers where the range doesn't start at 0.
2022-07-13 19:49:30 +01:00
325f1cf82e Generalize runtime block data serialization
we want to reuse this code for item type data
2022-07-05 14:13:37 +01:00