PHP: <?phpnamespace Alias;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\event\Listener;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\Player;use pocketmine\Iplayer;use pocketmine\OfflinePlayer;use pocketmine\plugin\PluginBase;use pocketmine\utils\Config;class MainClass extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); if(!is_dir($this->getDataFolder()."players/lastip")){ @mkdir($this->getDataFolder()."players/lastip", 0777, true); } if(!is_dir($this->getDataFolder()."players/ip")){ @mkdir($this->getDataFolder()."players/ip", 0777, true); } } public function onDisable(){} public function onJoin(PlayerJoinEvent $event){ $name = $event->getPlayer()->getDisplayName(); $ip = $event->getPlayer()->getAddress(); if(is_file($this->getDataFolder()."players/lastip/".$name[0]."/".$name.".yml")){ unlink($this->getDataFolder()."players/lastip/".$name[0]."/".$name.".yml"); $name = $event->getPlayer()->getDisplayName(); $ip = $event->getPlayer()->getAddress(); @mkdir($this->getDataFolder()."players/lastip/".$name[0]."", 0777, true); $lastip = new Config($this->getDataFolder()."players/lastip/".$name[0]."/".$name.".yml", CONFIG::YAML, array( "lastip" => "".$ip."", )); $lastip->save(); @mkdir($this->getDataFolder()."players/ip/".$ip[0]."", 0777, true); $ipfile = new Config($this->getDataFolder()."players/ip/".$ip[0]."/".$ip.".txt", CONFIG::ENUM); $ipfile->set($name); $ipfile->save(); }else{ $name = $event->getPlayer()->getDisplayName(); $ip = $event->getPlayer()->getAddress(); @mkdir($this->getDataFolder()."players/lastip/".$name[0]."", 0777, true); $lastip = new Config($this->getDataFolder()."players/lastip/".$name[0]."/".$name.".yml", CONFIG::YAML, array( "lastip" => "".$ip."", )); $lastip->save(); @mkdir($this->getDataFolder()."players/ip/".$ip[0]."", 0777, true); $ipfile = new Config($this->getDataFolder()."players/ip/".$ip[0]."/".$ip.".txt", CONFIG::ENUM); $ipfile->set($name); $ipfile->save(); } } public function onCommand(CommandSender $sender, Command $command, $label, array $args){ switch($command->getName()){ case "alias": if(!isset($args[0])){ $sender->sendMessage("§7(§c!§7)§c Usage: ".$command->getUsage().""); return true; } $name = strtolower($args[0]); $player = $this->getServer()->getPlayer($name); if($player instanceOf Player){ $ip = $player->getPlayer()->getAddress(); $file = new Config($this->getDataFolder()."players/ip/".$ip[0]."/".$ip.".txt"); $names = $file->getAll(true); $names = implode(', ', $names); $sender->sendMessage("§7(§a!§7)§a Showing alias of ".$name."..."); $sender->sendMessage("§7(§a!§7)§a ".$names.""); return true; }else{ if(!is_file($this->getDataFolder()."players/lastip/".$name[0]."/".$name.".yml")){ $sender->sendMessage("§7(§c!§7)§c Player does not exist!"); return true; }else{ $lastip = new Config($this->getDataFolder()."players/lastip/".$name[0]."/".$name.".yml"); $ip = $lastip->get("lastip"); $file = new Config($this->getDataFolder()."players/ip/".$ip[0]."/".$ip.".txt"); $names = $file->getAll(true); if($names == null){ $sender->sendMessage("§7(§c!§7)§c Player does not exist!"); break; }else{ $names = implode(', ', $names); $sender->sendMessage("§7(§a!§7)§a Showing alias of ".$name."..."); $sender->sendMessage("§7(§a!§7)§a ".$names.""); return true; } } } return true; } }} Couldn't contact the original owner of "Alias" plugin .-. Can anyone teach me how to update outdated plugins
Kinda Simple, First go To plugin.yml and change the api version to [3.0.0]. DEBBUGING I would reccomend to make a free server to have it like test enviroment. Start your server(make sure you have alias installed) and press CTRL+F (if on google chrome) and search alias, if u see like any error try going on forums (pmmp forums/stack overflow etc) and asking or resolving them by yourself.
Well, simply "updating" or injecting the API probably won't solve the problem which it didn't, as the plugin is not coded simply. I should've added on that I wanted to know what parts of the code were wrong(doesn't go with the current PMMP)
I did .-. and I tried fixing them but the plugin internal server errors. I'm just gonna leave it here for now. Thanks for your help!