sneaking fix

This commit is contained in:
GameHerobrine 2022-09-07 18:09:09 +03:00
parent d02c98b2b3
commit 64151dcad0
4 changed files with 12 additions and 6 deletions

View file

@ -733,7 +733,7 @@ class Entity extends Position{
public function inBlock(Vector3 $block, $radius = 0.8){ public function inBlock(Vector3 $block, $radius = 0.8){
$me = new Vector3($this->x - 0.5, $this->y, $this->z - 0.5); $me = new Vector3($this->x - 0.5, $this->y, $this->z - 0.5);
if(($block->y == ((int) $this->y) or $block->y == (((int) $this->y) + 1)) and $block->maxPlainDistance($me) < $radius){ if(($block->y == (ceil($this->y)) or $block->y == (ceil($this->y) + 1)) and $block->maxPlainDistance($me) < $radius){
return true; return true;
} }
return false; return false;

View file

@ -76,7 +76,13 @@ abstract class ProtocolInfo{
//const PLAYER_INPUT_PACKET = 0xb9; //const PLAYER_INPUT_PACKET = 0xb9;
} }
/*Unused:
* 0xb5
* 0xb9
* 0x96
* 0x17
* 0x14
*/
/***REM_START***/ /***REM_START***/
require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php"); require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php");
/***REM_END***/ /***REM_END***/

View file

@ -39,8 +39,8 @@ class Random{
$s = $v1 * $v1 + $v2 * $v2; $s = $v1 * $v1 + $v2 * $v2;
}while($s >= 1 || $s == 0); }while($s >= 1 || $s == 0);
$multiplier = sqrt(-2 * log($s) / $s); $multiplier = sqrt(-2 * log($s) / $s);
$nextNextGaussian = $v2 * $multiplier; $this->nextNextGaussian = $v2 * $multiplier;
$haveNextNextGaussian = true; $this->haveNextNextGaussian = true;
return $v1 * $multiplier; return $v1 * $multiplier;
} }
} }