mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 02:21:46 +00:00
Added LE Triad methods
This commit is contained in:
parent
fd46c71120
commit
92eb5cb0b8
@ -55,6 +55,28 @@ class Binary{
|
|||||||
return substr(pack("N", $value), 1);
|
return substr(pack("N", $value), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads a 3-byte little-endian number
|
||||||
|
*
|
||||||
|
* @param $str
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function readLTriad($str){
|
||||||
|
return unpack("V", $str . "\x00")[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes a 3-byte little-endian number
|
||||||
|
*
|
||||||
|
* @param $value
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function writeLTriad($value){
|
||||||
|
return substr(pack("N", $value), 0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes a coded metadata string
|
* Writes a coded metadata string
|
||||||
* TODO: Replace and move this to entity
|
* TODO: Replace and move this to entity
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit b8b6bec561768816a2f4acff07c2ccceda3d123a
|
Subproject commit a0e5de5b8e2198d4f7e0329fcf60650252a1e91d
|
Loading…
x
Reference in New Issue
Block a user