mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
liquid fixes, explosion algorithm was reverted to the old pocketmine's one
This commit is contained in:
parent
b73205744e
commit
80e767b257
3 changed files with 38 additions and 42 deletions
|
|
@ -50,14 +50,14 @@ class LavaBlock extends LiquidBlock implements LightingBlock{
|
|||
}
|
||||
|
||||
public function checkWater(){
|
||||
for($side = 1; $side <= 5; ++$side){
|
||||
for($side = 0; $side <= 5; ++$side){
|
||||
$b = $this->getSide($side);
|
||||
if($b instanceof WaterBlock){
|
||||
$level = $this->meta & 0x06;
|
||||
if($level == 0x00){
|
||||
$this->level->setBlock($this, new ObsidianBlock(), false, false, true);
|
||||
$this->level->setBlock($b, new ObsidianBlock(), false, false, true);
|
||||
}else{
|
||||
$this->level->setBlock($this, new CobblestoneBlock(), false, false, true);
|
||||
$this->level->setBlock($b, new CobblestoneBlock(), false, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ class LavaBlock extends LiquidBlock implements LightingBlock{
|
|||
return false;
|
||||
}
|
||||
|
||||
if( $this->checkWater()){
|
||||
if($this->checkWater()){
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class WaterBlock extends LiquidBlock{
|
|||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$ret = $this->level->setBlock($this, $this, true, false, true);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(clone $this, 10, BLOCK_UPDATE_NORMAL);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(clone $this, 5, BLOCK_UPDATE_NORMAL);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ class WaterBlock extends LiquidBlock{
|
|||
if($from !== null || $level == 0x00){
|
||||
if($down instanceof AirBlock || $down instanceof WaterBlock){
|
||||
$this->level->setBlock($down, new WaterBlock(0x01), false, false, true);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($down, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($down, 0, 0, $this->level), 5, BLOCK_UPDATE_NORMAL);
|
||||
}elseif($level !== 0x07){{
|
||||
for($side = 2; $side <= 5; ++$side){
|
||||
$b = $this->getSide($side);
|
||||
|
|
@ -106,7 +106,7 @@ class WaterBlock extends LiquidBlock{
|
|||
}
|
||||
}elseif($b->isFlowable === true){
|
||||
$this->level->setBlock($b, new WaterBlock($level + 1), false, false, true);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 5, BLOCK_UPDATE_NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ class WaterBlock extends LiquidBlock{
|
|||
if($tlevel != 0x00){
|
||||
for ($s = 0; $s <= 5; $s++) {
|
||||
$ssb = $sb->getSide($s);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($ssb, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($ssb, 0, 0, $this->level), 5, BLOCK_UPDATE_NORMAL);
|
||||
}
|
||||
$this->level->setBlock($sb, new AirBlock(), false, false, true);
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ class WaterBlock extends LiquidBlock{
|
|||
if($tlevel != 0x00){
|
||||
for ($s = 0; $s <= 5; $s++) {
|
||||
$ssb = $sb->getSide($s);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($ssb, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
|
||||
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($ssb, 0, 0, $this->level), 5, BLOCK_UPDATE_NORMAL);
|
||||
}
|
||||
$this->level->setBlock($b, new AirBlock(), false, false, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue