From 1a9ec65983a585d7d489d8024e0dd1958099dede Mon Sep 17 00:00:00 2001 From: "Luca P." Date: Sat, 22 Aug 2015 15:58:45 +0200 Subject: [PATCH 1/5] Spelling fix --- src/pocketmine/utils/ServerKiller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/utils/ServerKiller.php b/src/pocketmine/utils/ServerKiller.php index d5c710f07..2e3326ebb 100644 --- a/src/pocketmine/utils/ServerKiller.php +++ b/src/pocketmine/utils/ServerKiller.php @@ -33,11 +33,11 @@ class ServerKiller extends Thread{ public function run(){ sleep($this->time); - echo "\nTook to long to stop, server was killed forcefully!\n"; + echo "\nTook too long to stop, server was killed forcefully!\n"; @\pocketmine\kill(getmypid()); } public function getThreadName(){ return "Server Killer"; } -} \ No newline at end of file +} From 0b9b1738b314af0d9562213da05d15c159ef96b7 Mon Sep 17 00:00:00 2001 From: Sjoerd Date: Thu, 27 Aug 2015 10:44:44 +0200 Subject: [PATCH 2/5] Block cache not cleared with a call to clearcache While trying to figure out Github and looking for a different bug I found this small bug in the code. The ClearCache function on Level.php did not correctly clear the blockcache. --- src/pocketmine/level/Level.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index f1881148e..b1d5ed97c 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -855,7 +855,7 @@ class Level implements ChunkManager, Metadatable{ } if(count($this->blockCache) > 2048){ - $this->chunkCache = []; + $this->blockCache = []; } } From 0348d181d4dfea065a430778b0f748575d8bf4fd Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Sat, 29 Aug 2015 18:03:40 +0800 Subject: [PATCH 3/5] Remove unused parameter in Level::requestChunk --- src/pocketmine/level/Level.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index f1881148e..177435ffe 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -2251,7 +2251,7 @@ class Level implements ChunkManager, Metadatable{ $this->server->getPluginManager()->callEvent(new SpawnChangeEvent($this, $previousSpawn)); } - public function requestChunk($x, $z, Player $player, $order = LevelProvider::ORDER_ZXY){ + public function requestChunk($x, $z, Player $player){ $index = Level::chunkHash($x, $z); if(!isset($this->chunkSendQueue[$index])){ $this->chunkSendQueue[$index] = []; From 9adcc19154e1a448ff5ff894a9ff804f17b066f1 Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Mon, 31 Aug 2015 22:05:49 +0930 Subject: [PATCH 4/5] @PEMapModder Removed redundant parameters for Living::knockBack. Closes #3427. --- src/pocketmine/entity/Living.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 4bfe52ccf..d336fae22 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -132,7 +132,18 @@ abstract class Living extends Entity implements Damageable{ $this->attackTime = 10; //0.5 seconds cooldown } - public function knockBack(Entity $attacker, $damage, $x, $z, $base = 0.4){ + /** + * Note: Variadic function is used to preserve BC + * @param int $x + * @param int $z + * @param float $base Default 0.4 + */ + public function knockBack($x, $z, $base = 0.4){ + if(func_num_args() >= 4){ + $args = func_get_args(); + list(, , $x, $z) = $args; + $base = isset($args[4]) ? $args[4] : 0.4; + } $f = sqrt($x * $x + $z * $z); if($f <= 0){ return; From 4bd14e742436ff804ec6f4fc95c61aec3fcaf1ec Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 31 Aug 2015 17:48:52 +0200 Subject: [PATCH 5/5] Revert commit that removed useful parameter for plugins that made backwards-incompatible changes Revert "@PEMapModder Removed redundant parameters for Living::knockBack. Closes #3427." This reverts commit 9adcc19154e1a448ff5ff894a9ff804f17b066f1. --- src/pocketmine/entity/Living.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index d336fae22..4bfe52ccf 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -132,18 +132,7 @@ abstract class Living extends Entity implements Damageable{ $this->attackTime = 10; //0.5 seconds cooldown } - /** - * Note: Variadic function is used to preserve BC - * @param int $x - * @param int $z - * @param float $base Default 0.4 - */ - public function knockBack($x, $z, $base = 0.4){ - if(func_num_args() >= 4){ - $args = func_get_args(); - list(, , $x, $z) = $args; - $base = isset($args[4]) ? $args[4] : 0.4; - } + public function knockBack(Entity $attacker, $damage, $x, $z, $base = 0.4){ $f = sqrt($x * $x + $z * $z); if($f <= 0){ return;