NoSuchMethodError

Discussion in 'Plugin Development' started by HappyPikachu, Nov 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    HappyPikachu

    Some users of my plugin, BattleTags, are experiencing issues while using the beta versions of Factions by Brettflan. I feel like I'm missing something really obvious here - nonetheless I could use some help.

    Here's 2 instances of the error:
    http://dev.bukkit.org/server-mods/battletags/tickets/3-ticket-1-still-dont-work/
    http://dev.bukkit.org/server-mods/b...not-pass-event-player-receive-name-tag-event/

    Here's my BattleTagsPlayerListener:
    Code:java
    1. package me.happypikachu.BattleTags;
    2.  
    3. import net.sacredlabyrinth.phaed.simpleclans.Clan;
    4. import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
    5.  
    6. import org.bukkit.ChatColor;
    7. import org.bukkit.event.EventHandler;
    8. import org.bukkit.event.EventPriority;
    9. import org.bukkit.event.Listener;
    10. import org.kitteh.tag.PlayerReceiveNameTagEvent;
    11.  
    12. import com.massivecraft.factions.Conf;
    13. import com.massivecraft.factions.FPlayers;
    14. import com.massivecraft.factions.Faction;
    15. import com.massivecraft.factions.struct.Rel;
    16. import com.tommytony.war.Team;
    17.  
    18. public class BattleTagsPlayerListener implements Listener {
    19. private BattleTags plugin;
    20. public BattleTagsPlayerListener(BattleTags plugin) {
    21. this.plugin = plugin;
    22. }
    23.  
    24. @EventHandler(priority=EventPriority.HIGHEST)
    25. public void onNameTag(PlayerReceiveNameTagEvent event) {
    26. if (plugin.getServer().getPluginManager().getPlugin("Factions") != null) {
    27. if (plugin.getConfig().getBoolean("Factions." + event.getNamedPlayer().getWorld().getName())) {
    28. Faction pFaction = FPlayers.i.get(event.getPlayer()).getFaction();
    29. Faction npFaction = FPlayers.i.get(event.getNamedPlayer()).getFaction();
    30. if (plugin.getServer().getPluginManager().getPlugin("Factions").getDescription().getVersion().startsWith("1.7")) {
    31. if (pFaction.getRelationTo(npFaction).equals(Rel.ALLY)) {
    32. event.setTag(Conf.colorAlly + event.getNamedPlayer().getName());
    33. } else if (pFaction.getRelationTo(npFaction).equals(Rel.ENEMY)) {
    34. event.setTag(Conf.colorEnemy + event.getNamedPlayer().getName());
    35. } else if (pFaction.getRelationTo(npFaction).equals(Rel.MEMBER)) {
    36. event.setTag(Conf.colorMember + event.getNamedPlayer().getName());
    37. } else if (pFaction.getRelationTo(npFaction).equals(Rel.NEUTRAL)) {
    38. event.setTag(Conf.colorNeutral + event.getNamedPlayer().getName());
    39. }
    40. } else {
    41. if (pFaction.getRelationTo(npFaction).isAlly()) {
    42. event.setTag(Conf.colorAlly + event.getNamedPlayer().getName());
    43. } else if (pFaction.getRelationTo(npFaction).isEnemy()) {
    44. event.setTag(Conf.colorEnemy + event.getNamedPlayer().getName());
    45. } else if (pFaction.getRelationTo(npFaction).isMember()) {
    46. event.setTag(Conf.colorMember + event.getNamedPlayer().getName());
    47. } else if (pFaction.getRelationTo(npFaction).isNeutral()) {
    48. event.setTag(Conf.colorNeutral + event.getNamedPlayer().getName());
    49. }
    50. }
    51. }
    52. }
    53. if (plugin.getServer().getPluginManager().getPlugin("SimpleClans") != null) {
    54. SimpleClans sc = (SimpleClans) plugin.getServer().getPluginManager().getPlugin("SimpleClans");
    55. Clan pClan = sc.getClanManager().getClanByPlayerName(event.getPlayer().getName());
    56. Clan npClan = sc.getClanManager().getClanByPlayerName(event.getNamedPlayer().getName());
    57. if (pClan.isAlly(npClan.getTag())) {
    58. event.setTag(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("SimpleClans.ally")) + event.getNamedPlayer().getName());
    59. }
    60. if (pClan.isMember(event.getPlayer().getName())) {
    61. event.setTag(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("SimpleClans.member")) + event.getNamedPlayer().getName());
    62. }
    63. if (pClan.isRival(npClan.getTag())) {
    64. event.setTag(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("SimpleClans.rival")) + event.getNamedPlayer().getName());
    65. } else if (pClan.isWarring(npClan.getTag())) {
    66. event.setTag(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("SimpleClans.warring")) + event.getNamedPlayer().getName());
    67. }
    68. }
    69. if (plugin.getServer().getPluginManager().getPlugin("War") != null) {
    70. if (plugin.getConfig().getBoolean("War." + event.getNamedPlayer().getWorld().getName())) {
    71. if (Team.getTeamByPlayerName(event.getNamedPlayer().getName()) != null) {
    72. event.setTag(Team.getTeamByPlayerName(event.getNamedPlayer().getName()).getKind().getColor() + event.getNamedPlayer().getName());
    73. }
    74. }
    75. }
    76. }
    77. }
     
  2. Offline

    Tirelessly

    Is TagAPI installed on the server?
     
  3. Offline

    HappyPikachu

    Yes, it's a required dependency.
     
  4. Offline

    HappyPikachu

    Anyone else have an idea what could be wrong? o3o
     
  5. Offline

    Tirelessly

    Are you sure it's up to date?
     
  6. Offline

    HappyPikachu

    I'm not getting the error myself so I can't verify that, but the error seems to be pointing out Factions, not TagAPI.
     
  7. Offline

    V10lator

    So are you sure Factions is up2date (both, the one you compile against as well as the one used on the server) ? ^^
     
  8. Offline

    HappyPikachu

    I compile against the latest beta and non-beta Factions, since the relation methods are different (for whatever reason). I can't replicate the error when I run against the beta, but at least one person claims to be running the latest version.
     
  9. Offline

    HappyPikachu

    Still looking for an answer. Anyone?
     
  10. Offline

    HappyPikachu

    Been a while, gonna give this one last bump.
     
  11. Offline

    Sagacious_Zed Bukkit Docs

    If two plugins have any classes with the same fully qualified name, it may cause this problem as one version of the class has a method, and another version does not.
     
  12. Offline

    HappyPikachu

    But I check to the plugin version to see which method is being used. Is that not enough? :c
     
Thread Status:
Not open for further replies.

Share This Page