mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +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{
|
||||
$next = $this->forms[$formId]->handleResponse($this, $responseData);
|
||||
if($next !== null){
|
||||
$this->sendForm($next);
|
||||
}
|
||||
$this->forms[$formId]->handleResponse($this, $responseData);
|
||||
}catch(FormValidationException $e){
|
||||
$this->server->getLogger()->critical("Failed to validate form " . get_class($this->forms[$formId]) . ": " . $e->getMessage());
|
||||
$this->server->getLogger()->logException($e);
|
||||
|
@ -37,8 +37,7 @@ interface Form extends \JsonSerializable{
|
||||
* @param Player $player
|
||||
* @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
|
||||
* @throws FormValidationException if the data could not be processed
|
||||
*/
|
||||
public function handleResponse(Player $player, $data) : ?Form;
|
||||
public function handleResponse(Player $player, $data) : void;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user