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

Soccer plugin

Discussion in 'Requests' started by MalakasPlayzMCPE, Aug 27, 2018.

  1. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    Make the source open!
     
  3. Eduardo

    Eduardo Baby Zombie

    Messages:
    100
    GitHub:
    xBeastMode
    Everytime a player moves you loop through a folder just to get an arena name, that's way more than terrible. Just don't run it if you're thinking about it.

    PHP:
        public function onMove(PlayerMoveEvent $event) : void{
            
    $player $event->getPlayer();
            
    $distance 0.5;
            
    $speed $event->getFrom()->distanceSquared($event->getTo()) * 5;
            foreach(
    $player->getLevel()->getNearByEntities($player->getBoundingBox()->expandedCopy($distance$distance$distance), $player) as $entity){
                if(
    $entity instanceof Ball){
                    
    $this->lastTouch[$this->getArena($player)] = $player->getName();
                }
            }
        }

        public function 
    getArena(Player $player) : ?string{
            
    $files scandir($this->getDataFolder() . "arenas");
            return 
    null;
            foreach(
    $files as $arenaFile){
                
    $check explode("."$arenaFile);
                if(
    $check[1] == "yml"){
                    
    $arenaName $check[0];
                    if(
    in_array($player->getName(), $this->blue[$arenaName]) || in_array($player->getName(), $this->red[$arenaName])){
                        return 
    $arenaName;
                    } else {
                        return 
    null;
                    }
                }
            }
        }
     
  4. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    I said we lost our motivation... we are not going to update the plugin. Credit to you by the way for the ball's code.
    It isn't open source because it is a request. But it could be...
     
  5. Primus

    Primus Zombie Pigman

    Messages:
    749
    But you just did make it open by posting your code here... so why not post it on Github?
     
  6. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Uhh, I don't know... It's better to keep it here for now because some annoying kids will spam the issues with "Not working" and other stuff.
     
  7. SmartLord

    SmartLord Spider

    Messages:
    8
    GitHub:
    smartlord
    Use this
     

    Attached Files:

  8. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Well... we need the arena system to be completed. This does not help, sorry.
     
  9. SmartLord

    SmartLord Spider

    Messages:
    8
    GitHub:
    smartlord
  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.