Commit Graph

15305 Commits

Author SHA1 Message Date
bc5a600d59 Added item stack serialize/deserialize methods 2022-06-26 17:02:55 +01:00
3d61345543 Remove ItemFactory::air() 2022-06-25 16:18:35 +01:00
b56d049103 Updated BlockFactory consistency check 2022-06-25 16:12:15 +01:00
27d7672273 Item frames can now be placed on the up or down faces of blocks 2022-06-25 16:10:39 +01:00
db8bf672f0 fix item frames 2022-06-25 16:10:06 +01:00
f57e02849a Wall: move function for consistency 2022-06-25 16:01:11 +01:00
03fdbd9f7b fix CS 2022-06-25 15:59:52 +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
b9542b4908 ItemFactory: fix isRegistered() again
we really need to get rid of the ItemFactory legacy nasties so we can burn this code
2022-06-25 15:52:43 +01:00
00b4e4016c Obliterate BlockLegacyIds 2022-06-25 14:42:32 +01:00
cac72d73fb ItemFactoryTest: remove bogus test case 2022-06-25 14:34:19 +01:00
b268818eda ItemFactory: fixed bogus usage of BlockFactory::isRegistered()
ItemFactory IDs don't necessarily correspond to BlockFactory ones anymore.
2022-06-25 14:02:55 +01:00
e3a9324e8d Updated BlockFactory tests to avoid BlockFactory::get() (which is getting ready to die) 2022-06-24 23:44:55 +01:00
8e002fc1ca BlockTest: fixed unintentional use of global BlockFactory 2022-06-24 23:41:13 +01:00
61da920db0 Fixed consistency check 2022-06-24 23:33:18 +01:00
1bce583cf3 Removed BlockIdentifierFlattened
this was necessary to inform BlockFactory of how to map blocks with multiple IDs; this is no longer necessary under the revamped system
2022-06-24 23:31:05 +01:00
5f7521027e FlowerPot: remove usage of legacy variant 2022-06-24 23:24:03 +01:00
f24f2d9ca9 Hit block legacy metadata with the biggest nuke you've ever seen
This commit completely revamps the way that blocks are represented in memory at runtime.

Instead of being represented by legacy Mojang block IDs and metadata, which are dated, limited and unchangeable, we now use custom PM block IDs, which are generated from VanillaBlocks.
This means we have full control of how they are assigned, which opens the doors to finally addressing inconsistencies like glazed terracotta, stripped logs handling, etc.

To represent state, BlockDataReader and BlockDataWriter have been introduced, and are used by blocks with state information to pack said information into a binary form that can be stored on a chunk at runtime.
Conceptually it's pretty similar to legacy metadata, but the actual format shares no resemblance whatsoever to legacy metadata, and is fully controlled by PM.
This means that the 'state data' may change in serialization format at any time, so it should **NOT** be stored on disk or in a config.

In the future, this will be improved using more auto-generated code and attributes, instead of hand-baked decodeState() and encodeState(). For now, this opens the gateway to a significant expansion of features.
It's not ideal, but it's a big step forwards.
2022-06-24 23:19:37 +01:00
be2fe160b3 Throw a more specific exception on unknown block IDs 2022-06-24 22:52:48 +01:00
8b80c70b9c Merge branch 'next-major' into modern-world-support 2022-06-24 01:41:47 +01:00
9cc24c2c39 Merge branch 'next-minor' into next-major 2022-06-24 01:40:50 +01:00
63ee03a7be Merge branch 'stable' into next-minor 2022-06-24 01:40:39 +01:00
df2d1fd4f9 of course there were two bugs on one line ... 2022-06-24 01:40:26 +01:00
04b855235a Merge branch 'next-major' into modern-world-support 2022-06-24 01:35:46 +01:00
72d8b54188 Merge branch 'next-minor' into next-major 2022-06-24 01:33:15 +01:00
088a2e478c Merge branch 'stable' into next-minor 2022-06-24 01:32:53 +01:00
9f65fb5f90 Fixed top-side skulls with no-drop flag set being treated as unknown blocks 2022-06-24 01:31:11 +01:00
1c689b10b9 ItemSerializer: fixed item NBT being discarded
I'm still not sure on the wisdom of allowing NBT usage in here ...
2022-06-23 21:29:52 +01:00
82f9a25d88 Fix PHPStan 2022-06-23 21:24:09 +01:00
8822bdbefa Fix CS 2022-06-23 21:22:52 +01:00
21cf3813be Add extra interfaces to make it easier to get at the actual blockstate serializer/deserializer
this still is a pain the ass, but it's much less so than before.
2022-06-23 20:01:19 +01:00
adf8a61814 BlockStateToBlockObjectDeserializer: make map() public
this allows plugins to implement their own blocks using this deserializer.
2022-06-23 19:40:11 +01:00
6964012464 fix a bunch of bugs 2022-06-23 19:34:08 +01:00
5ed75731f2 First (untested) look at hooking all the itemstack serializer/deserializer stuff together
this should address #5063 and related issues, if it works correctly.
2022-06-23 19:02:16 +01:00
d8bba6ed3d git add -p bites again 2022-06-23 16:55:50 +01:00
0da174842e Fix build 2022-06-23 16:46:09 +01:00
1533fcf8f6 Separate block legacy data upgrading from block deserialization
this commit provides a central place where all block data can go to be upgraded to the latest version (currently 1.19), irrespective of how old it is.

Previously I had issues during debugging, because it wasn't possible to just upgrade a block without deserializing it into a Block object, which isn't currently supported for many blocks.
This commit solves that problem by separating the upgrading from the deserialization.
2022-06-23 16:45:02 +01:00
caa4b78a3f Update composer dependencies 2022-06-21 20:21:02 +01:00
14352a05bc reword support bot message 2022-06-11 15:54:44 +01:00
bb5b52d998 Player: fix terrain getting redrawn when moving in noclip mode 2022-06-09 13:48:29 +01:00
301b0aba82 Allow Item (de)serializer to accept dynamic BlockState(De)Serializer 2022-06-08 16:22:35 +01:00
c8e318df8c phpstorm stoobid 2022-06-08 16:21:32 +01:00
4aa1a3da8b Moving more stuff around 2022-06-08 15:57:02 +01:00
680615eed8 Namespace rename 2022-06-08 15:54:45 +01:00
1da6202e6e Update composer dependencies 2022-06-08 15:28:37 +01:00
5e22b70b6d this is a joke ... 2022-06-08 14:56:25 +01:00
831738b29c Added BedrockItemUpgradeSchema dependency 2022-06-08 14:53:58 +01:00
e78f20391e seriously? ... 2022-06-08 14:21:57 +01:00
0a22e4606d Wow, I'm really getting sloppy... 2022-06-08 13:51:15 +01:00
02513818a9 4.5.2 is next 2022-06-08 02:50:34 +01:00