mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-22 19:06: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){
|
if($blockId === 0){
|
||||||
$this->close();
|
throw new \UnexpectedValueException("Invalid " . get_class($this) . " entity: block ID is 0 or missing");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$damage = $this->namedtag->getByte("Data", 0);
|
$damage = $this->namedtag->getByte("Data", 0);
|
||||||
|
@ -66,8 +66,7 @@ class ItemEntity extends Entity{
|
|||||||
|
|
||||||
$itemTag = $this->namedtag->getCompoundTag("Item");
|
$itemTag = $this->namedtag->getCompoundTag("Item");
|
||||||
if($itemTag === null){
|
if($itemTag === null){
|
||||||
$this->close();
|
throw new \UnexpectedValueException("Invalid " . get_class($this) . " entity: expected \"Item\" NBT tag not found");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->item = Item::nbtDeserialize($itemTag);
|
$this->item = Item::nbtDeserialize($itemTag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user