mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Added block cloning fix
This commit is contained in:
@ -415,7 +415,7 @@ class Entity extends Position{
|
||||
}
|
||||
|
||||
if($support === false){
|
||||
$this->speedY -= ($this->class === ENTITY_FALLING ? 16:32) * $tdiff;
|
||||
$this->speedY -= ($this->class === ENTITY_FALLING ? 18:32) * $tdiff;
|
||||
$update = true;
|
||||
}elseif($this->speedY <= 0.1){
|
||||
$this->speedX = 0;
|
||||
|
@ -216,15 +216,13 @@ class Level{
|
||||
"meta" => $block->getMetadata(),
|
||||
));
|
||||
}elseif($direct === false){
|
||||
if(!($block->level instanceof Level)){
|
||||
$block->position($pos);
|
||||
}
|
||||
$block->position($pos);
|
||||
$i = ($pos->x >> 4).":".($pos->y >> 4).":".($pos->z >> 4);
|
||||
if(!isset($this->changedBlocks[$i])){
|
||||
$this->changedBlocks[$i] = array();
|
||||
$this->changedCount[$i] = 0;
|
||||
}
|
||||
$this->changedBlocks[$i][] = $block;
|
||||
$this->changedBlocks[$i][] = clone $block;
|
||||
++$this->changedCount[$i];
|
||||
}
|
||||
}
|
||||
@ -241,9 +239,8 @@ class Level{
|
||||
if(!($pos instanceof Position)){
|
||||
$pos = new Position($pos->x, $pos->y, $pos->z, $this);
|
||||
}
|
||||
if(!($block->level instanceof Level)){
|
||||
$block->position($pos);
|
||||
}
|
||||
$block->position($pos);
|
||||
|
||||
if($direct === true){
|
||||
$this->server->api->player->broadcastPacket($this->players, MC_UPDATE_BLOCK, array(
|
||||
"x" => $pos->x,
|
||||
@ -258,12 +255,11 @@ class Level{
|
||||
$this->changedBlocks[$i] = array();
|
||||
$this->changedCount[$i] = 0;
|
||||
}
|
||||
$this->changedBlocks[$i][] = $block;
|
||||
$this->changedBlocks[$i][] = clone $block;
|
||||
++$this->changedCount[$i];
|
||||
}
|
||||
|
||||
if($update === true){
|
||||
|
||||
if($update === true){
|
||||
$this->server->api->block->blockUpdateAround($pos, BLOCK_UPDATE_NORMAL, 1);
|
||||
}
|
||||
if($tiles === true){
|
||||
|
Reference in New Issue
Block a user