mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 23:37:45 +00:00
Heap of bugfixes, cleanup and PHP 7 upgrades
This commit is contained in:
@@ -52,7 +52,7 @@ class DumpMemoryCommand extends VanillaCommand{
|
||||
|
||||
++self::$executions;
|
||||
|
||||
$sender->getServer()->getMemoryManager()->dumpServerMemory(isset($args[1]) ? $args[1] : $sender->getServer()->getDataPath() . "/memoryDump_$token", 48, 80);
|
||||
$sender->getServer()->getMemoryManager()->dumpServerMemory($args[1] ?? ($sender->getServer()->getDataPath() . "/memoryDump_$token"), 48, 80);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ class KickCommand extends VanillaCommand{
|
||||
|
||||
if(($player = $sender->getServer()->getPlayer($name)) instanceof Player){
|
||||
$player->kick($reason);
|
||||
if(strlen($reason) >= 1){
|
||||
if($reason !== ""){
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.kick.success.reason", [$player->getName(), $reason]));
|
||||
}else{
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.kick.success", [$player->getName()]));
|
||||
|
@@ -203,17 +203,17 @@ class ParticleCommand extends VanillaCommand{
|
||||
|
||||
}
|
||||
|
||||
if(substr($name, 0, 10) === "iconcrack_"){
|
||||
if(strpos($name, "iconcrack_") === 0){
|
||||
$d = explode("_", $name);
|
||||
if(count($d) === 3){
|
||||
return new ItemBreakParticle($pos, Item::get((int) $d[1], (int) $d[2]));
|
||||
}
|
||||
}elseif(substr($name, 0, 11) === "blockcrack_"){
|
||||
}elseif(strpos($name, "blockcrack_") === 0){
|
||||
$d = explode("_", $name);
|
||||
if(count($d) === 2){
|
||||
return new TerrainParticle($pos, Block::get($d[1] & 0xff, $d[1] >> 12));
|
||||
}
|
||||
}elseif(substr($name, 0, 10) === "blockdust_"){
|
||||
}elseif(strpos($name, "blockdust_") === 0){
|
||||
$d = explode("_", $name);
|
||||
if(count($d) >= 4){
|
||||
return new DustParticle($pos, $d[1] & 0xff, $d[2] & 0xff, $d[3] & 0xff, isset($d[4]) ? $d[4] & 0xff : 255);
|
||||
|
Reference in New Issue
Block a user