You are not logged in.

  • Login
Bitte besucht unser neues Forum unter https://forum.nitrado.net | Please visit our new Forum at https://forum.nitrado.net

SkillCraftHD

User / Kunde

  • "SkillCraftHD" is male
  • "SkillCraftHD" started this thread

Posts: 22

Location: 127.0.0.1

Occupation: Developer

  • Send private message

1

Thursday, November 26th 2015, 8:54pm

[Spigot-Plugin] [BungeeCord] Minecraft Plugin programmieren > mit Spigot(Bukkit) den Bungeecord Server wechseln



Fehler war: Falsche Klasse registriert!
Danke an alle die mir geholfen haben!

Hallo,


ich hätte da mal eine Frage:
Wie kann ich über Spigot(Bukkit) ein Spieler von einen Server zum anderen schicken?
Ich habe noch keinen Code perat! Ich hoffe das ich eine schnelle Antwort bekomme! :D
MFG Til

This post has been edited 3 times, last edit by "SkillCraftHD" (Nov 27th 2015, 5:35pm)


KingFabi2805

User / Kunde

Posts: 53

  • Send private message

2

Thursday, November 26th 2015, 9:05pm

Hallo SkillCraftHD,



ich erkläre es dir jetzt mal ;)



Als erstes erstellst du Variabeln

Source code

1
2
ByteArrayOutputStream b = new ByteArrayOutputStream(); 
DataOutputStream out = new DataOutputStream(b);


Dann verbindest du den Spieler, dazu brauchst du aber auch ein Try/Catch

Source code

1
2
3
4
5
6
7
8
try { 

//Connetct steht für Verbinden 
out.writeUTF("Connect"); 
//Hier trägst du den Namen des Servers ein 
out.writeUTF("Name des Servers"); 
} catch (IOException e1) { 
e1.printStackTrace();}


Jetzt registrierst es noch

Source code

1
p.sendPluginMessage(this.plugin, "BungeeCord", b.toByteArray());

Nun musst du es nur noch im OnEnable registrieren:

Source code

1
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");


Ich hoffe, das ich dir behilflich sein konnte, wenn du noch Fragen hast:

Skype: mcgermandev (Bevorzugt!)
Pn: Oder schreibe mir hier eine PN

SkillCraftHD

User / Kunde

  • "SkillCraftHD" is male
  • "SkillCraftHD" started this thread

Posts: 22

Location: 127.0.0.1

Occupation: Developer

  • Send private message

3

Thursday, November 26th 2015, 9:23pm

Ich habe es nun alles eingefügt! Leider werde ich nicht auf den anderen Server geleitet! Danke für deine Antwort!
Error:



Spoiler Spoiler


  1. [21:22:02] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to SkillCrackLOBBY v1.0
  2. org.bukkit.event.EventException
  3. at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  4. at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  5. at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  6. at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  7. at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:227) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  8. at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInteractManager.java:463) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  9. at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:736) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  10. at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  11. at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  12. at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  13. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_79]
  14. at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_79]
  15. at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:19) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  16. at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:718) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  17. at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:367) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  18. at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:657) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  19. at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:560) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  20. at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
  21. Caused by: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through the unregistered channel `BungeeCord'.
  22. at org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage(StandardMessenger.java:482) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  23. at org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer.sendPluginMessage(CraftPlayer.java:1044) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  24. at navigator.nav.onInteract(nav.java:266) ~[?:?]
  25. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]
  26. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]
  27. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]
  28. at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
  29. at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  30. ... 17 more


MFG Til

mReTurkey

User / Kunde

Posts: 88

  • Send private message

4

Friday, November 27th 2015, 9:33am

Quoted

[...]Caused by: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through the unregistered channel `BungeeCord'[...].

Der Channel "BungeeCord" ist nicht registriert. Deshalb der Fehlercode. Bukkit versucht über den OutGoingChannel "BungeeCord" eine PluginMessage zu schicken - kann es aber nicht, weil es nicht registriert ist.
KingFabi2805 hat geschrieben gehabt, dass du in der onEnable() -Methode den Channel registrieren musst.

Hast du den Channel den, wie KingFabi2805 geschrieben, regestriert? Hast du ein TippFehler bei "BungeeCord" gemacht?
Am besten zeig uns deinen Code.

- mReTurkey

SkillCraftHD

User / Kunde

  • "SkillCraftHD" is male
  • "SkillCraftHD" started this thread

Posts: 22

Location: 127.0.0.1

Occupation: Developer

  • Send private message

5

Friday, November 27th 2015, 11:04am

Mhm... ich habe es eigentlich registriert (Mir wurde es vorher ROT unterstrichen, habe es dann nochmal neu geschrieben!):

Java source code

1
Bukkit.getMessenger().registerOutgoingPluginChannel(new nav(this), "BungeeCord");



Ich nochmal der neuste Error:

Spoiler Spoiler



  1. [11:02:41] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to SkillCrackLOBBY v1.0
  2. org.bukkit.event.EventException
  3. at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  4. at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  5. at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  6. at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  7. at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:227) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  8. at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInteractManager.java:463) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  9. at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:736) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  10. at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  11. at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  12. at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  13. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_79]
  14. at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_79]
  15. at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:19) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  16. at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:718) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  17. at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:367) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  18. at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:657) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  19. at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:560) [minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  20. at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
  21. Caused by: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through the unregistered channel `BungeeCord'.
  22. at org.bukkit.plugin.messaging.StandardMessenger.validatePluginMessage(StandardMessenger.java:482) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  23. at org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer.sendPluginMessage(CraftPlayer.java:1044) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  24. at navigator.nav.onInteract(nav.java:266) ~[?:?]
  25. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]
  26. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]
  27. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]
  28. at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
  29. at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[minecraft_server.jar:git-Spigot-f928e7a-e91aed8]
  30. ... 17 more


MFG Til

DieKuhMachtMuhh

User / Kunde

Posts: 238

Location: Baden Württemberg | Endingen-Amoltern

Occupation: Rettungssanitäter

  • Send private message

6

Friday, November 27th 2015, 11:28am

Caused by: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through the unregistered channel `BungeeCord'.
Es ist immer noch der selbe Error
Probiere einmal

Java source code

1
Bukkit.getServer().getMessanger...

mReTurkey

User / Kunde

Posts: 88

  • Send private message

7

Friday, November 27th 2015, 11:35am

Caused by: org.bukkit.plugin.messaging.ChannelNotRegisteredException: Attempted to send a plugin message through the unregistered channel `BungeeCord'.
Es ist immer noch der selbe Error
Probiere einmal

Java source code

1
Bukkit.getServer().getMessanger...


Wenn das nicht klappt, dann zeig uns bitte deinen Code.

DieKuhMachtMuhh

User / Kunde

Posts: 238

Location: Baden Württemberg | Endingen-Amoltern

Occupation: Rettungssanitäter

  • Send private message

8

Friday, November 27th 2015, 11:44am

Wenn das nicht klappt, dann zeig uns bitte deinen Code.
Ich denke du hast dich da beim User vertan ^^
Der Sinn ist dennoch der selbe

mReTurkey

User / Kunde

Posts: 88

  • Send private message

9

Friday, November 27th 2015, 11:53am

Nein ich meinte wenn er das mit dem "Bukkit.getServer().getMessenger()" probiert hat (wie du es geeschrieben hast ^^) dann soll er uns den Code zeigen, wäre am besten, schätz ich ^^

SkillCraftHD

User / Kunde

  • "SkillCraftHD" is male
  • "SkillCraftHD" started this thread

Posts: 22

Location: 127.0.0.1

Occupation: Developer

  • Send private message

10

Friday, November 27th 2015, 12:00pm

Funktioniert leider immer noch nicht! :thinking:
Hier der betroffene Code:

Spoiler Spoiler



  1. if(e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  2. if((e.getClickedBlock().getType() == Material.SIGN_POST || e.getClickedBlock().getType() == Material.WALL_SIGN)) {
  3. //p.sendMessage("§6SkillCrack §8┃ §3Verbinde auf Server...");
  4. e.setCancelled(false);
  5. //TODO: SERVERSWITCH
  6. if((e.getClickedBlock().getState() instanceof Sign)) {
  7. Sign s = (Sign) e.getClickedBlock().getState();
  8. if(s.getLine(0).equalsIgnoreCase("§7§m-------------") && s.getLine(1).length() != 0) {
  9. p.sendMessage("§6SkillCrack §8┃ §3Verbinde auf Server...");
  10. ByteArrayOutputStream b = new ByteArrayOutputStream();
  11. DataOutputStream out = new DataOutputStream(b);
  12. try {
  13. out.writeUTF("Connect");
  14. out.writeUTF("ovo1");
  15. } catch (IOException e1) {
  16. e1.printStackTrace();}
  17. p.sendPluginMessage(this.plugin, "BungeeCord", b.toByteArray());
  18. }
  19. }
  20. }
  21. }




Und es immernoch der selbe ERROR!
MFG Til

This post has been edited 1 times, last edit by "SkillCraftHD" (Nov 27th 2015, 12:05pm)


Bitte besucht unser neues Forum unter https://forum.nitrado.net| Please visit our new Forum at https://forum.nitrado.net