mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Fixed NBT parsing on false properties
This commit is contained in:
@ -142,7 +142,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
if($hotbarSlot !== -1){
|
||||
$item = $this->inventory->getItem($hotbarSlot);
|
||||
if($item->getId() !== 0 and $item->getCount() > 0){
|
||||
$this->namedtag->Inventory[$slot] = new Compound(false, [
|
||||
$this->namedtag->Inventory[$slot] = new Compound("", [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
new Byte("Slot", $slot),
|
||||
@ -152,7 +152,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$this->namedtag->Inventory[$slot] = new Compound(false, [
|
||||
$this->namedtag->Inventory[$slot] = new Compound("", [
|
||||
new Byte("Count", 0),
|
||||
new Short("Damage", 0),
|
||||
new Byte("Slot", $slot),
|
||||
@ -166,7 +166,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
//$slotCount = (($this instanceof Player and ($this->gamemode & 0x01) === 1) ? Player::CREATIVE_SLOTS : Player::SURVIVAL_SLOTS) + 9;
|
||||
for($slot = 9; $slot < $slotCount; ++$slot){
|
||||
$item = $this->inventory->getItem($slot - 9);
|
||||
$this->namedtag->Inventory[$slot] = new Compound(false, [
|
||||
$this->namedtag->Inventory[$slot] = new Compound("", [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
new Byte("Slot", $slot),
|
||||
@ -178,7 +178,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
for($slot = 100; $slot < 104; ++$slot){
|
||||
$item = $this->inventory->getItem($this->inventory->getSize() + $slot - 100);
|
||||
if($item instanceof ItemItem and $item->getId() !== ItemItem::AIR){
|
||||
$this->namedtag->Inventory[$slot] = new Compound(false, [
|
||||
$this->namedtag->Inventory[$slot] = new Compound("", [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
new Byte("Slot", $slot),
|
||||
|
Reference in New Issue
Block a user