mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-05-12 16:39:22 +00:00
modified: plugin.yml
modified: resources/config.yml modified: resources/models.yml modified: src/Matthww/PlayerInfo/PlayerInfo.php modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php modified: src/Matthww/PlayerInfo/Tasks/LoadTask.php modified: src/Matthww/PlayerInfo/Tasks/SaveTask.php modified: src/Matthww/PlayerInfo/Tasks/FetchModelsTask.php
This commit is contained in:
parent
ad4d1f7834
commit
2743b944a6
18
plugin.yml
18
plugin.yml
@ -1,20 +1,18 @@
|
|||||||
name: PlayerInfo
|
name: PlayerInfo
|
||||||
version: 2.1.4
|
version: 2.1.5
|
||||||
author: Matthww
|
author: Matthww
|
||||||
api: [3.0.0]
|
api: 5.0.0
|
||||||
description: Shows info about a certain player!
|
description: Shows information about a certain player!
|
||||||
main: Matthww\PlayerInfo\PlayerInfo
|
main: Matthww\PlayerInfo\PlayerInfo
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
playerinfo:
|
playerinfo:
|
||||||
description: Show info about a certain player!
|
description: Show information about a certain player!
|
||||||
usage: "/playerinfo <player>"
|
usage: "/playerinfo <player>"
|
||||||
permission: playerinfo.use
|
permission: playerinfo.use
|
||||||
aliases: ['pinfo']
|
aliases: ['pinfo']
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
playerinfo:
|
playerinfo.use:
|
||||||
default: false
|
default: op
|
||||||
children:
|
description: "Allows the player to execute the playerinfo command"
|
||||||
playerinfo.use:
|
|
||||||
default: op
|
|
||||||
description: "Allows the user to run the playerinfo command"
|
|
||||||
|
@ -3,24 +3,27 @@
|
|||||||
# True = enabled
|
# True = enabled
|
||||||
# False = disabled
|
# False = disabled
|
||||||
|
|
||||||
#Save playerdata
|
# Save player data
|
||||||
Save: true
|
Save: true
|
||||||
|
|
||||||
# Show players name
|
# Show players name
|
||||||
Name: true
|
Name: true
|
||||||
|
|
||||||
# Show players IP
|
# Show players IP address
|
||||||
IP: true
|
IP: true
|
||||||
|
|
||||||
|
# Show players port
|
||||||
|
Port: true
|
||||||
|
|
||||||
# Show players ping
|
# Show players ping
|
||||||
Ping: true
|
Ping: true
|
||||||
|
|
||||||
# Show players Device OS
|
# Show players Device OS
|
||||||
# (Android, iOS etc.)
|
# (Android, iOS, etc.)
|
||||||
OS: true
|
OS: true
|
||||||
|
|
||||||
# Show players Device Model
|
# Show players Device Model
|
||||||
# (iPhone 7 etc.)
|
# (iPhone 7, etc.)
|
||||||
Model: true
|
Model: true
|
||||||
|
|
||||||
# Show players UI settings
|
# Show players UI settings
|
||||||
@ -34,6 +37,9 @@ GUI: true
|
|||||||
# (Touch, Mouse or Controller)
|
# (Touch, Mouse or Controller)
|
||||||
Controls: true
|
Controls: true
|
||||||
|
|
||||||
|
# Show players Unique ID (UUID)
|
||||||
|
UUID: true
|
||||||
|
|
||||||
# Show players health
|
# Show players health
|
||||||
Health: true
|
Health: true
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#Device models
|
# Device models
|
||||||
|
|
||||||
iPhone4,1: iPhone 4s
|
iPhone4,1: iPhone 4s
|
||||||
iPhone5,1: iPhone 5
|
iPhone5,1: iPhone 5
|
||||||
@ -67,6 +67,8 @@ iPad7,4: iPad Pro (10.5-inch)
|
|||||||
|
|
||||||
SAMSUNG SM-J327T1: Samsung Galaxy J3 Prime Black
|
SAMSUNG SM-J327T1: Samsung Galaxy J3 Prime Black
|
||||||
|
|
||||||
|
SAMSUNG SM-A107F: Samsung Galaxy A10s (2019)
|
||||||
|
|
||||||
SAMSUNG SM-A530x: Samsung Galaxy A8 (2018)
|
SAMSUNG SM-A530x: Samsung Galaxy A8 (2018)
|
||||||
SAMSUNG SM-A730x: Samsung Galaxy A8+ (2018)
|
SAMSUNG SM-A730x: Samsung Galaxy A8+ (2018)
|
||||||
SAMSUNG SM-A810x: Samsung Galaxy A8 (2016)
|
SAMSUNG SM-A810x: Samsung Galaxy A8 (2016)
|
||||||
|
@ -11,19 +11,18 @@ use pocketmine\event\Listener;
|
|||||||
use pocketmine\event\player\PlayerJoinEvent;
|
use pocketmine\event\player\PlayerJoinEvent;
|
||||||
use pocketmine\event\server\DataPacketReceiveEvent;
|
use pocketmine\event\server\DataPacketReceiveEvent;
|
||||||
use pocketmine\network\mcpe\protocol\LoginPacket;
|
use pocketmine\network\mcpe\protocol\LoginPacket;
|
||||||
use pocketmine\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\plugin\PluginBase;
|
use pocketmine\plugin\PluginBase;
|
||||||
use pocketmine\utils\TextFormat as TF;
|
use pocketmine\utils\TextFormat as TF;
|
||||||
|
|
||||||
class PlayerInfo extends PluginBase implements Listener {
|
class PlayerInfo extends PluginBase implements Listener {
|
||||||
|
|
||||||
protected $DeviceOS;
|
protected $DeviceOS;
|
||||||
protected $DeviceModel;
|
protected $DeviceModel;
|
||||||
protected $UIProfile;
|
protected $UIProfile;
|
||||||
protected $PlayerData;
|
protected $PlayerData;
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function onEnable() {
|
public function onEnable(): void {
|
||||||
$this->getServer()->getPluginManager()->registerEvents($this, $this);
|
$this->getServer()->getPluginManager()->registerEvents($this, $this);
|
||||||
|
|
||||||
if(!is_dir($this->getDataFolder())) {
|
if(!is_dir($this->getDataFolder())) {
|
||||||
@ -40,27 +39,18 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onPacketReceived(DataPacketReceiveEvent $receiveEvent) {
|
|
||||||
$pk = $receiveEvent->getPacket();
|
|
||||||
if($pk instanceof LoginPacket) {
|
|
||||||
$this->PlayerData[$pk->username] = $pk->clientData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onJoin(PlayerJoinEvent $joinEvent) {
|
public function onJoin(PlayerJoinEvent $joinEvent) {
|
||||||
if($this->getConfig()->get("Save") == true) {
|
if($this->getConfig()->get("Save") == true) {
|
||||||
$player = $joinEvent->getPlayer();
|
$player = $joinEvent->getPlayer();
|
||||||
if(!is_dir($this->getDataFolder() . "players/".$player->getName())) {
|
if(!is_dir($this->getDataFolder() . "players/".$player->getName())) {
|
||||||
$this->getLogger()->info(TF::YELLOW."[PLAYERINFODB] > User not found in db... adding.");
|
$this->getLogger()->info(TF::YELLOW."[PLAYERINFODB] > User not found in db... adding one.");
|
||||||
mkdir($this->getDataFolder() . "players/".$player->getName());
|
mkdir($this->getDataFolder() . "players/".$player->getName());
|
||||||
}
|
}
|
||||||
$this->getLogger()->info(TF::GREEN.'[PLAYERINFO] > Adding user session '.$player->getName()." to history");
|
$this->getLogger()->info(TF::GREEN.'[PLAYERINFO] > Adding user session '.$player->getName().' to history');
|
||||||
date_default_timezone_set("Europe/Warsaw");
|
date_default_timezone_set("UTC");
|
||||||
$date = date('m-d-Y_h-i-s_a', time()); // save date and time (Hours need to being separated with "-" too for windows system because it is crazy....)
|
$date = date('m-d-Y_h-i-s_a', time()); // save date and time (Hours need to being separated with "-" too for windows system because it is crazy....)
|
||||||
|
|
||||||
|
$cdata = $player->getNetworkSession()->getPlayerInfo()->getExtraData();
|
||||||
|
|
||||||
$cdata = $this->PlayerData[$player->getName()];
|
|
||||||
$os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "Playstation 4", "Nintento Switch", "Xbox One"];
|
$os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "Playstation 4", "Nintento Switch", "Xbox One"];
|
||||||
$UI = ["Classic UI", "Pocket UI"];
|
$UI = ["Classic UI", "Pocket UI"];
|
||||||
$Controls = ["Unknown", "Mouse", "Touch", "Controller"];
|
$Controls = ["Unknown", "Mouse", "Touch", "Controller"];
|
||||||
@ -70,14 +60,16 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
$this,
|
$this,
|
||||||
$date,
|
$date,
|
||||||
$player->getName(),
|
$player->getName(),
|
||||||
$this->getModel($cdata["DeviceModel"]),
|
$this->getModel($cdata["DeviceModel"] ?? -1),
|
||||||
$os[$cdata["DeviceOS"]],
|
$os[$cdata["DeviceOS"] ?? -1],
|
||||||
$player->getAddress(),
|
$player->getNetworkSession()->getIp(),
|
||||||
$UI[$cdata["UIProfile"]],
|
$player->getNetworkSession()->getPort(),
|
||||||
$GUI[$cdata["GuiScale"]],
|
$UI[$cdata["UIProfile"] ?? -1],
|
||||||
$Controls[$cdata["CurrentInputMode"]]
|
$GUI[$cdata["GuiScale"] ?? -1],
|
||||||
|
$Controls[$cdata["CurrentInputMode"] ?? -1],
|
||||||
|
$player->getUniqueId(),
|
||||||
|
$player->getHealth(). " HP",
|
||||||
|
"X: " . $player->getPosition()->getFloorX() . ", Y: " . $player->getPosition()->getFloorY() . ", Z: " . $player->getPosition()->getFloorZ()
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -94,65 +86,70 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
|
|
||||||
public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool {
|
public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool {
|
||||||
if(strtolower($command->getName()) == "playerinfo" or strtolower($command->getName()) == "pinfo") {
|
if(strtolower($command->getName()) == "playerinfo" or strtolower($command->getName()) == "pinfo") {
|
||||||
|
$os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "Playstation 4", "Nintento Switch", "Xbox One"];
|
||||||
$os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "NX"];
|
|
||||||
$UI = ["Classic UI", "Pocket UI"];
|
$UI = ["Classic UI", "Pocket UI"];
|
||||||
$Controls = ["Unknown", "Mouse", "Touch", "Controller"];
|
$Controls = ["Unknown", "Mouse", "Touch", "Controller"];
|
||||||
$GUI = [-2 => "Minimum", -1 => "Medium", 0 => "Maximum"];
|
$GUI = [-2 => "Minimum", -1 => "Medium", 0 => "Maximum"];
|
||||||
|
|
||||||
if(!$sender->hasPermission("playerinfo.use")) {
|
if(!$sender->hasPermission("playerinfo.use")) {
|
||||||
$sender->sendMessage(TF::RED . "[PlayerInfo] No permission");
|
$sender->sendMessage(TF::RED . "[PlayerInfo] You don't have permission to use this command!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!isset($args[0])) {
|
if(!isset($args[0])) {
|
||||||
$sender->sendMessage(TF::RED . "[PlayerInfo] Please specify a player");
|
$sender->sendMessage(TF::RED . "[PlayerInfo] Please specify a player");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$target = $this->getServer()->getPlayer($args[0]);
|
$target = $this->getServer()->getPlayerExact($args[0]);
|
||||||
|
|
||||||
if(!$target instanceof Player) {
|
if(!$target instanceof Player) {
|
||||||
if($this->getConfig()->get("Save") == true) {
|
if($this->getConfig()->get("Save") == true) {
|
||||||
$this->getScheduler()->scheduleTask(new LoadTask($this, $sender, $args[0]));
|
$this->getScheduler()->scheduleTask(new LoadTask($this, $sender, $args[0]));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$sender->sendMessage(TF::RED . "[PlayerInfo] Player is not online");
|
$sender->sendMessage(TF::RED . "[PlayerInfo] Player is not online or does not exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($target instanceof Player) {
|
if($target instanceof Player) {
|
||||||
$cdata = $this->PlayerData[$target->getName()];
|
$cdata = $target->getNetworkSession()->getPlayerInfo()->getExtraData();
|
||||||
$sender->sendMessage(TF::GREEN . TF::BOLD . "===" . TF::GREEN . "PlayerInfo" . TF::GREEN . TF::BOLD . "===");
|
$sender->sendMessage(TF::GREEN . TF::BOLD . "=== " . TF::GREEN . "PlayerInfo" . TF::GREEN . TF::BOLD . " ===");
|
||||||
if($this->getConfig()->get("Name") == true) {
|
if($this->getConfig()->get("Name") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "Name: " . TF::RED . $target->getDisplayName());
|
$sender->sendMessage(TF::AQUA . "Name: " . TF::RED . $target->getDisplayName());
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("IP") == true) {
|
if($this->getConfig()->get("Model") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "IP: " . TF::RED . $target->getAddress());
|
$sender->sendMessage(TF::AQUA . "Model: " . TF::RED . $this->getModel($cdata["DeviceModel"] ?? -1));
|
||||||
}
|
|
||||||
if($this->getConfig()->get("Ping") == true) {
|
|
||||||
$sender->sendMessage(TF::AQUA . "Ping: " . TF::RED . $target->getPing() . "ms");
|
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("OS") == true) {
|
if($this->getConfig()->get("OS") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "OS: " . TF::RED . $os[$cdata["DeviceOS"]]);
|
$sender->sendMessage(TF::AQUA . "OS: " . TF::RED . $os[$cdata["DeviceOS"] ?? -1]);
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("Model") == true) {
|
if($this->getConfig()->get("IP") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "Model: " . TF::RED . $this->getModel($cdata["DeviceModel"]));
|
$sender->sendMessage(TF::AQUA . "IP: " . TF::RED . $target->getNetworkSession()->getIp());
|
||||||
|
}
|
||||||
|
if($this->getConfig()->get("Port") == true) {
|
||||||
|
$sender->sendMessage(TF::AQUA . "Port: " . TF::RED . $target->getNetworkSession()->getPort());
|
||||||
|
}
|
||||||
|
if($this->getConfig()->get("Ping") == true) {
|
||||||
|
$sender->sendMessage(TF::AQUA . "Ping: " . TF::RED . $target->getNetworkSession()->getPing() . "ms");
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("UI") == true) {
|
if($this->getConfig()->get("UI") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "UI: " . TF::RED . $UI[$cdata["UIProfile"]]);
|
$sender->sendMessage(TF::AQUA . "UI: " . TF::RED . $UI[$cdata["UIProfile"] ?? -1]);
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("GUI") == true) {
|
if($this->getConfig()->get("GUI") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "GUI Scale: " . TF::RED . $GUI[$cdata["GuiScale"]]);
|
$sender->sendMessage(TF::AQUA . "GUI Scale: " . TF::RED . $GUI[$cdata["GuiScale"] ?? -1]);
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("Controls") == true) {
|
if($this->getConfig()->get("Controls") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "Controls: " . TF::RED . $Controls[$cdata["CurrentInputMode"]]);
|
$sender->sendMessage(TF::AQUA . "Controls: " . TF::RED . $Controls[$cdata["CurrentInputMode"] ?? -1]);
|
||||||
|
}
|
||||||
|
if($this->getConfig()->get("UUID") == true) {
|
||||||
|
$sender->sendMessage(TF::AQUA . "UUID: " . TF::RED . $target->getUniqueId());
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("Health") == true) {
|
if($this->getConfig()->get("Health") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "Health: " . TF::RED . $target->getHealth() . "HP");
|
$sender->sendMessage(TF::AQUA . "Health: " . TF::RED . $target->getHealth() . " HP");
|
||||||
}
|
}
|
||||||
if($this->getConfig()->get("Position") == true) {
|
if($this->getConfig()->get("Position") == true) {
|
||||||
$sender->sendMessage(TF::AQUA . "Position: " . TF::RED . "X: " . $target->getFloorX() . ", Y: " . $target->getFloorY() . ", Z: " . $target->getFloorZ());
|
$sender->sendMessage(TF::AQUA . "Position: " . TF::RED . "X: " . $target->getPosition()->getFloorX() . ", Y: " . $target->getPosition()->getFloorY() . ", Z: " . $target->getPosition()->getFloorZ());
|
||||||
}
|
}
|
||||||
$sender->sendMessage(TF::GREEN . TF::BOLD . "================");
|
$sender->sendMessage(TF::GREEN . TF::BOLD . "==================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -14,8 +14,7 @@ class FetchModelsTask extends AsyncTask {
|
|||||||
$this->version = $version;
|
$this->version = $version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onRun() {
|
public function onRun(): void {
|
||||||
print($this->version);
|
|
||||||
$result = Internet::getURL("https://playerinfo.hillcraft.net/models.yml?v=" . $this->version);
|
$result = Internet::getURL("https://playerinfo.hillcraft.net/models.yml?v=" . $this->version);
|
||||||
if(!is_string($result)) {
|
if(!is_string($result)) {
|
||||||
$this->setResult(false);
|
$this->setResult(false);
|
||||||
|
@ -23,19 +23,23 @@ class LoadTask extends Task {
|
|||||||
return $this->plugin;
|
return $this->plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onRun(int $tick) {
|
public function onRun(): void {
|
||||||
if(!file_exists($this->getPlugin()->getDataFolder() . "players/" . strtolower($this->target) . ".json")) {
|
if(!file_exists($this->getPlugin()->getDataFolder() . "players/" . strtolower($this->target) . ".json")) {
|
||||||
$this->sender->sendMessage(TF::colorize("&c[PlayerInfo] Player &f". $this->target . " &cwas not found!"));
|
$this->sender->sendMessage(TF::colorize("&c[PlayerInfo] Player &f". $this->target . " &cis not online or does not exist!"));
|
||||||
} else {
|
} else {
|
||||||
$data = new Config($this->getPlugin()->getDataFolder() . "players/" . strtolower($this->target) . ".json", Config::JSON);
|
$data = new Config($this->getPlugin()->getDataFolder() . "players/" . strtolower($this->target) . ".json", Config::JSON);
|
||||||
$this->sender->sendMessage(TF::colorize("&a&l=== &r&aPlayerInfo &a&l==="));
|
$this->sender->sendMessage(TF::colorize("&a&l=== &r&aPlayerInfo &a&l==="));
|
||||||
$this->sender->sendMessage(TF::colorize("&bName: &c" . $data->get("Name")));
|
$this->sender->sendMessage(TF::colorize("&bName: &c" . $data->get("Name")));
|
||||||
$this->sender->sendMessage(TF::colorize("&bIP: &c" . $data->get("IP")));
|
|
||||||
$this->sender->sendMessage(TF::colorize("&bOS: &c" . $data->get("OS")));
|
|
||||||
$this->sender->sendMessage(TF::colorize("&bModel: &c" . $data->get("Model")));
|
$this->sender->sendMessage(TF::colorize("&bModel: &c" . $data->get("Model")));
|
||||||
|
$this->sender->sendMessage(TF::colorize("&bOS: &c" . $data->get("OS")));
|
||||||
|
$this->sender->sendMessage(TF::colorize("&bIP: &c" . $data->get("IP")));
|
||||||
|
$this->sender->sendMessage(TF::colorize("&bPort: &c" . $data->get("Port")));
|
||||||
$this->sender->sendMessage(TF::colorize("&bUI: &c" . $data->get("UI")));
|
$this->sender->sendMessage(TF::colorize("&bUI: &c" . $data->get("UI")));
|
||||||
$this->sender->sendMessage(TF::colorize("&bGUI Scale: &c" . $data->get("GUI")));
|
$this->sender->sendMessage(TF::colorize("&bGUI Scale: &c" . $data->get("GUI")));
|
||||||
$this->sender->sendMessage(TF::colorize("&bControls: &c" . $data->get("Controls")));
|
$this->sender->sendMessage(TF::colorize("&bControls: &c" . $data->get("Controls")));
|
||||||
|
$this->sender->sendMessage(TF::colorize("&UUID: &c" . $data->get("UUID")));
|
||||||
|
$this->sender->sendMessage(TF::colorize("&Health: &c" . $data->get("Health")));
|
||||||
|
$this->sender->sendMessage(TF::colorize("&Position: &c" . $data->get("Position")));
|
||||||
$this->sender->sendMessage(TF::colorize("&a&l================"));
|
$this->sender->sendMessage(TF::colorize("&a&l================"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,36 +14,48 @@ class SaveTask extends Task {
|
|||||||
protected $model;
|
protected $model;
|
||||||
protected $os;
|
protected $os;
|
||||||
protected $ip;
|
protected $ip;
|
||||||
|
protected $port;
|
||||||
protected $UI;
|
protected $UI;
|
||||||
protected $GUI;
|
protected $GUI;
|
||||||
protected $controls;
|
protected $controls;
|
||||||
|
protected $uuid;
|
||||||
|
protected $health;
|
||||||
|
protected $position;
|
||||||
|
|
||||||
public function __construct($plugin, string $date, string $player, string $model, string $os, string $ip, string $UI, string $GUI, string $controls) {
|
public function __construct($plugin, string $date, string $player, string $model, string $os, string $ip, string $port, string $UI, string $GUI, string $controls, string $uuid, string $health, string $position) {
|
||||||
$this->plugin = $plugin;
|
$this->plugin = $plugin;
|
||||||
$this->date = $date;
|
$this->date = $date;
|
||||||
$this->player = $player;
|
$this->player = $player;
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->os = $os;
|
$this->os = $os;
|
||||||
$this->ip = $ip;
|
$this->ip = $ip;
|
||||||
|
$this->port = $port;
|
||||||
$this->UI = $UI;
|
$this->UI = $UI;
|
||||||
$this->GUI = $GUI;
|
$this->GUI = $GUI;
|
||||||
$this->controls = $controls;
|
$this->controls = $controls;
|
||||||
|
$this->uuid = $uuid;
|
||||||
|
$this->health = $health;
|
||||||
|
$this->position = $position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPlugin() {
|
public function getPlugin() {
|
||||||
return $this->plugin;
|
return $this->plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onRun(int $tick) {
|
public function onRun(): void {
|
||||||
$data = new Config($this->getPlugin()->getDataFolder() . "players/" .$this->player."/". strtolower($this->player)."-".$this->date. ".json", Config::JSON);
|
$data = new Config($this->getPlugin()->getDataFolder() . "players/" .$this->player."/". strtolower($this->player)."-".$this->date. ".json", Config::JSON);
|
||||||
$data->set("Date", $this->date);
|
$data->set("Date", $this->date);
|
||||||
$data->set("Name", $this->player);
|
$data->set("Name", $this->player);
|
||||||
$data->set("Model", $this->model);
|
$data->set("Model", $this->model);
|
||||||
$data->set("OS", $this->os);
|
$data->set("OS", $this->os);
|
||||||
$data->set("IP", $this->ip);
|
$data->set("IP", $this->ip);
|
||||||
|
$data->set("Port", $this->port);
|
||||||
$data->set("UI", $this->UI);
|
$data->set("UI", $this->UI);
|
||||||
$data->set("GUI", $this->GUI);
|
$data->set("GUI", $this->GUI);
|
||||||
$data->set("Controls", $this->controls);
|
$data->set("Controls", $this->controls);
|
||||||
|
$data->set("UUID", $this->uuid);
|
||||||
|
$data->set("Health", $this->health);
|
||||||
|
$data->set("Position", $this->position);
|
||||||
$data->save();
|
$data->save();
|
||||||
$data->reload();
|
$data->reload();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user