Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem]Nazwa gildi w nicku bukkit


Rekomendowane odpowiedzi

Opublikowano

Napisz samemu :P

 

Wiekszosc kodu ( java , wymagane TagAPI )

 

  @EventHandler(priority=EventPriority.HIGHEST)
  public void onReceiveTag(PlayerReceiveNameTagEvent event) {
    if (event.isModified()) {
      return;
    }
    if (getFaction() == null) {
      return;
    }
    FPlayer fplayer = (FPlayer)FPlayers.i.get(event.getPlayer());
    FPlayer fsee = (FPlayer)FPlayers.i.get(event.getNamedPlayer());
    String gildia = fsee.getTag();
    String nick = fsee.getName();
    if ((fplayer != null) && (fsee != null)) {
      if (fplayer.getRelationTo(fsee) == Relation.MEMBER) {
        event.setTag(ChatColor.GREEN + gildia + " " + nick);
      }
      if (fplayer.getRelationTo(fsee) == Relation.ALLY) {
        event.setTag(ChatColor.LIGHT_PURPLE + gildia + " " + nick);
      }
      if (fplayer.getRelationTo(fsee) == Relation.ENEMY) {
        event.setTag(ChatColor.RED + gildia + " " + nick);
      }
      if (fplayer.getRelationTo(fsee) == Relation.NEUTRAL)
        event.setTag(gildia + " " + nick);
    }
  }
Opublikowano

 

Napisz samemu :P

 

Wiekszosc kodu ( java , wymagane TagAPI )

 

  @EventHandler(priority=EventPriority.HIGHEST)
  public void onReceiveTag(PlayerReceiveNameTagEvent event) {
    if (event.isModified()) {
      return;
    }
    if (getFaction() == null) {
      return;
    }
    FPlayer fplayer = (FPlayer)FPlayers.i.get(event.getPlayer());
    FPlayer fsee = (FPlayer)FPlayers.i.get(event.getNamedPlayer());
    String gildia = fsee.getTag();
    String nick = fsee.getName();
    if ((fplayer != null) && (fsee != null)) {
      if (fplayer.getRelationTo(fsee) == Relation.MEMBER) {
        event.setTag(ChatColor.GREEN + gildia + " " + nick);
      }
      if (fplayer.getRelationTo(fsee) == Relation.ALLY) {
        event.setTag(ChatColor.LIGHT_PURPLE + gildia + " " + nick);
      }
      if (fplayer.getRelationTo(fsee) == Relation.ENEMY) {
        event.setTag(ChatColor.RED + gildia + " " + nick);
      }
      if (fplayer.getRelationTo(fsee) == Relation.NEUTRAL)
        event.setTag(gildia + " " + nick);
    }
  }

 

Ciekawe :D Ale nie znam się na JAVIE...

kompletnie

sygnaturka2.png

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...