mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Merge branch 'stable'
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user