ZHorse

ZHorse

10.4k Downloads

/zh list is not working for some players

P3NGU1N101 opened this issue ยท 10 comments

commented

Bug report

What are you trying to do ?

Receive the list of horses a player owns

What is the expected behavior ?

When a player executes /zh list a list of their horses should come up

What is the actual behavior ?

When a player executes /zh list nothing comes up and instead an error in CONSOLE

How to reproduce the bug ?

  1. Execute /zh list
  2. Record results
  3. (Server went from 1.11.2 > 1.12 if that has any impact)

Console output

Link to console output, if any, goes here. Please use http://pastebin.com to paste long outputs !

27.06 08:55:34 [Server] WARN ... 21 more 27.06 08:55:34 [Server] WARN at com.gmail.xibalbazedd.zhorse.commands.CommandList.<init>(CommandList.java:22) 27.06 08:55:34 [Server] WARN at com.gmail.xibalbazedd.zhorse.commands.CommandList.execute(CommandList.java:37) 27.06 08:55:34 [Server] WARN at com.gmail.xibalbazedd.zhorse.commands.CommandList.buildAliveHorseNameList(CommandList.java:96) 27.06 08:55:34 [Server] WARN at com.gmail.xibalbazedd.zhorse.managers.DataManager.getHorseUUID(DataManager.java:167) 27.06 08:55:34 [Server] WARN at java.util.UUID.fromString(UUID.java:192) 27.06 08:55:34 [Server] WARN Caused by: java.lang.NullPointerException 27.06 08:55:34 [Server] WARN at java.lang.Thread.run(Thread.java:745) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:747) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) 27.06 08:55:34 [Server] WARN at java.util.concurrent.FutureTask.run(FutureTask.java:266) 27.06 08:55:34 [Server] WARN at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1220) 27.06 08:55:34 [Server] WARN at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1385) 27.06 08:55:34 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:644) 27.06 08:55:34 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) 27.06 08:55:34 [Server] WARN at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) 27.06 08:55:34 [Server] WARN at com.gmail.xibalbazedd.zhorse.managers.CommandManager.onCommand(CommandManager.java:40) 27.06 08:55:34 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 27.06 08:55:34 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 27.06 08:55:34 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 27.06 08:55:34 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 27.06 08:55:34 [Server] WARN java.lang.reflect.InvocationTargetException

Environment specifications

  • Operating system : Linux
  • Java version : 9
  • Server version : 1.12
  • ZHorse version : Zhorse 1.6.7
  • Database : MySQL
commented

I did not read the console output ("Please use http://pastebin.com to paste long outputs !") but it appears that the horse list of the player was corrupted by a bugged command (maybe prior to 1.6.7).

There should be no more bugged commands in the last snapshot of ZHorse 1.6.8 : download here

This will however not fix that player's horse list. To do that, he must free his horses and claim them again.

commented

Still no luck https://pastebin.com/xcF845ez
That is what comes up in CONSOLE ^

commented

Was the horse list cleared ?
The problem is likely that there is two horses with the same id in that horse list.

As you are using MySQL, you could check if this is the case. If so,

  1. Clear that horse list again (/zh admin clear playerName will do)
  2. Make sure that the list if effectively clear (/zh list should work)
  3. Claim the horses again and verify that they all have their own id

Also, I can log in on your server to check if this indeed the issue we are facing here, if you send me the ip.

commented

a) Yes, the horse list has been cleared and now it works, however for the rest of the players, some do have a bugged /zh list and some do not. I can send you the IP as well if you still wish. What do you advise?

commented

First of all, you can execute this query which returns the names of players whose list is corrupted : SELECT p.name FROM player p WHERE (SELECT COUNT(*) FROM horse h WHERE h.owner = p.uuid AND h.id = 1) > 1;
(Don't forget to add database/table prefixes if needed)

Then, you must tell those players to :
1 (optional) Gather their horses in one place in order to find them later.
2 Execute /zh free until they have no more horses
3 Claim them all again in any order

However I plan to make an automatic fix for this issue in 1.6.8 snapshot 5. (should be ready soon)

Update : Forget about the solution above, the automatic fix is really easy to do and should be ready within an hour.

commented

This issue should have been fixed by 0b383f7
Jar file will follow on Spigot thread in a minute.

commented

Hey, sorry if i'm being annoying but I'm now getting this error for some players when I do /zh admin clear NAME:
https://pastebin.com/pnKDYYKU
Then when I check their list this error comes up:
https://pastebin.com/uirD3Gus

commented

Also here is another error which prevents players from leashing horses/tying the horse on fences for some reason.
https://pastebin.com/NFvRQP20

commented

You must be using ZHorse 1.6.8 snapshot 5 in order to fix the list issue. The issue with /zh admin clear is the same as /zh list, so fixing the list should fix /zh admin clear too. I will however change the code of /zh admin clear to take potential horse list corruption into account.

commented

Concerning your issue with leashes, it is a bit weird : it appears that the player has no item in hand when he tries to leash the horse. Do you have an idea of what could be causing that ?
(As another plugin is involved at the same time (PetStore), it might also be the result of an incompatibility.)