mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +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 $bannedIPs;
|
||||
private $cmdWL = array();
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
@ -112,8 +112,8 @@ class BlockAPI{
|
||||
return $this->getBlock($block->getSide($face));
|
||||
}
|
||||
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class ChatAPI{
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
@ -27,11 +27,11 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class ConsoleAPI{
|
||||
private $loop, $server, $event, $help, $cmds, $alias;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
function __construct(){
|
||||
$this->help = array();
|
||||
$this->cmds = array();
|
||||
$this->alias = array();
|
||||
$this->server = $server;
|
||||
$this->server = ServerAPI::request();
|
||||
$this->last = microtime(true);
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class EntityAPI{
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function get($eid){
|
||||
@ -60,7 +60,7 @@ class EntityAPI{
|
||||
|
||||
public function add($class, $type = 0, $data = array()){
|
||||
$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]);
|
||||
return $this->server->entities[$eid];
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class LevelAPI{
|
||||
private $server, $map;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
$this->map = $this->server->map;
|
||||
$this->heightMap = array_fill(0, 256, array());
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class PlayerAPI{
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
@ -28,8 +28,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
class PluginAPI extends stdClass{
|
||||
private $server;
|
||||
private $plugins = array();
|
||||
public function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
public function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
|
@ -474,7 +474,7 @@ class ServerAPI{
|
||||
}else{
|
||||
$internal = true;
|
||||
}
|
||||
$this->$name = new $class($this->server);
|
||||
$this->$name = new $class();
|
||||
$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));
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class TileEntityAPI{
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function get($x, $y = false, $z = false){
|
||||
@ -77,7 +77,7 @@ class TileEntityAPI{
|
||||
|
||||
public function add($class, $x, $y, $z, $data = array()){
|
||||
$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);
|
||||
return $this->server->tileEntities[$id];
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ class TimeAPI{
|
||||
"sunrise" => 17800,
|
||||
);
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server){
|
||||
$this->server = $server;
|
||||
function __construct(){
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
@ -61,9 +61,9 @@ class Player{
|
||||
private $chunksLoaded = array();
|
||||
private $chunksOrder = array();
|
||||
|
||||
function __construct(PocketMinecraftServer $server, $clientID, $ip, $port, $MTU){
|
||||
function __construct($clientID, $ip, $port, $MTU){
|
||||
$this->MTU = $MTU;
|
||||
$this->server = $server;
|
||||
$this->server = ServerAPI::request();
|
||||
$this->lastBreak = microtime(true);
|
||||
$this->clientID = $clientID;
|
||||
$this->CID = $this->server->clientID($ip, $port);
|
||||
@ -616,6 +616,7 @@ class Player{
|
||||
case MC_KEEP_ALIVE:
|
||||
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x03:
|
||||
|
||||
break;
|
||||
|
@ -619,7 +619,7 @@ class PocketMinecraftServer{
|
||||
$port = $data[2];
|
||||
$MTU = $data[3];
|
||||
$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);
|
||||
break;
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ define("WINDOW_FURNACE", 2);
|
||||
|
||||
class Window{
|
||||
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{
|
||||
public $tick, $stop, $lastTic;
|
||||
private $server;
|
||||
public function __construct(PocketMinecraftServer $server){
|
||||
public function __construct(){
|
||||
$this->tick = false;
|
||||
$this->lastTick = 0;
|
||||
$this->server = $server;
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
public function run(){
|
||||
while($this->stop !== true){
|
||||
|
@ -74,10 +74,10 @@ class Entity extends stdClass{
|
||||
private $tickCounter;
|
||||
private $speedMeasure = array(0, 0, 0, 0, 0);
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server, $eid, $class, $type = 0, $data = array()){
|
||||
function __construct($eid, $class, $type = 0, $data = array()){
|
||||
$this->fallY = false;
|
||||
$this->fallStart = false;
|
||||
$this->server = $server;
|
||||
$this->server = ServerAPI::request();
|
||||
$this->eid = (int) $eid;
|
||||
$this->type = (int) $type;
|
||||
$this->class = (int) $class;
|
||||
|
@ -45,8 +45,8 @@ class TileEntity extends stdClass{
|
||||
public $metadata;
|
||||
public $closed;
|
||||
private $server;
|
||||
function __construct(PocketMinecraftServer $server, $id, $class, $x, $y, $z, $data = array()){
|
||||
$this->server = $server;
|
||||
function __construct($id, $class, $x, $y, $z, $data = array()){
|
||||
$this->server = ServerAPI::request();
|
||||
$this->normal = true;
|
||||
$this->class = $class;
|
||||
$this->data = $data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user