mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Changes made to be compatible with the DevTools plugin
This commit is contained in:
parent
717c668787
commit
874571d572
@ -25,8 +25,12 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/src/dependencies.php");
|
|
||||||
require_once("API/ServerAPI.php");
|
/***REM_START***/
|
||||||
|
require_once(dirname(__FILE__)."/src/config.php");
|
||||||
|
require_once(FILE_PATH."/src/functions.php");
|
||||||
|
require_once(FILE_PATH."/src/dependencies.php");
|
||||||
|
/***REM_END***/
|
||||||
|
|
||||||
$server = new ServerAPI();
|
$server = new ServerAPI();
|
||||||
$server->run();//$server->start();
|
$server->run();//$server->start();
|
||||||
|
@ -192,18 +192,18 @@ class ServerAPI{
|
|||||||
$this->loadProperties();
|
$this->loadProperties();
|
||||||
$this->server->loadMap();
|
$this->server->loadMap();
|
||||||
|
|
||||||
//Autoload all default APIs
|
|
||||||
console("[INFO] Loading default APIs");
|
console("[INFO] Loading default APIs");
|
||||||
$dir = dir(FILE_PATH."src/API/");
|
|
||||||
while(false !== ($file = $dir->read())){
|
$this->loadAPI("console", "ConsoleAPI");
|
||||||
if($file{0} !== "."){ //Hidden and upwards folders
|
$this->loadAPI("level", "LevelAPI");
|
||||||
$API = basename($file, ".php");
|
$this->loadAPI("block", "BlockAPI");
|
||||||
if(strtolower($API) !== "serverapi" and strtolower($API) !== "pluginapi"){
|
$this->loadAPI("chat", "ChatAPI");
|
||||||
$name = strtolower(substr($API, 0, -3));
|
$this->loadAPI("ban", "BanAPI");
|
||||||
$this->loadAPI($name, $API);
|
$this->loadAPI("entity", "EntityAPI");
|
||||||
}
|
$this->loadAPI("tileentity", "TileEntityAPI");
|
||||||
}
|
$this->loadAPI("player", "PlayerAPI");
|
||||||
}
|
$this->loadAPI("time", "TimeAPI");
|
||||||
|
|
||||||
foreach($this->apiList as $ob){
|
foreach($this->apiList as $ob){
|
||||||
if(is_callable(array($ob, "init"))){
|
if(is_callable(array($ob, "init"))){
|
||||||
$ob->init(); //Fails sometimes!!!
|
$ob->init(); //Fails sometimes!!!
|
||||||
@ -448,6 +448,9 @@ class ServerAPI{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function loadAPI($name, $class, $dir = false){
|
public function loadAPI($name, $class, $dir = false){
|
||||||
|
if(isset($this->$name)){
|
||||||
|
return false;
|
||||||
|
}elseif(!class_exists($class)){
|
||||||
if($dir === false){
|
if($dir === false){
|
||||||
$dir = FILE_PATH."src/API/";
|
$dir = FILE_PATH."src/API/";
|
||||||
}
|
}
|
||||||
@ -457,6 +460,7 @@ class ServerAPI{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
require_once($file);
|
require_once($file);
|
||||||
|
}
|
||||||
$this->$name = new $class($this->server);
|
$this->$name = new $class($this->server);
|
||||||
$this->apiList[] = $this->$name;
|
$this->apiList[] = $this->$name;
|
||||||
console("[INFO] API \x1b[36m".$name."\x1b[0m [\x1b[30;1m".$class."\x1b[0m] loaded");
|
console("[INFO] API \x1b[36m".$name."\x1b[0m [\x1b[30;1m".$class."\x1b[0m] loaded");
|
||||||
|
@ -32,8 +32,8 @@ error_reporting(E_ALL ^ E_NOTICE);
|
|||||||
ini_set("allow_url_fopen", 1);
|
ini_set("allow_url_fopen", 1);
|
||||||
ini_set("display_errors", 1);
|
ini_set("display_errors", 1);
|
||||||
ini_set('default_charset', 'utf-8');
|
ini_set('default_charset', 'utf-8');
|
||||||
define("FILE_PATH", dirname(__FILE__)."/../");
|
define("FILE_PATH", dirname(get_included_files()[0])."/");
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH . PATH_SEPARATOR . FILE_PATH . "/src/" . PATH_SEPARATOR . FILE_PATH . "/src/classes/");
|
set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH);
|
||||||
ini_set("memory_limit", "256M");
|
ini_set("memory_limit", "256M");
|
||||||
define("LOG", true);
|
define("LOG", true);
|
||||||
define("MAGIC", "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78");
|
define("MAGIC", "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78");
|
||||||
|
@ -25,8 +25,11 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/***REM_START***/
|
||||||
require_once(dirname(__FILE__)."/config.php");
|
require_once(dirname(__FILE__)."/config.php");
|
||||||
require_once(dirname(__FILE__)."/functions.php");
|
require_once(FILE_PATH."/src/functions.php");
|
||||||
|
/***REM_END***/
|
||||||
|
|
||||||
if(strpos(strtoupper(php_uname("s")), "WIN") === false or arg("enable-ansi", false) === true){
|
if(strpos(strtoupper(php_uname("s")), "WIN") === false or arg("enable-ansi", false) === true){
|
||||||
define("ENABLE_ANSI", true);
|
define("ENABLE_ANSI", true);
|
||||||
}else{
|
}else{
|
||||||
@ -81,6 +84,9 @@ if($errors > 0){
|
|||||||
exit(1); //Exit with error
|
exit(1); //Exit with error
|
||||||
}
|
}
|
||||||
|
|
||||||
require_all(FILE_PATH . "src/classes/");
|
/***REM_START***/
|
||||||
|
require_all(FILE_PATH . "src/");
|
||||||
|
/***REM_END***/
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
@ -25,8 +25,6 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("classes/material/IDs.php");
|
|
||||||
|
|
||||||
abstract class Block{
|
abstract class Block{
|
||||||
public static $class = array(
|
public static $class = array(
|
||||||
AIR => "AirBlock",
|
AIR => "AirBlock",
|
||||||
@ -199,6 +197,7 @@ abstract class Block{
|
|||||||
abstract function onUpdate(BlockAPI $level, $type);
|
abstract function onUpdate(BlockAPI $level, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***REM_START***/
|
||||||
require_once("block/GenericBlock.php");
|
require_once("block/GenericBlock.php");
|
||||||
require_once("block/SolidBlock.php");
|
require_once("block/SolidBlock.php");
|
||||||
require_once("block/TransparentBlock.php");
|
require_once("block/TransparentBlock.php");
|
||||||
@ -206,3 +205,4 @@ require_once("block/FallableBlock.php");
|
|||||||
require_once("block/LiquidBlock.php");
|
require_once("block/LiquidBlock.php");
|
||||||
require_once("block/StairBlock.php");
|
require_once("block/StairBlock.php");
|
||||||
require_once("block/DoorBlock.php");
|
require_once("block/DoorBlock.php");
|
||||||
|
/***REM_END***/
|
@ -25,8 +25,6 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("classes/material/IDs.php");
|
|
||||||
|
|
||||||
class Item{
|
class Item{
|
||||||
public static $class = array(
|
public static $class = array(
|
||||||
SUGARCANE => "SugarcaneItem",
|
SUGARCANE => "SugarcaneItem",
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user