Exemple #1
0
  @SuppressWarnings("static-access")
  public void onPlayerJoin(PlayerJoinEvent event) {

    Player player = event.getPlayer();
    plugin.Tools.checkAccount(player);
    if (plugin.SpoutEnabled && plugin.EnableSkillMastery && plugin.EnableCapes) {
      SpoutPlayer sp = (SpoutPlayer) event.getPlayer();
      File CapeFile = new File(plugin.getDataFolder() + "/Data/Cape.data");
      if (plugin.FlatFile.contains(sp.getName(), CapeFile)) {
        AppearanceManager appearM = SpoutManager.getAppearanceManager();
        appearM.setGlobalCloak(
            sp,
            "http://cloud.github.com/downloads/samkio/Levelcraft/"
                + plugin.FlatFile.getString(sp.getName(), CapeFile)
                + ".png");
        return;
      }
      for (Plugin plug : plugin.LevelNames.keySet()) {
        if (!plugin.Permissions.hasLevel(player, plug)) continue;
        if (!(plugin.LevelFunctions.getLevel(player, plug) >= plugin.LevelCap)) continue;
        AppearanceManager appearM = SpoutManager.getAppearanceManager();
        appearM.setGlobalCloak(
            sp,
            "http://cloud.github.com/downloads/samkio/Levelcraft/"
                + plugin.LevelNames.get(plug)
                + ".png");
        return;
      }
    }
  }
Exemple #2
0
 public static boolean hasLevelExp(Player s, Plugin p) {
   if (plugin.UseClasses) {
     String Level = plugin.LevelNames.get(p);
     String PlayersClass = plugin.Class.DefaultClass;
     if (plugin.Class.isInValidClass(s.getName())) {
       PlayersClass = plugin.Class.getClass(s.getName());
     }
     String[] Levels = plugin.Class.getLevelableLevels(PlayersClass);
     for (int i = 0; i < Levels.length; i++) {
       // plugin.logger.info(Levels[i]);
       if (Levels[i].equalsIgnoreCase(Level) || Levels[i].equalsIgnoreCase("*")) return true;
     }
     return false;
   }
   if (!plugin.PermissionUse) return true;
   if (plugin.PermissionH.has(
       s, "lc.level." + plugin.LevelNames.get(p).toLowerCase() + ".allowlevel")) return true;
   return false;
 }
Exemple #3
0
 public static boolean hasLevel(Player s, Plugin p) {
   // Because LvlDefense crash in this
   if (plugin.UseClasses) {
     String Level = plugin.LevelNames.get(p);
     String PlayersClass = plugin.Class.DefaultClass;
     if (plugin.Class.isInValidClass(s.getName())) {
       PlayersClass = plugin.Class.getClass(s.getName());
     }
     String[] Levels = plugin.Class.getUnLevelableLevels(PlayersClass);
     for (int i = 0; i < Levels.length; i++) {
       if (Levels[i].equalsIgnoreCase(Level) || Levels[i].equalsIgnoreCase("*")) return true;
     }
     return false;
   }
   try {
     if (!plugin.PermissionUse) return true;
     if (plugin.PermissionH.has(s, "lc.level." + plugin.LevelNames.get(p).toLowerCase()))
       return true; // Line !
     return false;
   } catch (Exception e) {
     return false;
   }
 }
Exemple #4
0
  @SuppressWarnings("static-access")
  public void onPlayerChat(PlayerChatEvent event) {

    //	plugin.LCGui.initializeGUIBasic(sp);

    if (!plugin.EnableSkillMastery) return;
    Player p = event.getPlayer();
    String str = event.getFormat();
    for (Plugin plug : plugin.LevelNames.keySet()) {
      if (!plugin.Permissions.hasLevel(p, plug)) continue;

      if (!(plugin.LevelFunctions.getLevel(p, plug) >= plugin.LevelCap)) continue;

      str = plugin.c1 + "[" + plugin.LevelIndexes.get(plug) + "]WHITE" + str;
    }
    event.setFormat(plugin.Tools.format(str));
  }