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.
This commit is contained in:
Dylan K. Taylor
2022-06-30 19:16:20 +01:00
parent 4bd087fc83
commit db2b523762
3 changed files with 26 additions and 33 deletions

View File

@ -41,7 +41,7 @@ final class CreativeInventory{
foreach($creativeItems as $data){
try{
$item = Item::jsonDeserialize($data);
$item = Item::legacyJsonDeserialize($data);
}catch(SavedDataLoadingException){
//unknown item
continue;