mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 18:11:52 +00:00
Fixed crash when placing water or lava
This commit is contained in:
parent
e219f4784c
commit
ed90d58e32
@ -35,7 +35,7 @@ class Lava extends Liquid{
|
|||||||
|
|
||||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
$ret = $this->getLevel()->setBlock($this, $this, true, false, true);
|
$ret = $this->getLevel()->setBlock($this, $this, true, false, true);
|
||||||
Server::getInstance()->api->block->scheduleBlockUpdate(clone $this, 40, Level::BLOCK_UPDATE_NORMAL);
|
$this->getLevel()->scheduleUpdate(clone $this, 40);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ class Lava extends Liquid{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
//return false;
|
return false;
|
||||||
$newId = $this->id;
|
$newId = $this->id;
|
||||||
$level = $this->meta & 0x07;
|
$level = $this->meta & 0x07;
|
||||||
if($type !== Level::BLOCK_UPDATE_NORMAL){
|
if($type !== Level::BLOCK_UPDATE_NORMAL){
|
||||||
|
@ -35,7 +35,7 @@ class Water extends Liquid{
|
|||||||
|
|
||||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
$ret = $this->getLevel()->setBlock($this, $this, true, false, true);
|
$ret = $this->getLevel()->setBlock($this, $this, true, false, true);
|
||||||
Server::getInstance()->api->block->scheduleBlockUpdate(clone $this, 10, Level::BLOCK_UPDATE_NORMAL);
|
$this->getLevel()->scheduleUpdate(clone $this, 10);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ class Water extends Liquid{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
//return false;
|
return false;
|
||||||
$newId = $this->id;
|
$newId = $this->id;
|
||||||
$level = $this->meta & 0x07;
|
$level = $this->meta & 0x07;
|
||||||
if($type !== Level::BLOCK_UPDATE_NORMAL){
|
if($type !== Level::BLOCK_UPDATE_NORMAL){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user