예제 #1
0
 public void playerWantsToJoin(MiniPEPlayer player)
 {
     if (!playsJump(player))
     {
         if (isAMatchFree() || getMatchCount() < MAX_MATCHES)
         {
             // Spieler can join a match
             if (isAMatchFree())
             {
                 // there is a match the player can join
                 getFirstFreeMatch().addPlayer(player);
             }
             else
             {
                 // create a new match for the player
                 JumpMatch m = new JumpMatch(this);
                 m.addPlayer(player);
                 Matches.Add(m);
             }
         }
         else
         {
             // there is no match to play at the moment
             player.SendMessage("§b[MiniPE] There is no match you can join at the moment.", MessageType.Chat);
         }
     }
 }
예제 #2
0
 public void addPlayer(MiniPEPlayer player)
 {
     // add player to list
     Players.Add(player);
     // send a message to the player
     player.SendMessage("§b[MiniPE] Joining...", MessageType.Chat);
     // teleport the player to the jump n run
     player.SpawnLevel(level, new PlayerLocation
     {
         X       = 340,
         Y       = 10,
         Z       = 454,
         Yaw     = 91,
         Pitch   = 28,
         HeadYaw = 91,
     });
 }