Ejemplo n.º 1
0
 /**
  * Handles join messages of a player
  *
  * @param P The player to handle
  */
 public void HandleJoin(Player P) {
   String Welcome = FormatMessage(getMessage("JoinText"), "<Player>", P.getName());
   Welcome =
       FormatMessage(
           Welcome,
           this.RandomNumberTag,
           ""
               + (1
                   + new Random().nextInt(15)
                   + new Random().nextInt(16)
                   + new Random().nextInt(9)));
   TotalLog.Message(Welcome);
   Bukkit.getLogger().info(ChatColor.GREEN + "Big Brother - " + Welcome + generateHashTags());
 }
Ejemplo n.º 2
0
  public void HandleCommandReminder(Player P, String Command) {

    if (StartsWith(Command, "/w ")) {
      String PlayerName = StringUtils.substringBetween(Command, "/w ", " ");
      Player Player = Bukkit.getPlayer(PlayerName);
      if (Player != null) {
        Player.playSound(Player.getLocation(), Sound.CAT_MEOW, 1.0f, 1.0f);
      }
    } else if (StartsWith(Command, "/msg")) {

    }

    if (StartsWith(Command, "/spawnmob") || StartsWith(Command, "/spawner")) {
      String Addition = "";
      while (true) {
        if (PercentCheck(11) == true) {
          Addition += " " + getRandomHashTag();
        } else {
          break;
        }
      }
      TotalLog.MessagePlayer(
          (FormatMessage(getMessage("SpawnText") + Addition, "<Player>", P.getName())), P);
      return;
    }

    if (StartsWith(Command, "/give")
        || StartsWith(Command, "/i")
        || StartsWith(Command, "/itemgen")
        || StartsWith(Command, "/more")) {
      String Addition = "";
      while (true) {
        if (PercentCheck(11) == true) {
          Addition += " " + getRandomHashTag();
        } else {
          break;
        }
      }
      TotalLog.Message(FormatMessage(getMessage("ItemText") + Addition, "<Player>", P.getName()));
      return;
    }

    if (StartsWith(Command, "/kill")
        || StartsWith(Command, "/smite")
        || StartsWith(Command, "/fireball")
        || StartsWith(Command, "/explode")) {
      String[] Commands;
      String WhatDo = "";
      if (Command.contains(" ")) {
        Commands = StringUtils.split(Command, " ");
        WhatDo = Commands[0];
      } else {
        WhatDo = Command;
      }
      String Addition = "";
      while (true) {
        if (PercentCheck(11) == true) {
          Addition += " " + getRandomHashTag();
        } else {
          break;
        }
      }
      String Message = FormatMessage(getMessage("KillText") + Addition, "<Command>", WhatDo);
      String Say = FormatMessage(Message, "<Player>", P.getName());
      TotalLog.Message(Say);
      return;
    }

    if (StartsWith(Command, "repair")) {
      String Addition = "";
      while (true) {
        if (PercentCheck(11) == true) {
          Addition += " " + getRandomHashTag();
        } else {
          break;
        }
      }
      TotalLog.MessagePlayer(
          FormatMessage(getMessage("RepairText") + Addition, "<Player>", P.getName()), P);
      return;
    }

    if (Command.equalsIgnoreCase("/join")) {
      TotalLog.MessagePlayer(
          "Hey "
              + ChatColor.YELLOW
              + P.getName()
              + ChatColor.GREEN
              + ", you were close! To join a faction type "
              + ChatColor.GOLD
              + "/join <faction>"
              + ChatColor.GREEN
              + " - Where "
              + ChatColor.GOLD
              + "<faction>"
              + ChatColor.GOLD
              + " is the group you want to join :)",
          P);
      return;
    }

    if (StartsWith(Command, "f join")) {
      TotalLog.MessagePlayer(
          "Hey "
              + ChatColor.YELLOW
              + P.getName()
              + ChatColor.GREEN
              + ", you were close! We don't use the factions plugin though, so /f isn't a command. To join a faction type "
              + ChatColor.GOLD
              + "/join <faction>"
              + ChatColor.GREEN
              + " - Where "
              + ChatColor.GOLD
              + "<faction>"
              + ChatColor.GOLD
              + " is the group you want to join :)",
          P);
      return;
    }
  }
Ejemplo n.º 3
0
 /**
  * Handling the leave messages of a player
  *
  * @param P The player to handle
  */
 public void HandleQuit(Player P) {
   String Welcome = FormatMessage(getMessage("QuitText"), "<Player>", P.getName());
   TotalLog.Message(Welcome);
   Bukkit.getLogger().info(ChatColor.GREEN + "Big Brother - " + Welcome + generateHashTags());
 }