Entity: Avoid using close() during initEntity()

this simply conceals bugs and will cause astonishing behaviour.
This commit is contained in:
Dylan K. Taylor 2018-06-09 17:06:15 +01:00
parent 85136b7b4a
commit 8e5aca70b4
2 changed files with 2 additions and 4 deletions

View File

@ -64,8 +64,7 @@ class FallingBlock extends Entity{
}
if($blockId === 0){
$this->close();
return;
throw new \UnexpectedValueException("Invalid " . get_class($this) . " entity: block ID is 0 or missing");
}
$damage = $this->namedtag->getByte("Data", 0);

View File

@ -66,8 +66,7 @@ class ItemEntity extends Entity{
$itemTag = $this->namedtag->getCompoundTag("Item");
if($itemTag === null){
$this->close();
return;
throw new \UnexpectedValueException("Invalid " . get_class($this) . " entity: expected \"Item\" NBT tag not found");
}
$this->item = Item::nbtDeserialize($itemTag);