menu
#5039055 substr() expects parameter 1 to be string, int given

Submitted by PocketMine-MP 3.22.0

General information

Version: 3.22.0
Git commit: c32c2146
Plugin involvement: Direct
Report date: 2021-07-22 08:10:53 +0000 UTC
Server uptime: 0 days 6 hours 20 minutes 49 seconds

System Information

PHP version: 7.4.21
Operating system: linux
System banner: Linux 18ca89db-e659-4dae-98b2-3dee642572bd 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64

Error information

Warning: the SkyWarsForPE plugin was directly involved in this crash. Please contact the plugin author.
Message: substr() expects parameter 1 to be string, int given
File: plugins/SkyWarsForPE (1).phar/src/larryTheCoder/utils/npc/PedestalManager
Line: #159
Error level: TypeError
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
			/** @var PlayerData $value */
foreach($players as $value){
$player[$value->player] = $value->wins;
}

arsort($player);

// Filter the element in an array that are not "Example"
$filter = array_filter(array_keys($player), function($value): bool{
return substr($value, 0, -2) !== "Example";
});

// Then we fetch the player's kills in the array object.
$result = [];
foreach($filter as $playerObject){
$result[$playerObject] = $player[$playerObject];
}

// If the amount of filtered keys doesn't reach minimum requirements (Usually when SWFPE is freshly installed)
// We merge the example with the first original result.
#0 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/utils/npc/PedestalManager(159): substr(integer 1, integer 0, integer -2)
#1 (): larryTheCoder\utils\npc\PedestalManager->larryTheCoder\utils\npc\{closure}(integer 1)
#2 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/utils/npc/PedestalManager(160): array_filter(array[8], object Closure)
#3 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/database/SkyWarsDatabase(150): larryTheCoder\utils\npc\PedestalManager->larryTheCoder\utils\npc\{closure}(array[5])
#4 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/libs/poggit/libasynql/base/DataConnectorImpl(159): larryTheCoder\database\SkyWarsDatabase::larryTheCoder\database\{closure}(array[5], array[7])
#5 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/libs/poggit/libasynql/base/DataConnectorImpl(189): larryTheCoder\libs\poggit\libasynql\base\DataConnectorImpl->larryTheCoder\libs\poggit\libasynql\base\{closure}(object larryTheCoder\libs\poggit\libasynql\result\SqlSelectResult)
#6 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/libs/poggit/libasynql/base/SqlThreadPool(112): larryTheCoder\libs\poggit\libasynql\base\DataConnectorImpl->larryTheCoder\libs\poggit\libasynql\base\{closure}(object larryTheCoder\libs\poggit\libasynql\result\SqlSelectResult)
#7 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/libs/poggit/libasynql/base/DataConnectorImpl(268): larryTheCoder\libs\poggit\libasynql\base\SqlThreadPool->readResults(array[1])
#8 plugins/SkyWarsForPE (1).phar/src/larryTheCoder/libs/poggit/libasynql/base/SqlThreadPool(65): larryTheCoder\libs\poggit\libasynql\base\DataConnectorImpl->checkResults()
#9 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(113): larryTheCoder\libs\poggit\libasynql\base\SqlThreadPool->larryTheCoder\libs\poggit\libasynql\base\{closure}()
#10 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(75): pocketmine\snooze\SleeperHandler->processNotifications()
#11 pmsrc/src/pocketmine/Server(2155): pocketmine\snooze\SleeperHandler->sleepUntil(double 1626941453.8468)
#12 pmsrc/src/pocketmine/Server(1992): pocketmine\Server->tickProcessor()
#13 pmsrc/src/pocketmine/Server(1586): pocketmine\Server->start()
#14 pmsrc/src/pocketmine/PocketMine(291): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/)
#15 pmsrc/src/pocketmine/PocketMine(321): pocketmine\server()
#16 pmsrc(11): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show