mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user