public function onCustomPacketReceiveEvent(\ifteam\CustomPacket\event\CustomPacketReceiveEvent $event) { $receivedData = (array) json_decode($event->getPacket()->data, true); if (is_array($receivedData) && isset($receivedData[3]) && $receivedData[0] == $this->passcode) { $this->caster->receive($receivedData[1], $receivedData[2]); } }
public function __construct($plugin, $passcode, PluginData $db) { if (self::$instance === null) { self::$instance = $this; } parent::__construct(); $this->db = $db; $this->specialCommand = new SpecialCommand(); $this->server = Server::getInstance(); }