Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2021-11-01 18:13:24 +00:00
13 changed files with 1640 additions and 1511 deletions

View File

@ -77,32 +77,28 @@ abstract class Projectile extends Entity{
$this->setHealth(1);
$this->damage = $nbt->getDouble("damage", $this->damage);
do{
$blockPos = null;
$blockId = null;
$blockData = null;
(function() use ($nbt) : void{
if(($tileXTag = $nbt->getTag("tileX")) instanceof IntTag and ($tileYTag = $nbt->getTag("tileY")) instanceof IntTag and ($tileZTag = $nbt->getTag("tileZ")) instanceof IntTag){
$blockPos = new Vector3($tileXTag->getValue(), $tileYTag->getValue(), $tileZTag->getValue());
}else{
break;
return;
}
if(($blockIdTag = $nbt->getTag("blockId")) instanceof IntTag){
$blockId = $blockIdTag->getValue();
}else{
break;
return;
}
if(($blockDataTag = $nbt->getTag("blockData")) instanceof ByteTag){
$blockData = $blockDataTag->getValue();
}else{
break;
return;
}
$this->blockHit = BlockFactory::getInstance()->get($blockId, $blockData);
$this->blockHit->position($this->getWorld(), $blockPos->getFloorX(), $blockPos->getFloorY(), $blockPos->getFloorZ());
}while(false);
})();
}
public function canCollideWith(Entity $entity) : bool{