question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ServiceInfoSnapshotUtil.getPlayers ist immer Null

See original GitHub issue

Hey Ihr Lieben,

ich weiß nicht ob das ein Bug ist oder ich etwas falsch mache aber wenn ich ServiceInfoSnapshotUtil.getPlayers(serviceInfoSnapshot) bekomme ich immer null zurück.

P.S. Das ist nur bei getPlayers null

Im code habe ich das stehen:

        for (ServiceInfoSnapshot serviceInfoSnapshot : CloudNetDriver.getInstance().getCloudService("Lobby")) {
            int players = ServiceInfoSnapshotUtil.getPlayers(serviceInfoSnapshot).size();

und players ist immer null.

und dieser Error kommt:

[30.07 21:23:33.763] INFO: [Lobby-1] org.bukkit.event.EventException: null
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:235) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:202) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:198) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:991) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:26) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
[30.07 21:23:33.763] INFO: [Lobby-1]    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.763] INFO: [Lobby-1]    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
[30.07 21:23:33.763] INFO: [Lobby-1] Caused by: java.lang.NullPointerException
[30.07 21:23:33.764] INFO: [Lobby-1]    at de.wildcards.lobbysystem.listeners.SwitcherMenu.invMenu(SwitcherMenu.java:53) ~[?:?]
[30.07 21:23:33.764] INFO: [Lobby-1]    at de.wildcards.lobbysystem.listeners.SwitcherMenu.onPlayerInteract(SwitcherMenu.java:32) ~[?:?]
[30.07 21:23:33.764] INFO: [Lobby-1]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
[30.07 21:23:33.764] INFO: [Lobby-1]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
[30.07 21:23:33.764] INFO: [Lobby-1]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
[30.07 21:23:33.855] INFO: [Lobby-1]    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
[30.07 21:23:33.855] INFO: [Lobby-1]    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
[30.07 21:23:33.856] INFO: [Lobby-1]    ... 18 more

Minecraft version: Spigot 1.12.2 OS: Linux Debian

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
issue-label-bot[bot]commented, Jul 30, 2019

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.83. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

0reactions
zandercodescommented, Jul 31, 2019

Ah, ja, ih glaube, ich seh schon das Problem, ist dann wohl ein Bug, du kannst ja solange das noch nicht behoben ist "serviceInfo.getProperties().get(“Players, TypeToken.getParameterized(Collection.class, JsonDocument.class))” verwenden, das müsstd funktionieren

Oke werde ich mal versuchen und Danke

Das funktioniert Wunderbar aber ist nicht die Optimalste lösung. Danke @McRuben

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found