Added block cloning fix

This commit is contained in:
Shoghi Cervantes
2013-06-01 19:58:54 +02:00
parent 24ba7cbbd1
commit 54b73e5f82
7 changed files with 41 additions and 52 deletions

View File

@ -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;

View File

@ -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){