replacing new Vector3(0, 0, 0) with Vector3::zero() (#5640)

This commit is contained in:
João
2023-03-20 12:54:28 +00:00
committed by GitHub
parent f696a5881b
commit 2751e1ec02
5 changed files with 5 additions and 5 deletions

View File

@@ -80,7 +80,7 @@ final class EntityDataHelper{
public static function parseVec3(CompoundTag $nbt, string $tagName, bool $optional) : Vector3{
$pos = $nbt->getTag($tagName);
if($pos === null && $optional){
return new Vector3(0, 0, 0);
return Vector3::zero();
}
if(!($pos instanceof ListTag) || ($pos->getTagType() !== NBT::TAG_Double && $pos->getTagType() !== NBT::TAG_Float)){
throw new SavedDataLoadingException("'$tagName' should be a List<Double> or List<Float>");