From 5c00b415a5c95f40b7e5b8b3184e0dd0aabcac74 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 6 Mar 2014 17:24:26 +0100 Subject: [PATCH] typos --- src/nbt/NBT.php | 4 ---- src/nbt/tag/Compound.php | 7 +++++++ src/nbt/tag/Enum.php | 12 +++++++----- src/utils/pthreads.php | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/nbt/NBT.php b/src/nbt/NBT.php index 9b1aab2bf..b5d0d3bc4 100644 --- a/src/nbt/NBT.php +++ b/src/nbt/NBT.php @@ -92,10 +92,6 @@ class NBT implements \ArrayAccess{ public function readTag(){ switch($this->getByte()){ - case NBT\TAG_Byte: - $tag = new Byte($this->getString()); - $tag->read($this); - break; case NBT\TAG_Byte: $tag = new Byte($this->getString()); $tag->read($this); diff --git a/src/nbt/tag/Compound.php b/src/nbt/tag/Compound.php index 780ce18b0..c8daaa8d7 100644 --- a/src/nbt/tag/Compound.php +++ b/src/nbt/tag/Compound.php @@ -26,6 +26,13 @@ use PocketMine\NBT; class Compound extends NamedNBTTag implements \ArrayAccess, \Iterator{ + public function __construct($name = "", $value = array()){ + $this->name = $name; + if($value !== false){ + $this->value = $value; + } + } + public function getType(){ return NBT\TAG_Compound; } diff --git a/src/nbt/tag/Enum.php b/src/nbt/tag/Enum.php index 0b678fec9..c3181438a 100644 --- a/src/nbt/tag/Enum.php +++ b/src/nbt/tag/Enum.php @@ -29,6 +29,13 @@ class Enum extends NamedNBTTag implements \ArrayAccess, \Iterator{ private $tagType; + public function __construct($name = "", $value = array()){ + $this->name = $name; + if($value !== false){ + $this->value = $value; + } + } + public function getType(){ return NBT\TAG_Enum; } @@ -110,11 +117,6 @@ class Enum extends NamedNBTTag implements \ArrayAccess, \Iterator{ $size = $nbt->getInt(); for($i = 0; $i < $size and !$nbt->feof(); ++$i){ switch($this->tagType){ - case NBT\TAG_Byte: - $tag = new Byte(false); - $tag->read($nbt); - $this->value[] = $tag; - break; case NBT\TAG_Byte: $tag = new Byte(false); $tag->read($nbt); diff --git a/src/utils/pthreads.php b/src/utils/pthreads.php index aeca2db8b..1551f2e82 100644 --- a/src/utils/pthreads.php +++ b/src/utils/pthreads.php @@ -141,6 +141,6 @@ class Async extends Thread{ $this->join(); } - return $this->result; + return (string) $this->result; } } \ No newline at end of file