8000 Support for Bukkit#createCommandSender · Issue #488 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

6480 Skip to content
Support for Bukkit#createCommandSender #488
Closed
@learliet

Description

@learliet

CommandAPI version

9.1.0

Minecraft version

1.20.1

Are you shading the CommandAPI?

Yes

What I did

I encountered an issue when trying to use Bukkit#createCommandSender in combination with Bukkit#dispatchCommand.

val myCommandSender = Bukkit.createCommandSender { }
Bukkit.dispatchCommand(myCommandSender, "<anycommandapicommand>")

What actually happened

Executing commands from custom senders generated by Bukkit#createCommandSender results in a NullPointerException (see below) due to incorrect handling by the CommandAPI.

What should have happened

The CommandAPI should support the special CommandSender returned by Bukkit#createCommandSender.

Server logs and CommandAPI config

Cannot invoke "[...].dev.jorel.commandapi.commandsenders.AbstractCommandSender.getSource()" 
because "this.val$sender" is null

Other

Given this method, the CommandAPI assumes that CommandSender will only be the types provided by Spigot. However, on Paper, Bukkit#createCommandSender returns io.papermc.paper.commands.FeedbackForwardingSender, which extends CommandSender.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0