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

ResourcePacks

Discussion in 'Development' started by epicsteve33, Nov 26, 2016.

  1. epicsteve33

    epicsteve33 Banned Banned

    Messages:
    11
    GitHub:
    epicsteve33
    so I want to find out how to allow players to use my texture pack for my server but I am not 100% sure how all this works


    Data Packet from genisys (I added this to my core plugin)
    PHP:
    <?php

    namespace ServerCore\Packets;

    class 
    ResourcePacksInfoPacket extends DataPacket{

       const 
    NETWORK_ID Info::RESOURCE_PACKS_INFO_PACKET;

       public 
    $mustAccept false;
       public 
    $behaviourPackEntries = [];
       public 
    $resourcePackEntries = [];

       public function 
    decode(){
       }

       public function 
    encode(){
           
    $this->reset();
           
    $this->putBool($this->mustAccept);
           
    $this->putShort(count($this->behaviourPackEntries));
           foreach(
    $this->behaviourPackEntries as $entry){
               
    $this->putString($entry->getPackId());
               
    $this->putString($entry->getVersion());
               
    $this->putLong($entry->getPackSize());
           }
           
    $this->putShort(count($this->resourcePackEntries));
           foreach(
    $this->resourcePackEntries as $entry){
               
    $this->putString($entry->getPackId());
               
    $this->putString($entry->getVersion());
               
    $this->putLong($entry->getPackSize());
           }
       }
    }

    This is what I have when players join not sure what to do from here

    PHP:
    public function onJoin(PlayerJoinEvent $event){ 
           
    $player $event->getPlayer();
           
    $pk = new Packets\ResourcePacksInfoPacket();
           
    $pk->mustAccept false;
           
    $pk->behaviourPackEntries = [];
           
    $pk->resourcePackEntries = [];
           
    $player->dataPacket($pk);
     
    gistrec likes this.
  2. epicsteve33

    epicsteve33 Banned Banned

    Messages:
    11
    GitHub:
    epicsteve33
    to be clear I am trying to use $pk->resourcePackEntries = []; but I do not know what to do
     
  3. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    No-one, as far as I know, has found out what to exactly do with these fields
     
  4. epicsteve33

    epicsteve33 Banned Banned

    Messages:
    11
    GitHub:
    epicsteve33
    Lol I was hoping someone has found something or a way of doing this I'm a noobish programmer so I'm not really sure what to do myself
     
  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.