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

@ -437,7 +437,7 @@ class BlockAPI{
$item = $player->getSlot($player->slot);
if($target->getID() === AIR and $this->server->api->dhandle("player.block.place.invalid", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){ //If no block exists or not allowed in CREATIVE
if($this->server->api->dhandle("player.block.place.bypass", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){
if($this->server->api->dhandle("player.block.place.bypass", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){
$this->cancelAction($target, $player);
return $this->cancelAction($block, $player);
}
@ -445,7 +445,7 @@ class BlockAPI{
if($this->server->api->dhandle("player.block.touch", ["type" => "place", "player" => $player, "block" => $block, "target" => $target, "item" => $item]) === false){
if($this->server->api->dhandle("player.block.place.bypass", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) !== true){
return $this->cancelAction($block, $player);
return $this->cancelAction($block, $player);
}
}
$this->blockUpdate($target, BLOCK_UPDATE_TOUCH);

View file

@ -733,7 +733,7 @@ class Entity extends Position{
public function inBlock(Vector3 $block, $radius = 0.8){
$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 false;

View file

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

View file

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