1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved 1.5 Support

Discussion in 'Help' started by Qeis2007, Jul 12, 2018.

  1. Qeis2007

    Qeis2007 Witch

    Messages:
    70
    GitHub:
    FrostingBita
    Hello developers of PocketMine-MP.
    Because of 1.5 update, so the PMMP 3.0.6 doesn't work. So, can you make new version of pmmp or there available for dev build? I can contribute to testing.
    Thanks -
     
  2. Harvey

    Harvey Spider

    Messages:
    7
    Please be patient, I'm sure an update is in the works.
     
  3. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    If I'm not mistaken, the game barely launches for many people in 1.5, so dktapps has decided to wait on updating the master branch until the game itself is patched. (source)
     
  4. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    jasonwynn10 and Qeis2007 like this.
  5. Driesboy

    Driesboy Spider Jockey

    Messages:
    34
    GitHub:
    driesboy
    For nametags to be fully working you can use this:
    PHP:
        /**
         * @param Player[]|Player $player
         * @param array           $data Properly formatted entity data, defaults to everything
         */
        
    public function sendData($player, ?array $data null) : void{
            if(!
    is_array($player)){
                
    $player = [$player];
            }
     
            
    $pk = new SetEntityDataPacket();
            
    $pk->entityRuntimeId $this->getId();
            
    $pk->metadata $data ?? $this->propertyManager->getAll();
     
            foreach(
    $player as $p){
                if(
    $p === $this){
                    continue;
                }
                
    $p->dataPacket(clone $pk);
            }
     
            if(
    $this instanceof Player){
                
    $this->dataPacket($pk);
     
                if(isset(
    $data[self::DATA_NAMETAG])){
                    if(
    $this instanceof Player){
                        
    $pk = new RemoveEntityPacket();
                        
    $pk->entityUniqueId $this->getId();
                        foreach(
    $player as $p){
                            if(
    $p === $this){
                                continue;
                            }
                            
    $p->dataPacket(clone $pk);
                        }
                        
    $pk = new AddPlayerPacket();
                        
    $pk->uuid $this->getUniqueId();
                        
    $pk->username $this->getNameTag();
                        
    $pk->entityRuntimeId $this->getId();
                        
    $pk->position $this->asVector3();
                        
    $pk->motion $this->getMotion();
                        
    $pk->yaw $this->yaw;
                        
    $pk->pitch $this->pitch;
                        
    $pk->item $this->getInventory()->getItemInHand();
                        
    $pk->metadata $this->propertyManager->getAll();
                        foreach(
    $player as $p){
                            if(
    $p === $this){
                                continue;
                            }
                            
    $p->dataPacket(clone $pk);
                        }
                    }
                }
            }
        }
     
  6. MSG100PM

    MSG100PM Slime

    Messages:
    95
    GitHub:
    MSG100TC
    Hello,

    I'm a little confused about how to use this code, are you able to make this into a plugin?

    Thank you :)
     
  7. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
  8. MSG100PM

    MSG100PM Slime

    Messages:
    95
    GitHub:
    MSG100TC
  9. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    Yes. Also make sure you add
    PHP:
    use pocketmine\network\mcpe\protocol\AddPlayerPacket;
    to the top of Entity.php aswell after you replace the sendData function.
     
    MSG100PM likes this.
  10. MSG100PM

    MSG100PM Slime

    Messages:
    95
    GitHub:
    MSG100TC
    Thank you :)
     
    Kabluinc likes this.
  11. MSG100PM

    MSG100PM Slime

    Messages:
    95
    GitHub:
    MSG100TC
    I tried it but it didn't work. Still the white nametag. I added the library and replaced the function, I used the latest source of pmmp (3.1.0).
    Here's the pastebin of my Entity.php: https://pastebin.com/9BHM5N0J

    I can't whats causing it not working, please help, thanks!
     
  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.