mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Removed useless confusing array indices in CompoundTag constructors (#1116)
This commit is contained in:
@ -548,8 +548,8 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
foreach($tag->ench as $k => $entry){
|
||||
if($entry["id"] === $ench->getId()){
|
||||
$tag->ench->{$k} = new CompoundTag("", [
|
||||
"id" => new ShortTag("id", $ench->getId()),
|
||||
"lvl" => new ShortTag("lvl", $ench->getLevel())
|
||||
new ShortTag("id", $ench->getId()),
|
||||
new ShortTag("lvl", $ench->getLevel())
|
||||
]);
|
||||
$found = true;
|
||||
break;
|
||||
@ -558,8 +558,8 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
|
||||
if(!$found){
|
||||
$tag->ench->{count($tag->ench) + 1} = new CompoundTag("", [
|
||||
"id" => new ShortTag("id", $ench->getId()),
|
||||
"lvl" => new ShortTag("lvl", $ench->getLevel())
|
||||
new ShortTag("id", $ench->getId()),
|
||||
new ShortTag("lvl", $ench->getLevel())
|
||||
]);
|
||||
}
|
||||
|
||||
@ -643,7 +643,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
$tag->display->Name = new StringTag("Name", $name);
|
||||
}else{
|
||||
$tag->display = new CompoundTag("display", [
|
||||
"Name" => new StringTag("Name", $name)
|
||||
new StringTag("Name", $name)
|
||||
]);
|
||||
}
|
||||
|
||||
@ -1009,9 +1009,9 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
*/
|
||||
public function nbtSerialize(int $slot = -1, string $tagName = "") : CompoundTag{
|
||||
$tag = new CompoundTag($tagName, [
|
||||
"id" => new ShortTag("id", $this->id),
|
||||
"Count" => new ByteTag("Count", Binary::signByte($this->count)),
|
||||
"Damage" => new ShortTag("Damage", $this->meta),
|
||||
new ShortTag("id", $this->id),
|
||||
new ByteTag("Count", Binary::signByte($this->count)),
|
||||
new ShortTag("Damage", $this->meta),
|
||||
]);
|
||||
|
||||
if($this->hasCompoundTag()){
|
||||
|
Reference in New Issue
Block a user