lishid / OpenInv

Open anyone's inventory as a chest, real-time!
GNU General Public License v3.0
120 stars 97 forks source link

/searchinv #56

Closed Charzzart closed 7 years ago

Charzzart commented 7 years ago

When I try to use /searchinv it says that an internal error occurred. I contacted my server client and they said it was because you're using outdated code. If you could fix that ASAP that'd be great.

Jikoo commented 7 years ago

Please provide the error from console. Right, getOnlinePlayers. Will fix when I get out of work.

Jikoo commented 7 years ago

Fixed in f05110c

Charzzart commented 7 years ago

It still doesn't work for me. Here's the error

[03:39:10] [Server thread/INFO]: Charzzart issued server command: /searchinv dirt

org.bukkit.command.CommandException: Unhandled exception executing command 'searchinv' in plugin OpenInv v3.0.3 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.11.jar:git-Bukkit-c8ff651] at org.bukkit.command.SimpleCommandMap.dispatch( SimpleCommandMap.java:140) ~[craftbukkit-1.11.jar:git-Bukkit-c8ff651] at org.bukkit.craftbukkit.v1_11_R1.CraftServer. dispatchCommand(CraftServer.java:628) ~[craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand( PlayerConnection.java:1278) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.PlayerConnection.a( PlayerConnection.java:1138) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run( SourceFile:13) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at java.util.concurrent.Executors$RunnableAdapter. call(Executors.java:511) [?:1.8.0_112] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_112] at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.MinecraftServer.D( MinecraftServer.java:695) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.DedicatedServer.D( DedicatedServer.java:360) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.MinecraftServer.C( MinecraftServer.java:650) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at net.minecraft.server.v1_11_R1.MinecraftServer.run( MinecraftServer.java:554) [craftbukkit-1.11.jar:git-Bukkit-c8ff651] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112] Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.getOnlinePlayers()[Lorg/bukkit/entity/Player; at com.lishid.openinv.commands.SearchInvPluginCommand.onCommand( SearchInvPluginCommand.java:57) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.11.jar:git-Bukkit-c8ff651] ... 15 more

On 22 December 2016 at 07:16, Adam notifications@github.com wrote:

Closed #56 https://github.com/lishid/OpenInv/issues/56.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lishid/OpenInv/issues/56#event-903097446, or mute the thread https://github.com/notifications/unsubscribe-auth/AWYXsYQyJHDHFyGCe_PKDAsug1-Yx_c0ks5rKpQ8gaJpZM4LTjjG .

Jikoo commented 7 years ago

The current version of OpenInv is 3.0.4, you appear to be running 3.0.3.

Charzzart commented 7 years ago

Oh thank you so much. I assume there's no way to make it so that I can search inventories of offline players? If so, let me know. I use the plugin so much and it's really useful.

On 26 December 2016 at 01:44, Adam notifications@github.com wrote:

The current version of OpenInv is 3.0.4, you appear to be running 3.0.3.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lishid/OpenInv/issues/56#issuecomment-269192317, or mute the thread https://github.com/notifications/unsubscribe-auth/AWYXsT60Ag1WwvedkZ_g36CmNKxJLMnUks5rL4xigaJpZM4LTjjG .

Jikoo commented 7 years ago

Currently /searchinv and /searchender only search online players. If you do want that as a feature, please open a ticket for it. It's doable, just a bit painful - due to people having vast quantities of offline players, it would have to be done partially asynchronously and partially synchronously, which in turn leads to either difficulty aggregating the results into a single end line (spam) or longer delays. It'd probably be necessary to queue larger batch updates simultaneously or something, but then I'd probably have to add additional configuration to change the value. 1/2 max online players with a minimum of 10 doesn't seem unreasonable, I suppose. Both commands will likely just be completely merged and will search both simultaneously (loading that many players is decently expensive, and unless a server disables ender chests, both searches are likely to be performed consecutively) - they were already so completely identical that all it takes to support both commands in one executor is a single ternary operator.

Robby- commented 4 years ago

Currently /searchinv and /searchender only search online players.

I was about to open an issue for this, but then found this comment.

It would be a good idea to reword it so that it says its for online players only, on the CurseForge and Bukkit pages as well. I see that this git repo already has it worded correctly in the README.md. 👍