mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-22 10:56:35 +00:00
Entity: Avoid using close() during initEntity()
this simply conceals bugs and will cause astonishing behaviour.
This commit is contained in:
parent
85136b7b4a
commit
8e5aca70b4
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user