Commit Graph

15334 Commits

Author SHA1 Message Date
cab56b0479 fix PHPStan 2022-06-29 17:18:44 +01:00
ff96f1b93c CreativeInventory: do not disable meta comparison for durable items
this check no longer applies, and it's usually undesirable to avoid comparing meta in every other case.
2022-06-29 16:58:52 +01:00
09c1e161e0 Fix merge error 2022-06-29 16:54:57 +01:00
66c09fdc3b Merge branch 'next-major' into modern-world-support 2022-06-29 16:54:15 +01:00
4d9f2bc9b1 Merge branch 'next-minor' into next-major 2022-06-29 16:53:50 +01:00
38651fde74 Merge branch 'stable' into next-minor 2022-06-29 16:53:31 +01:00
de917afc6f Fix CS 2022-06-29 16:11:46 +01:00
5e4e5147d9 Remove ItemFactory involvement from brewing
this involves a very nasty hack for potion container change, but for the time being it can't be helped.
2022-06-29 16:11:15 +01:00
8831dff61b Leaves: remove ItemFactory dependency
this is ugly, but it should only be temporary while we liberate the core from legacy nastiness.
Once the liberation is complete, we'll be able to do a lot of cool stuff like making wood types dynamic.
2022-06-29 16:09:55 +01:00
83c46a4b54 LegacyStringToItemParser: remove bogus test
this test is obsolete since ea3d5ac563, since durable items no longer use meta to represent damage.
2022-06-29 15:26:56 +01:00
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
ce6b09291a LegacyStringToItemParser: bypass ItemFactory, use GlobalItemDataHandlers directly 2022-06-29 15:18:11 +01:00
2cb722b674 Fixed durability handling (ish) 2022-06-29 15:17:16 +01:00
784d602600 Fixed ItemBreakParticle using untranslated internal ID/meta for network data
this caused it to display particles for incorrect items. It may also have been possibly responsible for client crashes.
2022-06-29 14:01:39 +01:00
dd63681f94 Assign auto-generated runtime type IDs to all items 2022-06-29 13:50:58 +01:00
15c99cfe77 4.5.3 is next 2022-06-29 02:18:50 +01:00
d5fa0a2fc5 Release 4.5.2 4.5.2 2022-06-29 02:18:50 +01:00
0da9260994 Updated composer dependencies 2022-06-29 02:13:32 +01:00
56428e8a4e Make more item stuff dynamic 2022-06-29 00:26:16 +01:00
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
c0e178c19c fix CS 2022-06-27 17:15:16 +01:00
541a624d48 ItemFactory::get() now consistently throws SavedDataLoadingException on any error, including unknown items 2022-06-27 17:14:43 +01:00
2fd9b751b6 Log: remove dead code 2022-06-27 16:26:53 +01:00
7deee31502 Block: make decodeStateData() and computeStateData() final 2022-06-27 15:40:39 +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
bedc9cf518 Item::jsonDeserialize(): remove bogus phpdoc (we don't actually know if this is even valid) 2022-06-27 14:30:12 +01:00
b61a934c9f CraftingManagerFromDataHelper: fixed recipes with unknown items being registered without said items 2022-06-27 14:23:14 +01:00
65ed7d7794 Remove Item::hasAnyDamageValue() 2022-06-27 13:35:43 +01:00
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
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