mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Removed $server constructor arguments because of ServerAPI::request()
This commit is contained in:
parent
af52b0a5b5
commit
6d39f54591
@ -32,8 +32,8 @@ class BanAPI{
|
|||||||
private $ops;
|
private $ops;
|
||||||
private $bannedIPs;
|
private $bannedIPs;
|
||||||
private $cmdWL = array();
|
private $cmdWL = array();
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
|
@ -112,8 +112,8 @@ class BlockAPI{
|
|||||||
return $this->getBlock($block->getSide($face));
|
return $this->getBlock($block->getSide($face));
|
||||||
}
|
}
|
||||||
|
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
class ChatAPI{
|
class ChatAPI{
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
|
@ -27,11 +27,11 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
class ConsoleAPI{
|
class ConsoleAPI{
|
||||||
private $loop, $server, $event, $help, $cmds, $alias;
|
private $loop, $server, $event, $help, $cmds, $alias;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->help = array();
|
$this->help = array();
|
||||||
$this->cmds = array();
|
$this->cmds = array();
|
||||||
$this->alias = array();
|
$this->alias = array();
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
$this->last = microtime(true);
|
$this->last = microtime(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
class EntityAPI{
|
class EntityAPI{
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get($eid){
|
public function get($eid){
|
||||||
@ -60,7 +60,7 @@ class EntityAPI{
|
|||||||
|
|
||||||
public function add($class, $type = 0, $data = array()){
|
public function add($class, $type = 0, $data = array()){
|
||||||
$eid = $this->server->eidCnt++;
|
$eid = $this->server->eidCnt++;
|
||||||
$this->server->entities[$eid] = new Entity($this->server, $eid, $class, $type, $data);
|
$this->server->entities[$eid] = new Entity($eid, $class, $type, $data);
|
||||||
$this->server->handle("entity.add", $this->server->entities[$eid]);
|
$this->server->handle("entity.add", $this->server->entities[$eid]);
|
||||||
return $this->server->entities[$eid];
|
return $this->server->entities[$eid];
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
class LevelAPI{
|
class LevelAPI{
|
||||||
private $server, $map;
|
private $server, $map;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
$this->map = $this->server->map;
|
$this->map = $this->server->map;
|
||||||
$this->heightMap = array_fill(0, 256, array());
|
$this->heightMap = array_fill(0, 256, array());
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
class PlayerAPI{
|
class PlayerAPI{
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
|
@ -28,8 +28,8 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
class PluginAPI extends stdClass{
|
class PluginAPI extends stdClass{
|
||||||
private $server;
|
private $server;
|
||||||
private $plugins = array();
|
private $plugins = array();
|
||||||
public function __construct(PocketMinecraftServer $server){
|
public function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getList(){
|
public function getList(){
|
||||||
|
@ -474,7 +474,7 @@ class ServerAPI{
|
|||||||
}else{
|
}else{
|
||||||
$internal = true;
|
$internal = true;
|
||||||
}
|
}
|
||||||
$this->$name = new $class($this->server);
|
$this->$name = new $class();
|
||||||
$this->apiList[] = $this->$name;
|
$this->apiList[] = $this->$name;
|
||||||
console("[".($internal === true ? "DEBUG":"INFO")."] API \x1b[36m".$name."\x1b[0m [\x1b[30;1m".$class."\x1b[0m] loaded", true, true, ($internal === true ? 2:1));
|
console("[".($internal === true ? "DEBUG":"INFO")."] API \x1b[36m".$name."\x1b[0m [\x1b[30;1m".$class."\x1b[0m] loaded", true, true, ($internal === true ? 2:1));
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
class TileEntityAPI{
|
class TileEntityAPI{
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get($x, $y = false, $z = false){
|
public function get($x, $y = false, $z = false){
|
||||||
@ -77,7 +77,7 @@ class TileEntityAPI{
|
|||||||
|
|
||||||
public function add($class, $x, $y, $z, $data = array()){
|
public function add($class, $x, $y, $z, $data = array()){
|
||||||
$id = $this->tCnt++;
|
$id = $this->tCnt++;
|
||||||
$this->server->tileEntities[$id] = new TileEntity($this->server, $id, $class, $x, $y, $z, $data);
|
$this->server->tileEntities[$id] = new TileEntity($id, $class, $x, $y, $z, $data);
|
||||||
$this->spawnToAll($id);
|
$this->spawnToAll($id);
|
||||||
return $this->server->tileEntities[$id];
|
return $this->server->tileEntities[$id];
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ class TimeAPI{
|
|||||||
"sunrise" => 17800,
|
"sunrise" => 17800,
|
||||||
);
|
);
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server){
|
function __construct(){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
|
@ -61,9 +61,9 @@ class Player{
|
|||||||
private $chunksLoaded = array();
|
private $chunksLoaded = array();
|
||||||
private $chunksOrder = array();
|
private $chunksOrder = array();
|
||||||
|
|
||||||
function __construct(PocketMinecraftServer $server, $clientID, $ip, $port, $MTU){
|
function __construct($clientID, $ip, $port, $MTU){
|
||||||
$this->MTU = $MTU;
|
$this->MTU = $MTU;
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
$this->lastBreak = microtime(true);
|
$this->lastBreak = microtime(true);
|
||||||
$this->clientID = $clientID;
|
$this->clientID = $clientID;
|
||||||
$this->CID = $this->server->clientID($ip, $port);
|
$this->CID = $this->server->clientID($ip, $port);
|
||||||
@ -616,6 +616,7 @@ class Player{
|
|||||||
case MC_KEEP_ALIVE:
|
case MC_KEEP_ALIVE:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case 0x01:
|
||||||
case 0x03:
|
case 0x03:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -619,7 +619,7 @@ class PocketMinecraftServer{
|
|||||||
$port = $data[2];
|
$port = $data[2];
|
||||||
$MTU = $data[3];
|
$MTU = $data[3];
|
||||||
$clientID = $data[4];
|
$clientID = $data[4];
|
||||||
$this->clients[$CID] = new Player($this, $clientID, $packet["ip"], $packet["port"], $MTU); //New Session!
|
$this->clients[$CID] = new Player($clientID, $packet["ip"], $packet["port"], $MTU); //New Session!
|
||||||
$this->clients[$CID]->handle(0x07, $data);
|
$this->clients[$CID]->handle(0x07, $data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ define("WINDOW_FURNACE", 2);
|
|||||||
|
|
||||||
class Window{
|
class Window{
|
||||||
private $server;
|
private $server;
|
||||||
public function __construct(PocketMinecraftServer $server){
|
public function __construct(){
|
||||||
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
class TickLoop extends Thread{
|
class TickLoop extends Thread{
|
||||||
public $tick, $stop, $lastTic;
|
public $tick, $stop, $lastTic;
|
||||||
private $server;
|
private $server;
|
||||||
public function __construct(PocketMinecraftServer $server){
|
public function __construct(){
|
||||||
$this->tick = false;
|
$this->tick = false;
|
||||||
$this->lastTick = 0;
|
$this->lastTick = 0;
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
}
|
}
|
||||||
public function run(){
|
public function run(){
|
||||||
while($this->stop !== true){
|
while($this->stop !== true){
|
||||||
|
@ -74,10 +74,10 @@ class Entity extends stdClass{
|
|||||||
private $tickCounter;
|
private $tickCounter;
|
||||||
private $speedMeasure = array(0, 0, 0, 0, 0);
|
private $speedMeasure = array(0, 0, 0, 0, 0);
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server, $eid, $class, $type = 0, $data = array()){
|
function __construct($eid, $class, $type = 0, $data = array()){
|
||||||
$this->fallY = false;
|
$this->fallY = false;
|
||||||
$this->fallStart = false;
|
$this->fallStart = false;
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
$this->eid = (int) $eid;
|
$this->eid = (int) $eid;
|
||||||
$this->type = (int) $type;
|
$this->type = (int) $type;
|
||||||
$this->class = (int) $class;
|
$this->class = (int) $class;
|
||||||
|
@ -45,8 +45,8 @@ class TileEntity extends stdClass{
|
|||||||
public $metadata;
|
public $metadata;
|
||||||
public $closed;
|
public $closed;
|
||||||
private $server;
|
private $server;
|
||||||
function __construct(PocketMinecraftServer $server, $id, $class, $x, $y, $z, $data = array()){
|
function __construct($id, $class, $x, $y, $z, $data = array()){
|
||||||
$this->server = $server;
|
$this->server = ServerAPI::request();
|
||||||
$this->normal = true;
|
$this->normal = true;
|
||||||
$this->class = $class;
|
$this->class = $class;
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user