Can someone correct this for me Code: class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); @mkdir($this->getDataFolder()); $this->nolove = new Config($this->getDataFolder()."nolove.txt", Config::ENUM); } class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->saveDefaultConfig(); $this->getLogger()->info(TEXTFORMAT::GOLD . "[--ServerLove--]" .TEXTFORMAT::RED. " --> -->" .TEXTFORMAT::GREEN. " Yayyy, ServerLove is ready for love on Version 1.0.0!"); } Thanks.
I am absolutely No good with plugins, but I am attempting to merge parts of plugins together. both class Main extends PluginBase implements Listener{ is needed for the plugin, so is they a way they ban be merged, so they both work together?
I repeat, I am attempting to merge parts of plugins together And we are aloud to copy. As long as the License says so.
Firstly, if you want to copy, you should atleast understand the code. Secondly, please write some information, what you are trying to do?
I just managed to do it. Yayyy i finnished the plugin. ( Its a remake of PokePlayer plugin, with certain other features ) Code: class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); @mkdir($this->getDataFolder()); $this->nolove = new Config($this->getDataFolder()."nolove.txt", Config::ENUM); $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->saveDefaultConfig(); $this->getLogger()->info(TEXTFORMAT::GOLD . "[--ServerLove--]" .TEXTFORMAT::RED. " --> -->" .TEXTFORMAT::GREEN. " Yayyy, ServerLove is ready for love on Version 1.0.0!"); }
PHP: class Main extends PluginBase implements Listener{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); @mkdir($this->getDataFolder()); $this->nolove = new Config($this->getDataFolder()."nolove.txt", Config::ENUM); $this->load($this->getDataFolder()."nolove.txt");} try this
I prefer to have the Console plugin thing on though. But its not crashing for me. Ill test it propper soon
PHP: $this->nolove is undefined. If you would try to define it, as you do in your code, it'd give you an error. PHP: @mkdir($this->getDataFolder()) in this case is not needed, if you save the default config before defining $this->nolove. Tho, if you want to use it, you should check whether the path is already a direction or not. Having Code: $this->getServer()->registerEvents($this, $this); two times will cause an error, also it isn't needed in this code (at the moment). Lastly, the code would be PHP: class Main extends PluginBase implements Listener{ private $nolove; public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); //if(!is_dir($this->getDataFolder())) mkdir($this->getDataFolder()); $this->saveDefaultConfig(); $this->nolove = new Config($this->getDataFolder()."nolove.txt", Config::ENUM); $this->getLogger()->info(TEXTFORMAT::GOLD . "[--ServerLove--]" .TEXTFORMAT::RED. " --> -->" .TEXTFORMAT::GREEN. " Yayyy, ServerLove is ready for love on Version 1.0.0!"); } @zombie_Power - Why shouldn't $this->getLogger()->info(); work?
guys, the code works perfectly. the plugin is fine. ( i havent tested two players yet, but i will soon )
I am trying to learn PHP, so please don't push that on me. (Rome wasn't built in a day!) also, what do you mean by "The owner of Deibo xD Delete the fake counter on your server! I am the owner of TheDeiboMC if that's what you mean. The server will be back up in 3-4 days from now, if thats what your thinking of fake counter.
16.000 players Online on minecraft pocket list, and you have the ip with dottk... Also anybody know your server... Is obviusly that you use a fake counter