Join-Listener Fehler

Dieses Thema im Forum "Programmierung" wurde erstellt von HeadiPlays, 12. April 2014.

  1. HeadiPlays
    Offline

    HeadiPlays

    Registriert seit:
    8. Februar 2014
    Beiträge:
    45
    Ort:
    Bayern
    Minecraft:
    HeadShotNoob
    HeyHo,

    ich habe anscheinend im moment einen totalen Blockout..

    Ich werde einfach beim betreten des Servers nicht teleportiert..

    Join-Klasse:

    Code (Text):
    1.  
    2. @EventHandler
    3.     public void on(PlayerJoinEvent e) {
    4.         Player p = e.getPlayer();
    5.        
    6.         e.setJoinMessage(sg.prefix + "Tribute " + p.getName() + " has joined the Game!");
    7.         sg.online.add(p.getName());
    8.         p.getInventory().clear();
    9.         p.getInventory().setArmorContents(null);
    10.        
    11.         ItemStack leave = new ItemStack(Material.MAGMA_CREAM);
    12.         ItemMeta leave_ = leave.getItemMeta();
    13.         leave_.setDisplayName("§8>§2Back to Hub§8<");
    14.         leave.setItemMeta(leave_);
    15.        
    16.          ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
    17.          BookMeta meta = (BookMeta)book.getItemMeta();
    18.         meta.setDisplayName("§8>§4READ§8<");
    19.         meta.setTitle("Rules");
    20.         meta.setAuthor("BlockGames.eu");
    21.         meta.addPage("§lREAD: \n"
    22.                 + "\n"
    23.                 + "§r§o1. Rules \n"
    24.                 + "§r§o2. About \n"
    25.                 + "§r§o3. Information!");
    26.         meta.addPage("§lRules: \n"
    27.                 + "\n"
    28.                 + "§r§o - Be nice in Chat \n"
    29.                 + "§r§o - Play fair \n"
    30.                 + "§r§o - Respect others \n"
    31.                 + "§r§o - Dont hack!");
    32.         meta.addPage("§lAbout: \n"
    33.                 + "\n"
    34.                 + "§r§o Go to this Page, if you dont know how to Play SurvivalGames! \n"
    35.                 + "blockgames.eu/survivalgames");
    36.         meta.addPage("§lInformation: \n"
    37.                 + "\n"
    38.                 + "§r§o v0.1 Our own SurvivalGames Plugin released!");
    39.         book.setItemMeta(meta);
    40.        
    41.         p.getInventory().setItem(1, book);
    42.         p.getInventory().setItem(7, leave);
    43.        
    44.         World w = Bukkit.getWorld(cfg.getString("SurvivalGames.Lobby.WORLD"));
    45.         double x = cfg.getDouble("SurvivalGames.Lobby.X");
    46.         double y = cfg.getDouble("SurvivalGames.Lobby.Y");
    47.         double z = cfg.getDouble("SurvivalGames.Lobby.Z");
    48.        
    49.         p.teleport(new Location(w,x,y,z));
    50.        
    51.     }
    52.  
    Hier der Fehler:

    Code (Text):
    1.  
    2. [21:14:58 ERROR]: Could not pass event PlayerJoinEvent to BlockSG v1.0
    3. org.bukkit.event.EventException
    4.         at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    5. va:294) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    6.         at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    7. a:62) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    8.         at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    9. ava:501) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    10.         at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    11. ava:486) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    12.         at net.minecraft.server.v1_7_R2.PlayerList.c(PlayerList.java:229) [craft
    13. bukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    14.         at net.minecraft.server.v1_7_R2.PlayerList.a(PlayerList.java:116) [craft
    15. bukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    16.         at net.minecraft.server.v1_7_R2.LoginListener.c(LoginListener.java:78) [
    17. craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    18.         at net.minecraft.server.v1_7_R2.LoginListener.a(LoginListener.java:42) [
    19. craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    20.         at net.minecraft.server.v1_7_R2.NetworkManager.a(NetworkManager.java:150
    21. ) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    22.         at net.minecraft.server.v1_7_R2.ServerConnection.c(SourceFile:134) [craf
    23. tbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    24.         at net.minecraft.server.v1_7_R2.MinecraftServer.v(MinecraftServer.java:6
    25. 57) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    26.         at net.minecraft.server.v1_7_R2.DedicatedServer.v(DedicatedServer.java:2
    27. 50) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    28.         at net.minecraft.server.v1_7_R2.MinecraftServer.u(MinecraftServer.java:5
    29. 48) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    30.         at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java
    31. :459) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    32.         at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:6
    33. 18) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    34. Caused by: java.lang.IllegalArgumentException: Name cannot be null
    35.         at org.apache.commons.lang.Validate.notNull(Validate.java:203) ~[craftbu
    36. kkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    37.         at org.bukkit.craftbukkit.v1_7_R2.CraftServer.getWorld(CraftServer.java:
    38. 1011) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    39.         at org.bukkit.Bukkit.getWorld(Bukkit.java:258) ~[craftbukkit.jar:git-Buk
    40. kit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    41.         at Events.Join.on(Join.java:75) ~[?:?]
    42.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    43. _51]
    44.         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    45. _51]
    46.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    47. .7.0_51]
    48.         at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    49.         at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    50. va:292) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-14-g8f8716c-b3039jnks]
    51.         ... 14 more
    52. [21:14:58 INFO]: HeadShotNoob[/127.0.0.1:58205] logged in with entity id 489848
    53. at ([world] 260.3144899724099, 76.0, -151.36453781818707)
    54. >
    55.  
    Und hier die Methode wo ich es in die Config speichere..:

    Code (Text):
    1.  
    2.                 if(args[0].equalsIgnoreCase("setlobby") && p.hasPermission("sg.admin")) {
    3.                     Location loc = p.getLocation();
    4.                                        
    5.                     cfg.set("SurvivalGames.Lobby.WORLD", loc.getWorld().getName());
    6.                     cfg.set("SurvivalGames.Lobby.X", loc.getX());
    7.                     cfg.set("SurvivalGames.Lobby.Y", loc.getY());
    8.                     cfg.set("SurvivalGames.Lobby.Z", loc.getZ());
    9.                    
    10.                     try {
    11.                         cfg.save(f);
    12.                         p.sendMessage(prefix + "Successfully set Lobby-Location!");
    13.                     } catch (IOException e) {
    14.                     }
    15.                    
    16.                    
    17.                 }
    18.  
    Entweder bin ich blöd oder blind, oder auch einfach beides :D

    Freue mich auf Hilfe ;)
     
    #1
  2. games6471
    Offline

    games6471

    Code (Text):
    1. java.lang.IllegalArgumentException: Name cannot be null
    Code (Text):
    1. cfg.getString("SurvivalGames.Lobby.WORLD")
     
    #2
  3. HeadiPlays
    Offline

    HeadiPlays

    Registriert seit:
    8. Februar 2014
    Beiträge:
    45
    Ort:
    Bayern
    Minecraft:
    HeadShotNoob
    Aber, es ist doch nicht null...

    Code (Text):
    1.  
    2. SurvivalGames:
    3.   Lobby:
    4.     WORLD: world
    5.     X: 253.78734385394458
    6.     Y: 82.0
    7.     Z: -145.37314662605988
    8.  
    9.  
     
    #3
  4. games6471
    Offline

    games6471

    Wurde die Config auch wirklich mit diesen Daten geladen?
     
    #4
  5. HeadiPlays
    Offline

    HeadiPlays

    Registriert seit:
    8. Februar 2014
    Beiträge:
    45
    Ort:
    Bayern
    Minecraft:
    HeadShotNoob
    Ja, weil ich alles auch nochmal Korrigiert habe, also mit Copy - Paste..
     
    #5