Solved I think it's a serious error. Please fix this error.

Discussion in 'Help' started by LEADTV, Jul 7, 2019.

  1. LEADTV

    LEADTV Creeper

    Messages:
    1
    GitHub:
    MinecraftLEAD
    Error:
    2019-07-07 [22:47:19.699] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\event\server\DataPacketReceiveEvent::getPlayer()" (EXCEPTION) in "plugins/FPS/src/LEADTV/FPS/FPS" at line 322
    2019-07-07 [22:47:19.699] [Server thread/DEBUG]: #0 src/pocketmine/event/RegisteredListener(88): LEADTV\FPS\FPS->onReceive(object pocketmine\event\server\DataPacketReceiveEvent)
    2019-07-07 [22:47:19.700] [Server thread/DEBUG]: #1 src/pocketmine/event/Event(67): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\server\DataPacketReceiveEvent)
    2019-07-07 [22:47:19.701] [Server thread/DEBUG]: #2 src/pocketmine/network/mcpe/NetworkSession(342): pocketmine\event\Event->call()
    2019-07-07 [22:47:19.701] [Server thread/DEBUG]: #3 src/pocketmine/network/mcpe/NetworkSession(309): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\ModalFormResponsePacket)
    2019-07-07 [22:47:19.702] [Server thread/DEBUG]: #4 src/pocketmine/network/mcpe/raklib/RakLibInterface(151): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[42] x.SN.4.U.Z....\[email protected])
    2019-07-07 [22:47:19.702] [Server thread/DEBUG]: #5 vendor/pocketmine/raklib/src/server/ServerHandler(102): pocketmine\network\mcpe\raklib\RakLibInterface->handleEncapsulated(integer 0, object raklib\protocol\EncapsulatedPacket, integer 0)
    2019-07-07 [22:47:19.702] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/raklib/RakLibInterface(95): raklib\server\ServerHandler->handlePacket()
    2019-07-07 [22:47:19.703] [Server thread/DEBUG]: #7 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib\{closure}()
    2019-07-07 [22:47:19.703] [Server thread/DEBUG]: #8 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
    2019-07-07 [22:47:19.703] [Server thread/DEBUG]: #9 src/pocketmine/Server(1776): pocketmine\snooze\SleeperHandler->sleepUntil(double 1562505439.7305)
    2019-07-07 [22:47:19.703] [Server thread/DEBUG]: #10 src/pocketmine/Server(1307): pocketmine\Server->tickProcessor()
    2019-07-07 [22:47:19.704] [Server thread/DEBUG]: #11 src/pocketmine/PocketMine(275): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[27] C:\Users\0w0\Desktop\MoonX\, string[35] C:\Users\0w0\Desktop\MoonX\plugins\)

    Source:

    public function onReceive(DataPacketReceiveEvent $event){
    $packet = $event->getPacket();
    if($packet instanceof ModalFormResponsePacket){
    if ($packet->formId == 86002){
    $data = json_decode($packet->formData, true);
    if(is_null($data)) return true;
    $player = $event->getPlayer();
    $name = strtolower($player->getName());
    $this->receive($player, 86002, $data);
    }
    }
    }
    public function receive(Player $player, $formId, $data){
    $name = $player->getName();
    if ($formId === 86002){
    if ($data[0] == null || $data[1] == null || $data[2] == null || $data[3] == null || $data[4] == null || $data[5] == null){
    $player->addTitle("§c§l✗", "§f제대로 입력 해주세요.");
    //$player->getWorld()->addSound(new ClickSound(new Vector3($player->getX(), $player->getY(), $player->getZ())));
    }
    if ($data[4] == false){
    $data[4] = "X";
    } else {
    $data[4] = "O";
    }

    $this->db["guns"][$data[0]] = [];
    $this->db["guns"][$data[0]]["name"] = $data[0];
    $this->db["guns"][$data[0]]["max"] = (int) $data[2];
    $this->db["guns"][$data[0]]["tier"] = $data[1];
    $this->db["guns"][$data[0]]["return"] = (int) $data[3];
    $this->db["guns"][$data[0]]["multi"] = $data[4];
    $this->db["guns"][$data[0]]["shoot"] = (int) $data[5];
    $this->save();

    $it = $this->db["guns"][$data[0]];

    $item = $player->getInventory()->getItemInHand();

    $lore = $item->getLore();
    $lore[] = "§a≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡";
    $lore[] = "§f• §c이름: §f".$it["name"];
    $lore[] = "§f• §c등급: §f".$it["tier"];
    $lore[] = "§f• §c연발 여부: §f".$it["multi"];
    $lore[] = "§f• §c최대 탄창: §f".$it["max"]." 발";
    $lore[] = "§f• §c장전 시간: §f".$it["return"]." 초";
    $lore[] = "§a≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡";

    $item->setNamedTagEntry(new StringTag(self::NAMED_TAG, $data[0]));
    $item->setLore($lore);
    $player->getInventory()->addItem($item);
    //$player->getWorld()->addSound(new TotemUseSound(new Vector3($player->getX(), $player->getY(), $player->getZ())));
    $player->addTitle("§a§l√", "§f성공적으로 실행 되었습니다.");
    }
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.