From 50b2f55583bf838affac1ee37223d14f223aa4d2 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 15 Sep 2014 23:53:08 +0200 Subject: [PATCH] Increased movement error range --- src/pocketmine/Player.php | 2 +- src/pocketmine/block/Slab.php | 27 +++++++++++++++++++-------- src/pocketmine/block/WoodSlab.php | 27 +++++++++++++++++++-------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 983178f55..320ca76e0 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1382,7 +1382,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $diff = $diffX ** 2 + $diffY ** 2 + $diffZ ** 2; - if(!$revert and $diff > 0.0625 and !$this->isSleeping() and $this->isSurvival()){ + if(!$revert and $diff > 0.15 and !$this->isSleeping() and $this->isSurvival()){ $revert = true; $this->server->getLogger()->warning($this->getName()." moved wrongly!"); } diff --git a/src/pocketmine/block/Slab.php b/src/pocketmine/block/Slab.php index 526b05563..3d004d6c2 100644 --- a/src/pocketmine/block/Slab.php +++ b/src/pocketmine/block/Slab.php @@ -48,14 +48,25 @@ class Slab extends Transparent{ } public function getBoundingBox(){ - return new AxisAlignedBB( - $this->x, - $this->y + (($this->meta & 0x08) === 0x08 ? 0.5 : 0), - $this->z, - $this->x + 1, - $this->y + (($this->meta & 0x08) === 0x08 ? 1 : 0.5), - $this->z + 1 - ); + if(($this->meta & 0x08) > 0){ + return new AxisAlignedBB( + $this->x, + $this->y + 0.5, + $this->z, + $this->x + 1, + $this->y + 1, + $this->z + 1 + ); + }else{ + return new AxisAlignedBB( + $this->x, + $this->y, + $this->z, + $this->x + 1, + $this->y + 0.5, + $this->z + 1 + ); + } } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ diff --git a/src/pocketmine/block/WoodSlab.php b/src/pocketmine/block/WoodSlab.php index 80b3fd8e0..2d5b74054 100644 --- a/src/pocketmine/block/WoodSlab.php +++ b/src/pocketmine/block/WoodSlab.php @@ -46,14 +46,25 @@ class WoodSlab extends Transparent{ } public function getBoundingBox(){ - return new AxisAlignedBB( - $this->x, - $this->y + (($this->meta & 0x08) === 0x08 ? 0.5 : 0), - $this->z, - $this->x + 1, - $this->y + (($this->meta & 0x08) === 0x08 ? 1 : 0.5), - $this->z + 1 - ); + if(($this->meta & 0x08) > 0){ + return new AxisAlignedBB( + $this->x, + $this->y + 0.5, + $this->z, + $this->x + 1, + $this->y + 1, + $this->z + 1 + ); + }else{ + return new AxisAlignedBB( + $this->x, + $this->y, + $this->z, + $this->x + 1, + $this->y + 0.5, + $this->z + 1 + ); + } } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){