Removed useless confusing array indices in CompoundTag constructors (#1116)

This commit is contained in:
Dylan K. Taylor
2017-06-20 12:11:24 +01:00
committed by GitHub
parent e11f1e94e9
commit a4b8dd43e6
14 changed files with 111 additions and 112 deletions

View File

@ -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()){