#if i tempban a player using the banlist
1 messages · Page 1 of 1 (latest)
@soft mirage
[
{
"uuid": "25ec173a-0c50-4bd9-848f-67676b531533",
"name": "TheTimeee",
"created": "2022-05-07 09:21:35 +0000",
"source": "TheTimeee",
"expires": "2022-05-07 09:21:45 +0000",
"reason": "Because that"
}
]
the issue is after a tempban that looks like this ran out
the first time the player logs in
there is a null error thrown sec
07.05 10:14:43 [Server] Server thread/WARN Failed to handle packet for /79.197.243.206:51827
07.05 10:14:43 [Server] INFO java.lang.NullPointerException: Cannot invoke "net.minecraft.server.players.GameProfileBanEntry.f()" because the return value of "net.minecraft.server.players.GameProfileBanList.b(Object)" is null
07.05 10:14:43 [Server] INFO at net.minecraft.server.players.PlayerList.canPlayerLogin(PlayerList.java:586) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.network.LoginListener.d(LoginListener.java:156) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.network.LoginListener.c(LoginListener.java:74) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.network.NetworkManager.a(NetworkManager.java:258) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:172) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1352) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:429) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1237) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1047) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3473-Spigot-ffceeae-2542945]
07.05 10:14:43 [Server] INFO at net.minecraft.server.MinecraftServer.lamb (/79.197.243.206:51827) has disconnected, reason: Internal server error
removed some lines
Keep in mind
cause char limit
sorry xD
if i call this
@EventHandler
public static void onAsyncPlayerPreLogin(AsyncPlayerPreLoginEvent event)
{
TempbanCommand.onAsyncPlayerPreLogin(event.getName());
}
public static void onAsyncPlayerPreLogin(String name)
{
Bukkit.getBanList(Type.NAME).getBanEntry(name);
And then it try’s to update it in storage but it’s not there
Oh
if i call this method
the error wont occur
There’s some methods
wait
That just have to be async for no apparent reason
thing is
this is the correct format right?
for a tempban
so my tempban parsing correctly?
i mean if thats a problem i could just as good write my own tempban system
but i prefer to use vanilla systems when they exist
You could just steal this guys code
Not steal
Be inspired by
Gotta scroll down a bit
i mean i could just as good write a method that checks in its own tempban file wheter or not guys being temp banned still
I gtg tho
Probably best
gl man 😄
That’s what I would do
Gl to you lol I think you meant gn*
😉
i mean i got the serializer and stuff
that aint the problem
and i can check in the PlayerLoginEvent if that guys banned and kick him if so
Yea do that
since tempbans are rare tho ill prob not keep it in memory and just deserialize the file when someone logs in