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

[NEW API][UPDATE] BL_ENABLE

Comments in 'Plugin Development' started by Jon, Jul 31, 2014.

  1. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    Can anyone update this plugin called bl_enable for the new API?
    This plugin allowed to use scripts mod in multiplayer/pocketmine servers
    It can be useful for modpacks
    PHP:
    <?php

    /*
    __PocketMine Plugin__
    name=BLEnable
    description=Enable scripts on connecting BlockLauncher clients
    version=1.0
    class=BLEnable
    apiversion=12,13
    */

    class BLEnable implements Plugin{
        private 
    $api;

        public function 
    __construct(ServerAPI $api$server false){
            
    $this->api $api;
        }

        public function 
    init(){
            
    DataPacketReceiveEvent::register(array($this"dataPacketHandler"), EventPriority::NORMAL);
        }

        public function 
    dataPacketHandler(DataPacketReceiveEvent $event){
            
    $packet $event->getPacket();
            
    $player $event->getPlayer();

            if((
    $packet instanceof SetTimePacket)) {
                
    console("BlockLauncher client detected!");
                
    $player->sendChat("BlockLauncher, enable scripts, please and thank you");
            }
        }

        public function 
    __destruct(){

        }
    }
    Thanks
    LDX likes this.
  2. iKINGCAKE
    Offline

    iKINGCAKE New Member

    Joined:
    Jul 24, 2014
    Posts:
    10
    Minecraft User:
    iKINGCAKE
  3. iKINGCAKE
    Offline

    iKINGCAKE New Member

    Joined:
    Jul 24, 2014
    Posts:
    10
    Minecraft User:
    iKINGCAKE
    how does it work?
  4. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    enable mod script in multiplayer and they will works
  5. Killman2
    Offline

    Killman2 Active Member Plugin Developer

    Joined:
    May 5, 2014
    Posts:
    81
    Plugins:
    1
    Minecraft User:
    Killman2
    I don't think that thing will work
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What is wrong with SetTimePacket?
  7. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    Yes it works
  8. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    Spam

    Try it with the old API version...and than let me know
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Well, it is just the same. It's super easy to port it to new API. The problem is, is the "please and thank you" thing required to let it enable it?

    Spam?
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Wait I found the code. Right :)
  11. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    Where?
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
  13. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
  14. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    How does the server load ModPE scripts? If it's just the clients that have the mods it won't work.
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    No longer in version 1.6 maybe?
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It just simply allows the clients to use the scripts, not load the script itself.
  17. Jon
    Offline

    Jon Active Member Plugin Developer

    Joined:
    Sep 1, 2013
    Posts:
    201
    Plugins:
    3
    Minecraft User:
    Heromine14
    i am not sure
  18. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    Client side? Isn't that insecure?
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Right. Therefore, only private servers would want to add that.

    Or make pull requests in BlockLauncher to make it secure :)

    Of course, it will be insecure for the clients instead :p
    Skullex and Jon like this.
  20. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder

Share This Page

Advertisement