Skip to content

Instantly share code, notes, and snippets.

@TheDiamondYT1
Last active August 29, 2016 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheDiamondYT1/dc23b76a0f656a93dc28 to your computer and use it in GitHub Desktop.
Save TheDiamondYT1/dc23b76a0f656a93dc28 to your computer and use it in GitHub Desktop.
Snippret of only allowing plugin to be loaded by Genisys
<?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