Closed SlimeDog closed 3 years ago
I have managed to find a way around. LuckPerms had the same issue with Citizens and to fix that, they made it so if uuid's version() is equal to 2, the plugin treats a player as it is an npc.
After looking deeper, I have realized that this issue is actually related to me not calling PlayerPreLoginEvent, when creating bots.
Thanks. It is standard practice (not universally observed, unfortunately) to leave a ticket open until the fix has been incorporated into a release. Extra credit for remaining open until the fix is verified by the reporter. The fix(es) for this issue aren't even in the public codebase.
Ok, thank you. As you said, it is my first plugin and I still don't know this kind of stuff.
Please reopen (this is an example of why an issue shouldn't be close prematurely).
Much improved. The ProtocolLib- and Vault-related problems seem to be resolved, but errors are still generated on summon
. Most of it is probably related to inability to force the resourcepack, but ItemJoin (for example) should not be processed for a fake player, since there is no GUI accessible to them.
Paper 1.16.5-594 FakePlayers 1.5
Plugins producing errors (see below) are
Executed FakePlayers summon B
from the console.
[06:38:36 INFO]: [Disease] Loading player B
[06:38:36 INFO]: Fake Players » Successfully summoned a Fake Player.
[06:38:36 INFO]: [Essentials] Creating empty config: /home/ram/MC/plugins/Essentials/userdata/eac9a680-4b22-430f-a9d4-749e99556799.yml
[06:38:36 INFO]: [LP] Set blackdog.visited.world to true for B in context global.
[06:38:36 INFO]: B lost connection: Sorry, you must enable the BlackDog resourcepacks
Edit the configuration for the server and try again
[06:38:36 FATAL]: Error executing task on Server
java.lang.NullPointerException: null
at net.minecraft.server.v1_16_R3.NetworkManager.handleDisconnection(NetworkManager.java:529) ~[patched_1.16.5.jar:git-Paper-594]
at com.denizenscript.denizen.nms.v1_16.impl.network.handlers.DenizenNetworkManagerImpl.handleDisconnection(DenizenNetworkManagerImpl.java:978) ~[?:?]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1262) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1255) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1329) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1126) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-594]
at java.lang.Thread.run(Thread.java:834) [?:?]
[06:38:37 WARN]: [ItemJoin] Task #15867 for ItemJoin v5.2.2-SNAPSHOT-b700 generated an exception
java.lang.NullPointerException: null
at me.RockinChaos.itemjoin.item.ItemUtilities.lambda$setInvSlots$5(ItemUtilities.java:593) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-594]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1423) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:418) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1338) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1126) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-594]
at java.lang.Thread.run(Thread.java:834) [?:?]
[06:38:37 WARN]: [ItemJoin] Task #15868 for ItemJoin v5.2.2-SNAPSHOT-b700 generated an exception
java.lang.NullPointerException: null
at me.RockinChaos.itemjoin.item.ItemUtilities.lambda$setInvSlots$5(ItemUtilities.java:593) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-594]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1423) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:418) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1338) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1126) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-594]
at java.lang.Thread.run(Thread.java:834) [?:?]
If I disable ForceResourcepacks, and summon B again, I get more errors. Some are related to the fact that B has a different UUID than the one already stored by plugins.
> fakeplayers summon B
[07:05:19 WARN]: [LuckPerms] LuckPerms already has data for player 'B' - but this data is stored under a different UUID.
[07:05:19 WARN]: [LuckPerms] The UUID the player is connecting with now is Mojang-assigned (type 4). This implies that one of the other servers in your network is not authenticating correctly.
[07:05:19 WARN]: [LuckPerms] If you're using BungeeCord/Velocity, please ensure that IP-Forwarding is setup correctly on all of your backend servers!
[07:05:19 WARN]: [LuckPerms] See here for more info: https://luckperms.net/wiki/Network-Installation#pre-setup
[07:05:19 INFO]: [Essentials] Found new UUID for B. Replacing eac9a680-4b22-430f-a9d4-749e99556799 with 33c6e6f3-5f6d-474b-81bf-fd2e4b6046c2
[07:05:19 INFO]: [ViaVersionStatus] B is using version UNKNOWN(-1).
[07:05:19 INFO]: [pHD] Adding player B UUID 33c6e6f3-5f6d-474b-81bf-fd2e4b6046c2 to cache
[07:05:19 INFO]: [on first join] set player's balance to 1000
[07:05:19 INFO]: [LP] Set blackdog.visited.world to true for B in context global.
[07:05:19 ERROR]: [Plan] Ran into NullPointerException - logged to plugins/Plan/logs/NullPointerException-a16ff55fac.txt
[07:05:19 ERROR]: [Plan] Error msg: "null"
[07:05:19 INFO]: [Disease] Loading player B
[07:05:19 INFO]: Fake Players » Successfully summoned a Fake Player.
[07:05:19 INFO]: [Essentials] Creating empty config: /home/ram/MC/plugins/Essentials/userdata/33c6e6f3-5f6d-474b-81bf-fd2e4b6046c2.yml
[07:05:20 WARN]: [ItemJoin] Task #21445 for ItemJoin v5.2.2-SNAPSHOT-b700 generated an exception
java.lang.NullPointerException: null
at me.RockinChaos.itemjoin.item.ItemUtilities.lambda$setInvSlots$5(ItemUtilities.java:593) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-594]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1423) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:418) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1338) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1126) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-594]
at java.lang.Thread.run(Thread.java:834) [?:?]
[07:05:20 WARN]: [ItemJoin] Task #21446 for ItemJoin v5.2.2-SNAPSHOT-b700 generated an exception
java.lang.NullPointerException: null
at me.RockinChaos.itemjoin.item.ItemUtilities.lambda$setInvSlots$5(ItemUtilities.java:593) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-594]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1423) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:418) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1338) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1126) ~[patched_1.16.5.jar:git-Paper-594]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-594]
at java.lang.Thread.run(Thread.java:834) [?:?]
> FakePlayers list
[07:14:45 INFO]: Fake Players (2):
[07:14:45 INFO]: B, B
Spigot or Paper 1.16.5 FakePlayers 1.4
Executed
FakePlayers summon B
from the console. This produced many errors from interactions with other plugins, includingMany of these have to do with the plugins trying to obtain information (sometimes from Vault) about the fake player, who has been assigned a UUID (in this case, c132c49c-385e-4d28-87a3-7a72f101a4cd) that does not exist IRL, so produces NPEs for player name. Probably, FakePlayers needs to intercept player lookups, to provide the fake name in response to the fake UUID. (It would be very bad to use an IRL UUID, although it is unclear how that can be avoided, since more will be randomly assigned in future.)
On our servers, a new player has to do -- at a minimum -- the following:
I have removed the stack traces for brevity. They can be provided on request.