public function onAccepted() { /** @var Faction $to */ $to = $this->getTo(); $this->from->getMain()->getFList()->setFactionsState(new State($this->from, $to, $this->state)); $this->from->sendMessage($to->getDisplayName() . " accepted the request to be " . $this->getState() . " factions."); $to->sendMessage("You are now " . $this->getState() . " factions with " . $this->from->getDisplayName() . "."); }