Giter VIP home page Giter VIP logo

Comments (3)

Fabb111 avatar Fabb111 commented on August 16, 2024

Ok, I found out what the problem was. If the command is declared in the plugin.yml, it will not register because of this check:

public DispatcherCommand register(LiteralCommandNode<CommandSender> command) {
    if (this.map.getKnownCommands().containsKey(command.getName())) {
        return null;
    } else {
        DispatcherCommand wrapped = this.wrap(command);
        this.map.register(this.prefix, wrapped);
        return wrapped;
    }
}

Is this intended? Maybe this should be documented

from chimera.

Pante avatar Pante commented on August 16, 2024

It is intended, the reason why we check if map.getKnownCommands() already contains the given command is to prevent people from accidentally overriding commands that they (or other plugins) already registered. That said, I won't recommend using scribe to register commands.

Scribe has been slated for removal in 4.9.0 since from my understanding no one really uses, putting into question the maintenance-to-benefit ratio. Secondly, I just no longer believe that annotations to plugin.yml is the best solution. Going forward, I probably will be writing a lint for plugin.ymls that potentially replaces placeholders with values from a pom.xml/other build files but I digress.

If you're interested in using annotations to register commands, I would recommend using the new typist project. It's a revamped & repackaged version of creating commands with annotations. It is pretty much feature complete, but we're still in the midst of testing and fine-tuning it.

Lastly, I agree that this behaviour should have been documented, thanks for highlighting it.

from chimera.

Fabb111 avatar Fabb111 commented on August 16, 2024

Thank you for your detailed explanation!

from chimera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.