mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Added Inventory interfaces and types, updated long array() to []
This commit is contained in:
@@ -24,8 +24,8 @@ namespace pocketmine\network\protocol;
|
||||
|
||||
class ContainerSetContentPacket extends DataPacket{
|
||||
public $windowid;
|
||||
public $slots = array();
|
||||
public $hotbar = array();
|
||||
public $slots = [];
|
||||
public $hotbar = [];
|
||||
|
||||
public function pid(){
|
||||
return Info::CONTAINER_SET_CONTENT_PACKET;
|
||||
|
@@ -137,7 +137,7 @@ abstract class DataPacket extends \stdClass{
|
||||
}
|
||||
|
||||
protected function getDataArray($len = 10){
|
||||
$data = array();
|
||||
$data = [];
|
||||
for($i = 1; $i <= $len and !$this->feof(); ++$i){
|
||||
$data[] = $this->get($this->getTriad());
|
||||
}
|
||||
@@ -145,7 +145,7 @@ abstract class DataPacket extends \stdClass{
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function putDataArray(array $data = array()){
|
||||
protected function putDataArray(array $data = []){
|
||||
foreach($data as $v){
|
||||
$this->putTriad(strlen($v));
|
||||
$this->put($v);
|
||||
|
@@ -24,7 +24,7 @@ namespace pocketmine\network\protocol;
|
||||
|
||||
class PlayerArmorEquipmentPacket extends DataPacket{
|
||||
public $eid;
|
||||
public $slots = array();
|
||||
public $slots = [];
|
||||
|
||||
public function pid(){
|
||||
return Info::PLAYER_ARMOR_EQUIPMENT_PACKET;
|
||||
|
@@ -25,8 +25,8 @@ namespace pocketmine\network\protocol;
|
||||
class SendInventoryPacket extends DataPacket{
|
||||
public $eid;
|
||||
public $windowid;
|
||||
public $slots = array();
|
||||
public $armor = array();
|
||||
public $slots = [];
|
||||
public $armor = [];
|
||||
|
||||
public function pid(){
|
||||
return Info::SEND_INVENTORY_PACKET;
|
||||
|
@@ -84,7 +84,7 @@ use pocketmine\utils\Utils;
|
||||
class Packet extends NetworkPacket{
|
||||
private $packetID;
|
||||
private $offset = 1;
|
||||
public $data = array();
|
||||
public $data = [];
|
||||
|
||||
public function __construct($packetID){
|
||||
$this->packetID = (int) $packetID;
|
||||
@@ -172,7 +172,7 @@ class Packet extends NetworkPacket{
|
||||
case Info::DATA_PACKET_E:
|
||||
case Info::DATA_PACKET_F:
|
||||
$this->seqNumber = $this->getLTriad();
|
||||
$this->data = array();
|
||||
$this->data = [];
|
||||
while(!$this->feof() and $this->parseDataPacket() !== false){
|
||||
|
||||
}
|
||||
@@ -180,7 +180,7 @@ class Packet extends NetworkPacket{
|
||||
case Info::NACK:
|
||||
case Info::ACK:
|
||||
$count = $this->getShort();
|
||||
$this->packets = array();
|
||||
$this->packets = [];
|
||||
for($i = 0; $i < $count and !$this->feof(); ++$i){
|
||||
if($this->getByte() === 0){
|
||||
$start = $this->getLTriad();
|
||||
|
@@ -41,7 +41,7 @@ class RCON{
|
||||
private $rconSender;
|
||||
|
||||
public function __construct($password, $port = 19132, $interface = "0.0.0.0", $threads = 1, $clientsPerThread = 50){
|
||||
$this->workers = array();
|
||||
$this->workers = [];
|
||||
$this->password = (string) $password;
|
||||
console("[INFO] Starting remote control listener");
|
||||
if($this->password === ""){
|
||||
|
Reference in New Issue
Block a user