mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
PluginAPI
This commit is contained in:
parent
99151981db
commit
e0c245d86e
6 changed files with 115 additions and 65 deletions
31
example/ExamplePlugin.php
Normal file
31
example/ExamplePlugin.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
__PocketMine Plugin__
|
||||
name=Example Plugin
|
||||
version=0.0.1
|
||||
author=shoghicp
|
||||
class=ExamplePlugin
|
||||
api=true
|
||||
*/
|
||||
|
||||
|
||||
class ExamplePlugin{
|
||||
private $api;
|
||||
public function __construct($api, $server = false){
|
||||
$this->api = $api;
|
||||
}
|
||||
|
||||
public function init(){
|
||||
$this->api->console->register("example", "Example command", array($this, "handleCommand"));
|
||||
}
|
||||
|
||||
public function handleCommand($cmd, $arg){
|
||||
switch($cmd){
|
||||
case "example":
|
||||
console("EXAMPLE!!!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue