Commit Graph

362 Commits

Author SHA1 Message Date
Dylan K. Taylor
ae70c63798 Added tinted glass 2022-07-06 23:01:17 +01:00
Dylan K. Taylor
986daab511 ItemFactory: remove dead TODO comment 2022-07-06 22:25:17 +01:00
Dylan K. Taylor
d40e864821 Item: update documentation of legacyJsonDeserialize() 2022-07-06 21:15:27 +01:00
Dylan K. Taylor
46b79fbe85 StringToItemParser: fixed light_15 and light_block_15 aliases being missing 2022-07-06 14:11:33 +01:00
ipad54
64e93ae4e1 Fixed spyglass using animation (#5137) 2022-07-06 14:02:43 +01:00
Dylan K. Taylor
fe93609c8d Added mud bricks and related blocks 2022-07-06 00:02:51 +01:00
Dylan K. Taylor
d725ded7b6 Added new ores 2022-07-05 21:43:47 +01:00
Dylan K. Taylor
a8dae96bb0 register honeycomb blocks properly 2022-07-05 21:03:27 +01:00
Alexey
a005cd6e33 Set the correct max stack size for spyglass (#5133) 2022-07-05 20:43:46 +01:00
Dylan K. Taylor
a42bb9626d Added another handful of blocks
clearing out my workspace...
2022-07-05 20:42:22 +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
68cbe46600 Exterminate legacy item IDs 2022-07-05 15:12:55 +01:00
Dylan K. Taylor
4e71cc7d79 Remove ItemFactory::get(), use ItemFactory::fromTypeId() for VanillaItems
soon we'll invert the dependency and set up all this stuff in VanillaItems directly, rendering ItemFactory (mostly) unnecessary.
2022-07-05 14:26:02 +01:00
Dylan K. Taylor
1714e2fd35 CoralFan: fixed coralType not being initialized 2022-07-05 14:07:34 +01:00
Dylan K. Taylor
0a23e91329 Rename BlockFactory::fromFullBlock() -> BlockFactory::fromStateId() 2022-07-05 13:46:19 +01:00
Dylan K. Taylor
bd773c2f84 VanillaBlocks: use BlockFactory::fromTypeId() 2022-07-05 13:40:07 +01:00
Dylan K. Taylor
59c5770cf2 Durable: do not write Damage tag if damage is zero
fixes creative inventory getting borked to hell
2022-07-04 20:11:39 +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
e302e5a85f Implemented chiseled deepslate, chiseled nether brick and cracked nether brick 2022-07-03 03:04:06 +01:00
Dylan K. Taylor
4acf7aadbd Added quartz bricks 2022-07-03 02:11:50 +01:00
Dylan K. Taylor
a3016abf53 Added polished deepslate block/slab/stair/wall 2022-07-03 02:00:43 +01:00
Dylan K. Taylor
89632f3514 Added deepslate, cobbled/tiles/bricks walls/slabs/stairs/cubes 2022-07-03 01:43:27 +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
3f937605ac Added calcite 2022-07-02 23:54:51 +01:00
Dylan K. Taylor
0e0b858b69 Added raw copper, gold and iron blocks 2022-07-02 23:17:10 +01:00
Dylan K. Taylor
2a0fade893 Implemented Light blocks 2022-07-02 22:39:11 +01:00
Dylan K. Taylor
172214386a Added a batch of simple blocks from 1.16 and 1.17 2022-07-02 21:53:59 +01:00
Dylan K. Taylor
b661c94915 StringToItemParser: added glazed_terracotta alias 2022-07-02 21:34:20 +01:00
Dylan K. Taylor
ff90c83d66 Implemented log stripping via axe right-click 2022-07-02 19:16:15 +01:00
Dylan K. Taylor
248eacd042 GlazedTerracotta: make colour dynamic, like all other coloured blocks
made possible by stripping out legacy mess
2022-07-02 18:30:23 +01:00
Dylan K. Taylor
323c563684 Break Block's dependence on ItemFactory, and item legacy IDs
let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
2022-07-02 17:29:28 +01:00
Dylan K. Taylor
db2b523762 Item is no longer JsonSerializable
before anyone starts screaming:

1) it's easy to create your own wrapper that converts items to arrays
2) there is no longer a single standard way to encode items.
3) the way that item serialization now works requires an ItemSerializer, which, barring singleton use, must be dependency-injected. Since there's no way to inject dependencies into jsonSerialize(), this means that its behaviour cannot be customized.
2022-06-30 19:16:49 +01:00
Dylan K. Taylor
de917afc6f Fix CS 2022-06-29 16:11:46 +01:00
Dylan K. Taylor
ea3d5ac563 LegacyStringToItemParser: use string IDs directly
this allows plugins to add their own mappings (though they should really be using StringToItemParser) without needing any legacy numeric ID bullshit in the mix.
2022-06-29 15:25:50 +01:00
Dylan K. Taylor
ce6b09291a LegacyStringToItemParser: bypass ItemFactory, use GlobalItemDataHandlers directly 2022-06-29 15:18:11 +01:00
Dylan K. Taylor
2cb722b674 Fixed durability handling (ish) 2022-06-29 15:17:16 +01:00
Dylan K. Taylor
dd63681f94 Assign auto-generated runtime type IDs to all items 2022-06-29 13:50:58 +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
541a624d48 ItemFactory::get() now consistently throws SavedDataLoadingException on any error, including unknown items 2022-06-27 17:14:43 +01:00
Dylan K. Taylor
bedc9cf518 Item::jsonDeserialize(): remove bogus phpdoc (we don't actually know if this is even valid) 2022-06-27 14:30:12 +01:00
Dylan K. Taylor
65ed7d7794 Remove Item::hasAnyDamageValue() 2022-06-27 13:35:43 +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
3d61345543 Remove ItemFactory::air() 2022-06-25 16:18:35 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
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
6964012464 fix a bunch of bugs 2022-06-23 19:34:08 +01:00