Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/autosort with no args throws unexpected error #53

Open
Blaubeermuffin opened this issue Jan 8, 2025 · 9 comments
Open

/autosort with no args throws unexpected error #53

Blaubeermuffin opened this issue Jan 8, 2025 · 9 comments

Comments

@Blaubeermuffin
Copy link

Blaubeermuffin commented Jan 8, 2025

First, thanks for maintaining the plugin. It's awesome, imo!

When using the plugin there is a possibility of players just writing the command as /autosort, which will lead to following error message in the logs:

[22:50:22] [Server thread/ERROR]: Command exception: /autosort
org.bukkit.command.CommandException: Unhandled exception executing command 'autosort' in plugin automaticinventory v4.0.0
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.21.3-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:82) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
	at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:31) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:103) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:448) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.Commands.performCommand(Commands.java:355) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.Commands.performCommand(Commands.java:342) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.commands.Commands.performCommand(Commands.java:337) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2241) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$11(ServerGamePacketListenerImpl.java:2215) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:154) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1578) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:207) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:128) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1555) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1548) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:138) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1499) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1509) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1345) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:340) ~[paper-1.21.3.jar:1.21.3-81-da71382]
	at java.base/java.lang.Thread.run(Unknown Source) ~[?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
	at automaticinventory-4.0.0.jar/dev.chaws.automaticinventory.commands.AutoSortCommand.onCommand(AutoSortCommand.java:28) ~[automaticinventory-4.0.0.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.21.3-R0.1-SNAPSHOT.jar:?]
	... 27 more

I'm currently using the automaticinventory-4.0.0.jar on a Paper 1.21.3 server.

I noticed that there is a fork by TrekCraftTowny, which is a fork of the ChristopherHaws fork, that has implemented a solution/workaround for this issue, but it's not merged/published to devBukkit yet.

I'm also not sure, if /autosort was meant to open a GUI, in which you can toggle the states visually. Hope to see an update on this issue! <3

@RoboMWM
Copy link
Member

RoboMWM commented Jan 10, 2025

I gave ChristopherHaws access to upload on bukkitdev but I'm presuming he hasn't revisited it since. If @Momshroom is interested I wouldn't mind pulling a PR to get a new build.

@RoboMWM
Copy link
Member

RoboMWM commented Jan 10, 2025

Otherwise I can try also putting the check in too myself. But either way it seems I need to at least update the readme for this, as I don't have much interest in maintaining it myself.

@Blaubeermuffin
Copy link
Author

I read that you gave ChristopherHaws permissions in the other issues and I would've reported it in their form, except I didn't see the option to report issues in the fork...

And it's totally understandable that you don't have interest in maintaining this anymore.

@RoboMWM
Copy link
Member

RoboMWM commented Jan 10, 2025

And it's totally understandable that you don't have interest in maintaining this anymore.

Yea, I haven't used it for many years. I'll try to cherry-pick the commit to have at least the proper attribution.

@RoboMWM
Copy link
Member

RoboMWM commented Jan 10, 2025

ok, not an easy cherry pick since the code was refactored.

@RoboMWM
Copy link
Member

RoboMWM commented Jan 10, 2025

ah, I remember now. I gave him access, and I think he just uploaded his fork of the code to bukkitdev. I don't think he ever merged his code here unfortunately.

@RoboMWM
Copy link
Member

RoboMWM commented Jan 10, 2025

are there issues with using the prior version of automaticinventory on bukkitdev?

@Momshroom
Copy link

I can try a PR to you. But compiling the one on the Christopher Hawes one works and iirc, the latest here had a build failure.

@Blaubeermuffin
Copy link
Author

ah, I remember now. I gave him access, and I think he just uploaded his fork of the code to bukkitdev. I don't think he ever merged his code here unfortunately.

If you go by the naming scheme change for the latest versions on bukkitdev, it looks like they never merged it to the main repo.

I can try a PR to you. But compiling the one on the Christopher Hawes one works and iirc, the latest here had a build failure.

That'd be awesome, since the main repo would be the most up to date again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants