Last active
August 29, 2016 23:35
-
-
Save TheDiamondYT1/dc23b76a0f656a93dc28 to your computer and use it in GitHub Desktop.
Snippret of only allowing plugin to be loaded by Genisys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace example; | |
use pocketmine\plugin\PluginBase | |
class MyClass extends PluginBase { | |
public function onEnable(){ | |
$version = $this->getServer()->getName(); | |
//What happens here, is if using Genisys it will continue to load the plugin | |
//and if using ANYTHING else it will disable it. Just a snippet here. | |
switch($version){ | |
case "Genisys": | |
$this->getLogger()->info("This plugin has disabled PocketMine support"); //Optional message here | |
break; | |
default: | |
$this->getLogger()->warn("Sorry, this plugin is for Genisys, a software based off PocketMine."); | |
$this->getLogger()->info("Download it at https://github.com/itxtech/genisys"); //Optional message | |
$this->setEnabled(false); | |
} | |
//Continue loading stuff here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/minecrafter/ca13f5ea0d6315051d8a7fd364d7340f