mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Fixed NBT IntArray off-by-one reading
This commit is contained in:
parent
807107e581
commit
220d2b7bee
@ -34,7 +34,10 @@ class IntArray extends NamedTag{
|
||||
public function read(NBT $nbt){
|
||||
$this->value = [];
|
||||
$size = $nbt->getInt();
|
||||
$this->value = unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4));
|
||||
$value = unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4));
|
||||
foreach($value as $i => $v){
|
||||
$this->value[$i - 1] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
public function write(NBT $nbt){
|
||||
|
Loading…
x
Reference in New Issue
Block a user