McRegion: nbtDeserialize() cannot return null

This commit is contained in:
Dylan K. Taylor 2018-06-11 15:05:38 +01:00
parent 07a156f5c4
commit ff2e99ecdc
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ class Anvil extends McRegion{
]);
}
protected function nbtDeserialize(string $data){
protected function nbtDeserialize(string $data) : Chunk{
$nbt = new BigEndianNBTStream();
$chunk = $nbt->readCompressed($data);
if(!($chunk instanceof CompoundTag) or !$chunk->hasTag("Level")){

View File

@ -107,9 +107,9 @@ class McRegion extends BaseLevelProvider{
/**
* @param string $data
*
* @return Chunk|null
* @return Chunk
*/
protected function nbtDeserialize(string $data){
protected function nbtDeserialize(string $data) : Chunk{
$nbt = new BigEndianNBTStream();
$chunk = $nbt->readCompressed($data);
if(!($chunk instanceof CompoundTag) or !$chunk->hasTag("Level")){