mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Form: change handleResponse() return type to void
this returning is counter intuitive and doesn't make any sense without the queuing mechanism. Instead it's simpler to just use Player->sendForm().
This commit is contained in:
parent
9d17c9a09d
commit
0dc4bd36e1
@ -3389,10 +3389,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$next = $this->forms[$formId]->handleResponse($this, $responseData);
|
$this->forms[$formId]->handleResponse($this, $responseData);
|
||||||
if($next !== null){
|
|
||||||
$this->sendForm($next);
|
|
||||||
}
|
|
||||||
}catch(FormValidationException $e){
|
}catch(FormValidationException $e){
|
||||||
$this->server->getLogger()->critical("Failed to validate form " . get_class($this->forms[$formId]) . ": " . $e->getMessage());
|
$this->server->getLogger()->critical("Failed to validate form " . get_class($this->forms[$formId]) . ": " . $e->getMessage());
|
||||||
$this->server->getLogger()->logException($e);
|
$this->server->getLogger()->logException($e);
|
||||||
|
@ -37,8 +37,7 @@ interface Form extends \JsonSerializable{
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
* @param mixed $data
|
* @param mixed $data
|
||||||
*
|
*
|
||||||
* @return Form|null a form which will be opened immediately (before queued forms) as a response to this form, or null if not applicable.
|
* @throws FormValidationException if the data could not be processed
|
||||||
* @throws FormValidationException
|
|
||||||
*/
|
*/
|
||||||
public function handleResponse(Player $player, $data) : ?Form;
|
public function handleResponse(Player $player, $data) : void;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user