33 Commits

Author SHA1 Message Date
Dylan K. Taylor
9621836e36
Clean up confusing mess around block and item overriding
right now, I don't see an obvious reason to do this. If it turns out I was wrong later on, we can add functionality back, but we can't remove functionality after release.
2023-05-17 15:21:49 +01:00
Dylan K. Taylor
ecd8f151f1
Merge branch 'next-minor' into next-major 2023-01-12 22:08:25 +00:00
Dylan K. Taylor
7fd4c12ea1
First look at (mostly) unified item serializer registrar
this halves the amount of code needed to implement most items.
2022-08-27 15:10:55 +01:00
IvanCraft623
b65e0f64f6
Implement Suspicious Stew (#5224) 2022-08-16 17:26:32 +01:00
IvanCraft623
223de3ad23
Implement Fire Charge (#5225) 2022-08-15 17:00:58 +01:00
Dylan T
c1acf44337
Implement cauldrons (#5163)
the following things are currently not implemented:

- particle/sound effects when an entity extinguishes itself
- particle/sound effects when mixing different stuff in a cauldron
- powder snow cauldron

both of these things are contingent on #5169, but for the time being, the PR is functionally complete and I want to move on to something else without being stalled by the particle+sound problem (which I haven't yet decided how to solve).
2022-07-20 16:12:58 +01:00
Dylan K. Taylor
ba2baba7cc
Added netherite blocks and items 2022-07-14 20:39:09 +01:00
Dylan K. Taylor
323d31005f
Added glowing item frames 2022-07-14 16:24:20 +01:00
Dylan K. Taylor
da9937933b
Implemented honey bottle 2022-07-07 01:06:17 +01:00
Dylan K. Taylor
3c017af6a0
Added a handful of new easy items 2022-07-05 16:46:57 +01:00
Dylan K. Taylor
412dcaa744
Implemented crimson, warped and mangrove signs 2022-07-05 16:18:54 +01:00
Dylan K. Taylor
e44a291697
Rename ItemTypeIds -> ItemTypeNames for consistency's sake 2022-07-04 15:46:24 +01:00
Dylan K. Taylor
dd615c775d
Added various blocks made from mangrove, crimson and warped wood 2022-07-03 19:01:34 +01:00
Dylan K. Taylor
db9c7de35c
Remove obsolete shim items for Bed and Skull
now that the colour and skull type are included in the block type data, it's no longer necessary to maintain shim items to retain this information in the item data.
2022-07-03 00:47:42 +01:00
Dylan K. Taylor
56428e8a4e
Make more item stuff dynamic 2022-06-29 00:26:16 +01:00
Dylan K. Taylor
6058032807
Make potion types dynamic
It became obvious this was needed when I wanted to make new IDs for existing items - there's no way I'm unrolling those registrations...
2022-06-28 23:33:25 +01:00
Dylan K. Taylor
55cb68e5b5
Burn meta wildcards from Item, allow more dynamic recipe inputs
this was an obstacle for getting rid of legacy item IDs.
2022-06-27 13:33:26 +01:00
Dylan K. Taylor
bc5a600d59
Added item stack serialize/deserialize methods 2022-06-26 17:02:55 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
0da174842e
Fix build 2022-06-23 16:46:09 +01:00
Dylan K. Taylor
301b0aba82
Allow Item (de)serializer to accept dynamic BlockState(De)Serializer 2022-06-08 16:22:35 +01:00
Dylan K. Taylor
4aa1a3da8b
Moving more stuff around 2022-06-08 15:57:02 +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
86e7ae341f
ItemSerializer: Prohibit serializing recipe input wildcards 2022-06-06 20:48:44 +01:00
Dylan K. Taylor
81b51c0791
fixing special block serialization 2022-05-24 21:29:20 +01:00
Dylan K. Taylor
d8dc32ec4b
PhpStorm sucks
I'm very sure I enabled 'Ensure every file ends with a line break' ...
2022-05-24 15:22:23 +01:00
Dylan K. Taylor
81eafde074
Hacks for banners and coral fans 2022-05-24 15:07:38 +01:00
Dylan K. Taylor
5ce5e1d2b0
Throw proper exceptions for serialize/deserialize failures
this allows them to be caught and properly reported in tests.
2022-05-24 14:46:18 +01:00
Dylan K. Taylor
e27f80fd85
Remove unused code 2022-05-12 21:06:33 +01:00
Dylan K. Taylor
107b0e1728
CS again, kill me 2022-05-12 16:35:12 +01:00
Dylan K. Taylor
cb97f37d13
First look at modern-spec serializer/deserializer for items
this is not yet used by anything
2022-05-12 16:26:38 +01:00