mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
RegionWorldProvider: Show a more specific message on missing required ByteArrayTags
This commit is contained in:
parent
020cd7b966
commit
fb0eebc0dc
@ -173,6 +173,9 @@ abstract class RegionWorldProvider extends BaseWorldProvider{
|
|||||||
protected static function readFixedSizeByteArray(CompoundTag $chunk, string $tagName, int $length) : string{
|
protected static function readFixedSizeByteArray(CompoundTag $chunk, string $tagName, int $length) : string{
|
||||||
$tag = $chunk->getTag($tagName);
|
$tag = $chunk->getTag($tagName);
|
||||||
if(!($tag instanceof ByteArrayTag)){
|
if(!($tag instanceof ByteArrayTag)){
|
||||||
|
if($tag === null){
|
||||||
|
throw new CorruptedChunkException("'$tagName' key is missing from chunk NBT");
|
||||||
|
}
|
||||||
throw new CorruptedChunkException("Expected TAG_ByteArray for '$tagName'");
|
throw new CorruptedChunkException("Expected TAG_ByteArray for '$tagName'");
|
||||||
}
|
}
|
||||||
$data = $tag->getValue();
|
$data = $tag->getValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user