Fixed physics sneak flag

This commit is contained in:
Shoghi Cervantes 2014-08-29 13:02:08 +02:00
parent 69b3ef326b
commit 7a1d25617f
2 changed files with 10 additions and 4 deletions

View File

@ -824,7 +824,7 @@ abstract class Entity extends Position implements Metadatable{
}
if($this->gravity > 0 and $fallingFlag and $this->onGround and ($movX != $dx or $movZ != $dz)){
if($this->gravity > 0 and $fallingFlag /*and $sneak*/ and ($movX != $dx or $movZ != $dz)){
$cx = $dx;
$cy = $dy;
$cz = $dz;

View File

@ -354,7 +354,7 @@ class Level implements ChunkManager, Metadatable{
* @param int $X
* @param int $Z
*
* @return Player[][]
* @return Player[]
*/
public function getUsingChunk($X, $Z){
$index = Level::chunkHash($X, $Z);
@ -632,7 +632,12 @@ class Level implements ChunkManager, Metadatable{
* @param int $type
*/
public function updateAround(Vector3 $pos, $type = self::BLOCK_UPDATE_NORMAL){
if($pos instanceof Block){
$block = $pos;
}else{
$block = $this->getBlock($pos);
}
$block->getSide(0)->onUpdate($type);
$block->getSide(1)->onUpdate($type);
$block->getSide(2)->onUpdate($type);
@ -776,7 +781,8 @@ class Level implements ChunkManager, Metadatable{
$pk->meta = $block->getDamage();
foreach($this->getUsingChunk($pos->x >> 4, $pos->z >> 4) as $player){
$player->dataPacket($pk);
/** @var Player $player */
$player->directDataPacket($pk);
}
}else{
if(!($pos instanceof Position)){