mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Added preprocessor optimizations
This commit is contained in:
@ -41,6 +41,8 @@ use pocketmine\nbt\tag\Tag;
|
||||
use pocketmine\utils\Binary;
|
||||
use pocketmine\utils\Utils;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
/**
|
||||
* Named Binary Tag encoder/decoder
|
||||
*/
|
||||
@ -61,7 +63,7 @@ class NBT{
|
||||
const TAG_Compound = 10;
|
||||
const TAG_IntArray = 11;
|
||||
|
||||
private $buffer;
|
||||
public $buffer;
|
||||
private $offset;
|
||||
public $endianness;
|
||||
private $data;
|
||||
@ -191,8 +193,8 @@ class NBT{
|
||||
$tag->write($this);
|
||||
}
|
||||
|
||||
public function getByte($signed = false){
|
||||
return Binary::readByte($this->get(1), $signed);
|
||||
public function getByte(){
|
||||
return Binary::readByte($this->get(1));
|
||||
}
|
||||
|
||||
public function putByte($v){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Byte extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
@ -30,7 +32,7 @@ class Byte extends NamedTag{
|
||||
}
|
||||
|
||||
public function read(NBT $nbt){
|
||||
$this->value = $nbt->getByte(true);
|
||||
$this->value = $nbt->getByte();
|
||||
}
|
||||
|
||||
public function write(NBT $nbt){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class ByteArray extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Compound extends NamedTag implements \ArrayAccess{
|
||||
|
||||
public function __construct($name = "", $value = []){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Double extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -24,6 +24,8 @@ namespace pocketmine\nbt\tag;
|
||||
use pocketmine\nbt\NBT;
|
||||
use pocketmine\nbt\tag\Enum as TagEnum;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Enum extends NamedTag implements \ArrayAccess, \Countable{
|
||||
|
||||
private $tagType;
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Float extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Int extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class IntArray extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Long extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class Short extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
@ -23,6 +23,8 @@ namespace pocketmine\nbt\tag;
|
||||
|
||||
use pocketmine\nbt\NBT;
|
||||
|
||||
#include <rules/NBT.h>
|
||||
|
||||
class String extends NamedTag{
|
||||
|
||||
public function getType(){
|
||||
|
Reference in New Issue
Block a user