mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Clean up nonsensical code in NetworkBinaryStream->getSlot()
This commit is contained in:
parent
26155acff2
commit
6869ee1c2d
@ -238,18 +238,15 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
if($nbt->hasTag(self::DAMAGE_TAG, IntTag::class)){
|
||||
$meta = $nbt->getInt(self::DAMAGE_TAG);
|
||||
$nbt->removeTag(self::DAMAGE_TAG);
|
||||
if($nbt->count() === 0){
|
||||
if(($conflicted = $nbt->getTag(self::DAMAGE_TAG_CONFLICT_RESOLUTION)) !== null){
|
||||
$nbt->removeTag(self::DAMAGE_TAG_CONFLICT_RESOLUTION);
|
||||
$conflicted->setName(self::DAMAGE_TAG);
|
||||
$nbt->setTag($conflicted);
|
||||
}elseif($nbt->count() === 0){
|
||||
$nbt = null;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
if(($conflicted = $nbt->getTag(self::DAMAGE_TAG_CONFLICT_RESOLUTION)) !== null){
|
||||
$nbt->removeTag(self::DAMAGE_TAG_CONFLICT_RESOLUTION);
|
||||
$conflicted->setName(self::DAMAGE_TAG);
|
||||
$nbt->setTag($conflicted);
|
||||
}
|
||||
}
|
||||
end:
|
||||
return ItemFactory::get($id, $meta, $cnt, $nbt);
|
||||
}
|
||||
|
||||
|
@ -1440,21 +1440,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/level/light/SkyLightUpdate.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getTag\\(\\) on pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\|null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/NetworkBinaryStream.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method removeTag\\(\\) on pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\|null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/NetworkBinaryStream.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method setTag\\(\\) on pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\|null\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/NetworkBinaryStream.php
|
||||
|
||||
-
|
||||
message: "#^Argument of an invalid type array\\<pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\>\\|null supplied for foreach, only iterables are supported\\.$#"
|
||||
count: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user