Comments (2)
Thank you for the bug report, I'll see how I can fix it!
from kelp.
I have now fixed the bug. Actually, it was not a real bug, as PLAYER_AND_CONSOLE
only called the onCommand(ConsoleSender, args)
method and not the player method, because the command should be the same for players and consoles. But I have now changed it so that you can have both onCommand
methods and depending on the executor, the corresponding method will be called.
If you want to have the same command handler method for both player and console, then you could do something like that:
@CreateCommand(name = "helloworld", executorType = ExecutorType.PLAYER_AND_CONSOLE)
public class test extends KelpCommand {
private KelpConsoleSenderFactory senderFactory;
@Inject
public test(KelpConsoleSenderFactory senderFactory) {
this.senderFactory = senderFactory;
}
@Override
public void onCommandRegister() {
allowCustomParameters(true);
}
@Override
public void onCommand(KelpConsoleSender consoleSender, String[] args) {
System.out.println("command executed by either player or console " + Arrays.toString(args));
}
@Override
public void onCommand(KelpPlayer player, String[] args) {
CommandSender sender = player.getBukkitPlayer();
this.onCommand(senderFactory.newKelpConsoleSender(sender), args);
}
}
The fix will be released with v0.0.4
from kelp.
Related Issues (20)
- [feat]: Use or remove name tag of NPCs HOT 1
- [bugreport]: IllegalArgumentException on Scoreboard show/update HOT 1
- [bugreport]: KelpPlayer#setTabListName only works one time HOT 1
- [feat]: KelpEvents HOT 1
- [bugreport]: NoSuchElementException when player quits during server reload
- [bugreport]: Scoreboard does not update HOT 8
- [bugreport]: KelpCommand#onCommandRegister gets executed multiply times on the same instance HOT 2
- Please provide JavaDoc HOT 1
- Make inventories reusable for multiple players HOT 1
- [bugreport]: KelpItem#getItemStack returns an ItemStack without the Description/Lore HOT 1
- Read nbt Tags in KelpItem HOT 1
- [feature] Pagination widget with lazy loading HOT 2
- [bugreport]: Harddepenencies on Kelp Apps not working HOT 1
- [feature] A CommandSender interface like in bukkit HOT 5
- [feature] Declarative Command System for Kotlin and Java Kelp Apps HOT 2
- [bugreport]: kelp shows wrong version HOT 1
- [feature]: Drag and Drop for inventories HOT 3
- [question]: When I create an NPC, It return null and error
- [bugreport]: Fehler beim Laden des Cores 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 kelp.