Comments (3)
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.
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.yml
s 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.
Thank you for your detailed explanation!
from chimera.
Related Issues (20)
- [BUG] After reparsing CommandContext arguments are empty HOT 2
- com.karuslabs.commons 4.8.0-SNAPSHOT maven-metadata.xml not found! HOT 1
- Dependabot couldn't find a pom.xml for this project
- Your .dependabot/config.yml contained invalid details HOT 1
- 1.17 support? HOT 4
- [BUG] Suggestions not suggested after reload
- Command description HOT 2
- [Enhancement] Command block support HOT 2
- [Enhancement] Support repeating command sequences
- [BUG] `StringArgumentType.word()` does not support non-ASCII characters HOT 20
- any chance to make the project multi-version? HOT 3
- [BUG] Bad service configuration file, or exception thrown while constructing Processor object: com/karuslabs/utilitary/AnnotationProcessor HOT 2
- Commands.java generation HOT 2
- Command never gets executed HOT 4
- [BUG] WordType.word() not compatible with non-ASCII characters HOT 5
- [BUG] ClassNotFoundException, it tried to find obc.v1_19_R1, but the package in server is obc.v1_19_R2. HOT 3
- Dependency Dashboard
- [BUG] Non-existent method HOT 5
- Could not GET dependency metadata.xml HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chimera.