Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server crash to sendHeldItem() to null???

Comments in 'Plugin Development' started by FuryTacticz, Oct 25, 2015.

  1. FuryTacticz
    Offline

    FuryTacticz New Member

    Joined:
    Aug 31, 2015
    Posts:
    23
    Minecraft User:
    FuryTacticz
    Hi guys I was working on a transfer system for my server (with pemapmodders temporary solution for the tranfer bug)

    HERE THE CODE I USE:eek:

    PHP:
    public function onInteractBLUE(PlayerInteractEvent $event) {
                                                
    $player $event->getPlaer();
                                                if(
    $event->getBlock()->getId() == 63 || $event->getBlock()->getId() == 68) {
                                                    
    $sign $event->getPlayer()->getLevel()->getTile($event->getBlock());
                                                        
    $signtext $sign->getText();
                                                            if(
    $signtext[0] === "[CTransfer]") {
                                                                    if(
    $signtext[1] === "[Blue]") {
                                                                        
    $this->ft->transferPlayer($player"78.46.88.244"19152);
                                                                
    $interfaces $this->getServer()->getNetwork()->getInterfaces();
                                                                    foreach(
    $interfaces as $interface){
                                                                        if(
    $interface instanceof RakLibInterface){
                                                                            
    $identifier $player->getAddress() . ":" $player->getPort();
                                                                            
    $interface->closeSession($identifier"transferring");
                                                                        }
                                                                }
                                                                return 
    true;
                                                                }
                                                                    }
                                                            }
                                                }

    HERES THE CRASH DUMP:

    Code:
    PocketMine-MP Crash Dump Sun Oct 25 14:20:21 CET 2015
    
    Error: Call to a member function sendHeldItem() on null
    File: /src/pocketmine/Player__64bit
    Line: 2010
    Type: E_ERROR
    
    Code:
    [2001]                         if($this->level->useItemOn($blockVector, $item, $packet->face, $packet->fx, $packet->fy, $packet->fz, $this)){
    [2002]                             if(!$item->deepEquals($oldItem) or $item->getCount() !== $oldItem->getCount()){
    [2003]                                 $this->inventory->setItemInHand($item);
    [2004]                                 $this->inventory->sendHeldItem($this->hasSpawned);
    [2005]                             }
    [2006]                             break;
    [2007]                         }
    [2008]                     }
    [2009]
    [2010]                     $this->inventory->sendHeldItem($this);
    [2011]
    [2012]                     if($blockVector->distanceSquared($this) > 10000){
    [2013]                         break;
    [2014]                     }
    [2015]                     $target = $this->level->getBlock($blockVector);
    [2016]                     $block = $target->getSide($packet->face);
    [2017]
    [2018]                     $this->level->sendBlocks([$this], [$target, $block], UpdateBlockPacket::FLAG_ALL_PRIORITY);
    [2019]                     break;
    [2020]                 }elseif($packet->face === 0xff){
    
    Backtrace:
    #0 (): pocketmine\Server->crashDump(boolean)
    
    PocketMine-MP version: 1.6dev #48 [Protocol 34; API 1.13.0]
    Git commit: 0000000000000000000000000000000000000000
    uname -a: Linux thecloudpvp 2.6.32-573.1.1.el6.x86_64 #1 SMP Sat Jul 25 17:05:50 UTC 2015 x86_64
    PHP Version: 5.6.2
    Zend version: 2.6.0
    OS : Linux, linux
    
    Loaded plugins:
    AlwaysSpawn 2.2.2 by Philip Shilling for API(s) 1.12.0
    VIPSlots 0.0.4 by iJoshuaHD for API(s) 1.12.0
    WorldProtect 2.1.2 by aliuly for API(s) 1.10.0, 1.12.0
    ClearLagg 1.1.0 by LegendOfMCPE for API(s) 1.0.0
    CustomAlerts 1.6 by EvolSoft for API(s) 1.12.0
    Slapper 1.2.5 by jojoe77777 for API(s) 1.12.0
    DevTools 1.10.0 by PocketMine Team for API(s) 1.3.1
    Sheep 4.0.3 by KnownUnown for API(s) 1.0.0
    FastTransfer 1.0.2 by shoghicp for API(s) 1.12.0
    TimeCommander 2 by LDX for API(s) 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0
    PowerMute 1.0.0 by Falkirks for API(s) 1.7.0
    ASR 2.0.2 by iJoshuaHD for API(s) 1.12.0
    PurePerms 1.1.12 by 64FF00 for API(s) 1.13.0
    SimpleAuth 1.7.1 by PocketMine Team, shoghicp for API(s) 1.12.0
    WorldEditArt 1.0.0_beta_dev_#048 by PEMapModder for API(s) 1.0.0
    SimpleNoSpam 0.1 by BalAnce for API(s) 1.12.0
    SimpleAuthHelper 2.0.4 by aliuly for API(s) 1.12.0
    PureChat 1.2.6 by 64FF00 for API(s) 1.11.0
    CloudTransfer BETA 1.1 by FuryTacticz for API(s) 1.12.0
    HoloText 1.0.0 by fycarman for API(s) 1.12.0
    
    ----------------------REPORT THE DATA BELOW THIS LINE-----------------------
    
    ===BEGIN CRASH DUMP===
    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
    1q2ATaknqB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j4IuasYbIxcLhGVQzRsMWIvvZKen+vaMmsHadnjKDVLrePRfDQu
    lJXo/MvJ+dvGGocufUFjXIk23rVSaDivtnsF853H3NsUeC993rljl54ra2G7ngOf4Y6Guabi6Juw
    JXGSBxabfabytIt4EXFYOtAfcW3O+Rx2JU26JGWGyNcZncRYaN9mCDoRwybFdHrWqvSpZZ5MxbFt
    /4xTcgIxDYdFBjQTmmEpauutEIUolUCGyXDpw/vtFHscZzbvU5OR6JyBPvgUBmpKrXUU48K2sy+N
    Rs7t0MlPE1LWlAY02SR+tIorV9jEZH8m2amdBKIfMgxGcbQNqe/nONFQsS45pZ2MHRbVMHMMh5NC
    rteoQfbYoDyQoX6Rvnu9fVocwxCh008yRBozDs1m3l0OxzCjU2ODNHJska6aQYbGSe0s6YzOE/l8
    SwVxQkWrLeiClM5hwIrtydCirNA3K6gbZSqiek+TbIXNyT6IyhoSYa8dar1Ejt5TZ6bOFXnPYiMb
    meECv97RCn2V85ROAh9lx9jl/EFS3TUv1LmAgOViWrDDQ/B42jxPxc/06KDYtHk3/QujNOmw6Efq
    Z7EsRrF/MPu44oibN2hPHe3yjpfLmebWgQQP0VH44NTW+hrvTJUZ4CdBx+EUwCN+K6lNxeuL0+vp
    4IdJe3z80G8PH4btwQ/9HzyUZJO89ule0KVEc3LUE2v4uDZvo/EBH32rh0xFpBH+YOIMBan2qTE5
    Ue0VdWFdXgIlLk21L/rXwM/U0HwU7ZgPsH8zX0mbT3iWLhqcTfV/eMgAwSPTCmD+J5TiLU+D8mXl
    Bxld1gF133wXtMqScnQdVs8bRLC53sKkj7q8z6TLu3BpDnrLyWgOt0lWSZBJYsiriTufXTBVek5c
    NHXV2i0E5q+w7ZMYd4g7klw4dNs06I17Qzy+eAu7rYaToZJjzxuPh0eTw/6odyiPeoOBHC2P5HAy
    GvWPloNRT4kXoDTbkFrKb3GSWPsPldLt/t1O6JOgV2plN56AMr0jNV65Ei3rCGR7q8nEnRwdHY7H
    ID08HgzVsLc8nhx7HtPTmzCuVKg5tHRTUt8oH5Oz+FZFKDdpCfmg5C1yglEUf3y5lXyFwp/XkBv4
    iXkbdEatT5/+F5CD0gM=
    ===END CRASH DUMP===
    HELP WOULD BE MUCH APPRECIATED :)
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    maybe because if you close player so interact event can not setHeldItem ? idk
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    yes this is the problem...
    PHP:
    $ev = new PlayerInteractEvent($this$item$aimPos$packet->facePlayerInteractEvent::RIGHT_CLICK_AIR);
                        
    $this->server->getPluginManager()->callEvent($ev);
                        if(
    $ev->isCancelled()){
                            
    $this->inventory->sendHeldItem($this);
                            break;
                        }
  4. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    Hmm this is during PlayerPreLoginEvent i have had this error whenbi tried to kick a player during that event
  5. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    use this instead:
    PHP:
    $event->setCancelled();

Share This Page

Advertisement