コード例 #1
0
  @EventHandler(priority = EventPriority.NORMAL)
  public void onSpoutCraftEnable(SpoutCraftEnableEvent event) {
    final FPlayer me = FPlayers.i.get(event.getPlayer());

    SpoutFeatures.updateAppearances(me.getPlayer());
    updateTerritoryDisplay(me, true);
  }
コード例 #2
0
ファイル: Features.java プロジェクト: superlode/Features
 @EventHandler
 public void onSpoutcraftEnable1(SpoutCraftEnableEvent event) {
   SpoutPlayer player = SpoutManager.getPlayer(event.getPlayer());
   Container container = this.getContainer(player, "TOP_CENTER", 0, Features.config_ui_top);
   perPlayer bar = new perPlayer(player, config_ui_maxwidth);
   container.addChild(bar).setLayout(ContainerType.VERTICAL);
   container.setVisible(false);
   data.put(player, bar);
 }
コード例 #3
0
  @EventHandler
  public void onSpoutCraftLogin(SpoutCraftEnableEvent event) {

    Player p = event.getPlayer();
    Hero hero = plugin.getHeroManager().getHero(p);
    HeroClass primclass = hero.getHeroClass();
    HeroClass secclass = hero.getSecondClass();
    SpoutPlayer sp = SpoutManager.getPlayer(p);

    int xpprim = (int) Math.round(hero.currentXPToNextLevel(primclass));
    int xpsec = (int) Math.round(hero.currentXPToNextLevel(secclass));

    if (hero != null) {

      String text =
          primclass
              + ": "
              + ChatColor.RED
              + hero.getHealth()
              + " / "
              + hero.getMaxHealth()
              + "\n"
              + ChatColor.DARK_RED
              + "Lvl/Exp: "
              + ChatColor.RED
              + hero.getLevel(primclass)
              + " / "
              + xpprim;

      if (secclass != null) {
        text +=
            "\n"
                + ChatColor.DARK_GREEN
                + "Prof: "
                + ChatColor.GREEN
                + secclass
                + "\n"
                + ChatColor.DARK_GREEN
                + "LvL/Exp: "
                + ChatColor.GREEN
                + hero.getLevel(secclass)
                + " / "
                + xpsec;
      } else {
        text +=
            "\n"
                + ChatColor.DARK_GREEN
                + "You Dont have a"
                + "\n"
                + ChatColor.DARK_GREEN
                + "Secondary Class!";
      }
      plugin.getGUI().updateLabel(sp, text);
    }
  }
コード例 #4
0
ファイル: Features.java プロジェクト: superlode/Features
 @EventHandler
 public void onSpoutcraftEnable(SpoutCraftEnableEvent event) {
   SpoutPlayer player = event.getPlayer();
   Container container = getContainer(player, config_ui_align, config_ui_left, config_ui_top);
   Container members = new GenericContainer();
   container
       .setLayout(ContainerType.HORIZONTAL)
       .addChildren(members, new GenericContainer())
       .setWidth(config_ui_maxwidth);
   containers.put(player, members);
   updateAll(player);
 }
コード例 #5
0
  @EventHandler
  public void onSpoutCraftEnable(SpoutCraftEnableEvent event) {
    final Player player = event.getPlayer();
    // if(RpgEssentials.wl.worlds.get(player.getWorld())){
    final World world = player.getWorld();
    final SpoutPlayer splayer = SpoutManager.getPlayer(player);

    final ConfigurationSection section = Configuration.quests.getConfigurationSection("Quests");
    final Iterator<?> keys = section.getKeys(false).iterator();
    while (keys.hasNext()) {
      final String name = (String) keys.next();
      if (Configuration.quests.contains("Quests." + name + ".location")) {
        Methods.addPublicWaypoint(
            Configuration.quests.getString("Quests." + name + ".text.name"),
            Configuration.quests.getVector("Quests." + name + ".location"));
      }
    }
    // }
  }