ae564e445d
Start migrating EnumTrait enums to PHP 8.1 native enums
2023-09-07 17:20:52 +01:00
fe94379a93
Fixed connection requirements for fences, glass, bars and walls
...
these connect to the back faces of stairs and to glass, for example.
2023-09-06 12:56:47 +01:00
015c668885
Change confusing 'type data' and 'state data' terminology for blocks and items
...
For blocks, we now use 'block-item state' and 'block-only state', which should be much clearer for people implementing custom stuff.
'block-item state', as the name suggests, sticks to the item when the block is acquired as an item.
'block-only state' applies only to the block and is discarded when the block is acquired as an item.
'type data' for items was also renamed, since 'type' is too ambiguous to be anything but super confusing.
2023-05-16 14:07:29 +01:00
7c974a12e1
Revert "ItemBlock: drop the charade about overriding built-in block types"
...
This reverts commit f64dc01bd1
.
I forgot that the ItemBlock constructor implicitly strips off any states
of the origin block, which is something that we unfortunately can't do
any other way right now, since the blocks don't remember their default
states.
2023-03-02 15:51:55 +00:00
f64dc01bd1
ItemBlock: drop the charade about overriding built-in block types
...
this allows cleaning up a whole lot of abusable mess from the API, and we never properly supported overriding built-in block types anyway.
2023-03-02 15:50:18 +00:00
55a48e0c84
Block: specifying required type/state data bits is no longer required
...
RuntimeDataSizeCalculator allows calculating the number of required bits from describeType directly, which considerably reduces boilerplate code.
2023-02-16 16:45:19 +00:00
c2f6d8139a
Added interface RuntimeDataDescriber
2023-02-16 16:23:32 +00:00
ecd8f151f1
Merge branch 'next-minor' into next-major
2023-01-12 22:08:25 +00:00
5021096bdd
Fixed walls and thin blocks not connecting to each other
...
closes #5498
2023-01-09 20:46:57 +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
325f1cf82e
Generalize runtime block data serialization
...
we want to reuse this code for item type data
2022-07-05 14:13:37 +01:00
3792ef5a50
Move blockstate data runtime serialization to a more appropriate package
2022-07-02 16:48:41 +01:00
0afb67be7d
Improve BlockFactory initialization performance
...
as expected, expanding data range unconditionally resulted in some performance issues ...
2022-06-27 15:37:05 +01:00
f57e02849a
Wall: move function for consistency
2022-06-25 16:01:11 +01:00
1da4c45979
Add runtime support for wall connections
...
this doesn't match the 1.16+ behaviour yet, but it at least recognizes walls that are already in the post-1.16 way and doesn't break them if not interacted with.
2022-06-25 15:59:38 +01:00
1ff69136a3
Merge branch 'next-major' into modern-world-support
2022-06-07 20:01:40 +01:00
d2613039ed
Replace BlockLegacyIds usages with BlockTypeIds where possible
2022-06-05 21:17:10 +01:00
38d6284671
Use PHP-CS-Fixer to enforce file header presence
2022-06-04 17:34:49 +01:00
f67104c81e
Merge branch 'next-major' into modern-world-support
2022-05-20 17:50:38 +01:00
6482aa7c64
Block: introduce logic for face support types ( #4886 )
...
fixes #4856
fixes #458
fixes #4529
fixes #3299
Added API method Block::getSupportType(Facing) : SupportType
Added SupportType enum
fixes torch, lantern, door etc. placement on slabs and upside-down stairs
2022-05-20 15:18:34 +01:00
9f4418e01d
Wall: separate connection calculation into its own method
...
we'll need this once wall connections start actually being stored instead of just being recalculated on every read.
2022-03-24 12:52:51 +00:00
79d1feff9c
Replace disallowed operators in src/block/
2022-01-20 16:57:09 +00:00
f68b9e79e1
Use typed properties in block namespace
2021-05-22 23:52:31 +01:00
376d2c4cd4
Consistently declare BlockBreakInfo at the constructor call site
...
instead of inside the class
2021-05-20 22:49:51 +01:00
12087c9850
Wall: use facing as value as well as key in connections
2020-09-26 17:41:00 +01:00
9e3ff21aea
Wall: remove unused import
2020-09-26 17:26:54 +01:00
2b044195a5
Update for pocketmine/math Axis refactor
2020-08-06 14:38:54 +01:00
4898a35613
cleanup block dual bounding box clusterfuck
...
"bounding box" serves no tangible purpose, only collision boxes do right now.
2019-08-15 17:23:55 +01:00
5499ac620c
Removed pocketmine subdirectory, map PSR-4 style
2019-07-30 19:14:57 +01:00