-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
CommandAPI's NativeProxyCommandSender
cannot run vanilla commands
#477
Labels
bug
Something isn't working
Comments
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Aug 7, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
19 tasks
19 tasks
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Aug 12, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Aug 17, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Sep 22, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Nov 11, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Dec 16, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Dec 28, 2023
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Jan 1, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Feb 26, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Mar 31, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Apr 13, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
May 1, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
May 14, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
May 14, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Jun 3, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Jul 4, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
willkroboth
added a commit
to willkroboth/CommandAPI
that referenced
this issue
Aug 15, 2024
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CommandAPI version
9.0.4-SNAPSHOT
Minecraft version
1.20.1
Are you shading the CommandAPI?
Yes
What I did
I registered this
test
command inonEnable
:Run the
test
commandWhat actually happened
This exception is thrown (running the command as console - similar exceptions happen for other
CommandSender
):What should have happened
The Vanilla
say
command should have been executed without an exception.Server logs and CommandAPI config
No response
Other
The exception is thrown by
VanillaCommandWrapper#getListener
:Specifically, the exception is thrown when an instance of the CommandAPI's
NativeProxyCommandSender
is passed into this method. Thetest
command here replicates this by usingexecutesNative
to get aNativeProxyCommandSender
, and runs the Vanillasay
command, which is handled by theVanillaCommandWrapper
.Since
NativeProxyCommandSender
extendsProxiedCommandSender
, it passes into the last if-statement. That code assumes the sender is anorg.bukkit.craftbukkit.v1_20_R1.command.ProxiedNativeCommandSender
and casts it as such. This cast fails, and theClassCastException
is thrown.This is not a Spigot bug. As SPIGOT-7023 states specifically for
CommandSender
, classes in the Bukkit API are generally not designed to be implemented, and any bugs resulting from doing so will be disregarded. This bug happens because the CommandAPI tried to implement theorg.bukkit.command.ProxiedCommandSender
class, which is not supported.While Bukkit does not support this situation, it can be worked around. If the CommandAPI's
NativeProxyCommandSender
extendedProxiedNativeCommandSender
, thenVanillaCommandWrapper
would work as expected. Unfortunately,ProxiedNativeCommandSender
is a version-specific CraftBukkit class, so making this work is not trivial. However, it should be possible to make this work, and personally, I have successfully implemented something similar before.The text was updated successfully, but these errors were encountered: