mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
BlockStateData: use array<Tag> instead of CompoundTag to store state properties
this reduces the footprint of RuntimeBlockMapping by a further 1 MB, as well as simplifying various parts of the code, and solidifying the immutability guarantee of BlockStateData.
This commit is contained in:
@ -121,10 +121,11 @@ final class CraftingManagerFromDataHelper{
|
||||
throw new SavedDataLoadingException("Meta should not be specified for blockitems");
|
||||
}
|
||||
$blockStatesTag = $blockStatesRaw === null ?
|
||||
CompoundTag::create() :
|
||||
[] :
|
||||
(new LittleEndianNbtSerializer())
|
||||
->read(ErrorToExceptionHandler::trapAndRemoveFalse(fn() => base64_decode($blockStatesRaw, true)))
|
||||
->mustGetCompoundTag();
|
||||
->mustGetCompoundTag()
|
||||
->getValue();
|
||||
$blockStateData = new BlockStateData($blockName, $blockStatesTag, BlockStateData::CURRENT_VERSION);
|
||||
}else{
|
||||
$blockStateData = null;
|
||||
|
Reference in New Issue
Block a user