15508 Commits

Author SHA1 Message Date
Dylan K. Taylor
b661c94915
StringToItemParser: added glazed_terracotta alias 2022-07-02 21:34:20 +01:00
Dylan K. Taylor
7750f9581a
BlockObjectToBlockStateSerializer: make adding stateless blocks less annoying 2022-07-02 21:03:25 +01:00
Dylan K. Taylor
451971b866
BlockObjectToBlockStateSerializer: make stairs less annoying to implement 2022-07-02 20:57:18 +01:00
Dylan K. Taylor
d49597fe5f
BlockStateToBlockObjectDeserializer: make stairs less annoying to implement 2022-07-02 20:51:31 +01:00
Dylan K. Taylor
bcdbb09c2c
Updated BlockFactory consistency check 2022-07-02 20:19:58 +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
7430e1fbc0
Coral: remove obsolete workaround 2022-07-02 17:51:48 +01:00
Dylan K. Taylor
b125d4d25f
Strip all remaining legacy item ID/meta stuff from blocks
the doors are now finally open, we can:
- make all the wood types dynamic
- fix glazed terracotta
- add all the new blocks

LET'S GOOOOOOOOOOOO
2022-07-02 17:48:11 +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
9740891a2f
Move BlockLegacyMetadata to pocketmine\data package 2022-07-02 17:01:10 +01:00
Dylan K. Taylor
b5914f4587
phpstorm ... 2022-07-02 16:58:28 +01:00
Dylan K. Taylor
3792ef5a50
Move blockstate data runtime serialization to a more appropriate package 2022-07-02 16:48:41 +01:00
Dylan K. Taylor
7994da07be
Crafting recipe network serialization no longer depends on PM's internal legacy metadata
WOOOOOOOOOOOOOOOOOOOOOOHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!
2022-07-02 16:37:43 +01:00
Dylan K. Taylor
8858b16a25
Fucking CS again 2022-06-30 20:18:25 +01:00
Dylan K. Taylor
a64adbfffe
Fix PHPStan errors 2022-06-30 20:16:55 +01:00
Dylan K. Taylor
ba079bd9aa
Avoid implicit ItemFactory reliance for blocks with special items
this hasn't yet been addressed for signs, since they are a bit of a pain in the ass.
2022-06-30 20:00:41 +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
4bd087fc83
Fix CS 2022-06-30 19:09:49 +01:00
Dylan K. Taylor
af8f2c47f3
ShulkerBoxInventory: avoid usage of legacy ItemIds 2022-06-30 19:03:07 +01:00
Dylan K. Taylor
2a0b500010
Block: Separate encoding of type and state data
the terminology of this needs improvement, but...

the basic concept here is that 'type' data will persist on an itemstack, while 'state' data will not.

Type data consists of things like:
- Colour
- Coral type
- Wet/dry (sponges)
- Live/dead (coral)
- Wood type

State data consists of things like:
- Facing
- Axis
- Powered/unpowered
- Open/closed

In the past, with the old system, this information was separated by way of getStateBitmask(). This solution was fraught with problems, but achieved the basic goal: removing unwanted block properties from items.
2022-06-30 18:08:34 +01:00
Dylan K. Taylor
c22a840d27
Update VanillaBlocks:
for some reason some stuff was returned using non-default states
2022-06-30 17:52:07 +01:00
Dylan K. Taylor
f8547ad57c
LegacyStringToItemParserTest: do not rely on the presence of legacy ID and meta in the API 2022-06-30 16:39:50 +01:00
dependabot[bot]
9898577135
Bump phpstan/phpstan from 1.7.15 to 1.8.0 (#5120)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.7.15 to 1.8.0.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.8.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.7.15...1.8.0)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 16:09:03 +01:00
Dylan K. Taylor
cab56b0479
fix PHPStan 2022-06-29 17:18:44 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
09c1e161e0
Fix merge error 2022-06-29 16:54:57 +01:00
Dylan K. Taylor
66c09fdc3b
Merge branch 'next-major' into modern-world-support 2022-06-29 16:54:15 +01:00
Dylan K. Taylor
4d9f2bc9b1
Merge branch 'next-minor' into next-major 2022-06-29 16:53:50 +01:00
Dylan K. Taylor
38651fde74
Merge branch 'stable' into next-minor 2022-06-29 16:53:31 +01:00
Dylan K. Taylor
de917afc6f
Fix CS 2022-06-29 16:11:46 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
83c46a4b54
LegacyStringToItemParser: remove bogus test
this test is obsolete since ea3d5ac5630f57b9cec46771001ab83bb0ddec25, since durable items no longer use meta to represent damage.
2022-06-29 15:26:56 +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
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
Dylan K. Taylor
dd63681f94
Assign auto-generated runtime type IDs to all items 2022-06-29 13:50:58 +01:00
Dylan K. Taylor
15c99cfe77
4.5.3 is next 2022-06-29 02:18:50 +01:00
Dylan K. Taylor
d5fa0a2fc5
Release 4.5.2 4.5.2 2022-06-29 02:18:50 +01:00
Dylan K. Taylor
0da9260994
Updated composer dependencies 2022-06-29 02:13:32 +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
c0e178c19c
fix CS 2022-06-27 17:15:16 +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
2fd9b751b6
Log: remove dead code 2022-06-27 16:26:53 +01:00
Dylan K. Taylor
7deee31502
Block: make decodeStateData() and computeStateData() final 2022-06-27 15:40:39 +01:00
Dylan K. Taylor
0afb67be7d
Improve BlockFactory initialization performance
as expected, expanding data range unconditionally resulted in some performance issues ...
2022-06-27 15:37:05 +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