mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
Explosion: don't depend on air having stateID 0
This commit is contained in:
parent
52ce8ad8ae
commit
5e9ce92b55
@ -31,7 +31,7 @@ use pocketmine\math\AxisAlignedBB;
|
|||||||
class Air extends Transparent{
|
class Air extends Transparent{
|
||||||
|
|
||||||
public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){
|
public function __construct(BlockIdentifier $idInfo, string $name, ?BlockBreakInfo $breakInfo = null){
|
||||||
parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::indestructible(0.0));
|
parent::__construct($idInfo, $name, $breakInfo ?? BlockBreakInfo::indestructible(-1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canBeFlowedInto() : bool{
|
public function canBeFlowedInto() : bool{
|
||||||
|
@ -130,8 +130,9 @@ class Explosion{
|
|||||||
|
|
||||||
$state = $this->subChunkExplorer->currentSubChunk->getFullBlock($vBlockX & 0x0f, $vBlockY & 0x0f, $vBlockZ & 0x0f);
|
$state = $this->subChunkExplorer->currentSubChunk->getFullBlock($vBlockX & 0x0f, $vBlockY & 0x0f, $vBlockZ & 0x0f);
|
||||||
|
|
||||||
if($state !== 0){
|
$blastResistance = $blockFactory->blastResistance[$state];
|
||||||
$blastForce -= ($blockFactory->blastResistance[$state] / 5 + 0.3) * $this->stepLen;
|
if($blastResistance >= 0){
|
||||||
|
$blastForce -= ($blastResistance / 5 + 0.3) * $this->stepLen;
|
||||||
if($blastForce > 0){
|
if($blastForce > 0){
|
||||||
if(!isset($this->affectedBlocks[World::blockHash($vBlockX, $vBlockY, $vBlockZ)])){
|
if(!isset($this->affectedBlocks[World::blockHash($vBlockX, $vBlockY, $vBlockZ)])){
|
||||||
$_block = $blockFactory->fromFullBlock($state);
|
$_block = $blockFactory->fromFullBlock($state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user