mirror of
				https://github.com/Matthww/PlayerInfo.git
				synced 2025-10-30 20:42:41 +00:00 
			
		
		
		
	Saving checks
Added checks for saving
This commit is contained in:
		| @@ -55,6 +55,7 @@ class PlayerInfo extends PluginBase implements Listener { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public function onJoin(PlayerJoinEvent $joinEvent) { |     public function onJoin(PlayerJoinEvent $joinEvent) { | ||||||
|  |         if($this->getConfig()->get("Save") == true) { | ||||||
|             $player = $joinEvent->getPlayer(); |             $player = $joinEvent->getPlayer(); | ||||||
|             $cdata = $this->PlayerData[$player->getName()]; |             $cdata = $this->PlayerData[$player->getName()]; | ||||||
|             $os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "NX"]; |             $os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "NX"]; | ||||||
| @@ -73,6 +74,7 @@ class PlayerInfo extends PluginBase implements Listener { | |||||||
|                 $Controls[$cdata["CurrentInputMode"]] |                 $Controls[$cdata["CurrentInputMode"]] | ||||||
|             )); |             )); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public function DeviceModel(string $model) { |     public function DeviceModel(string $model) { | ||||||
|         $models = yaml_parse_file($this->getDataFolder() . "models.yml"); |         $models = yaml_parse_file($this->getDataFolder() . "models.yml"); | ||||||
| @@ -107,7 +109,7 @@ class PlayerInfo extends PluginBase implements Listener { | |||||||
|                         if($target = $this->getServer()->getPlayer($args[0])) { |                         if($target = $this->getServer()->getPlayer($args[0])) { | ||||||
|                             //Nothing |                             //Nothing | ||||||
|                         } else { |                         } else { | ||||||
|                             if($this->getConfig()->get("IP") == true) { |                             if($this->getConfig()->get("Save") == true) { | ||||||
|                                 $this->getServer()->getScheduler()->scheduleTask(new Tasks\LoadTask($this, $sender, $args[0])); |                                 $this->getServer()->getScheduler()->scheduleTask(new Tasks\LoadTask($this, $sender, $args[0])); | ||||||
|                                 return true; |                                 return true; | ||||||
|                             } else { |                             } else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user