GithubHelp home page GithubHelp logo

electroid / intake Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 12.0 366 KB

Easy-to-use framework for creating commands, especially in Minecraft

License: GNU Lesser General Public License v3.0

Java 100.00%
bukkit command-line java minecraft

intake's People

Contributors

applenick avatar crejk avatar cswhite2000 avatar dentmaged avatar electroid avatar iangbb avatar themolkapl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

intake's Issues

Optionals, nullables, and switches

The argument parser is horribly broken by this line of code:
https://github.com/Electroid/intake/blob/master/core/src/main/java/app/ashcon/intake/parametric/ArgumentParser.java#L351

It implies that if one optional parameter has already been added, no more optionals can be there, and that's simply false. What you can't have is required parameters after an optional parameter, but that is already checked for in https://github.com/Electroid/intake/blob/master/core/src/main/java/app/ashcon/intake/parametric/ArgumentParser.java#L373

I have no clue where this code comes from, as in, why was it added. In the original version of intake is simpler and less convoluted https://github.com/EngineHub/Intake/blob/master/intake/src/main/java/com/sk89q/intake/parametric/ArgumentParser.java#L241 but it doesn't support @Nullable and java's Optional type, instead, it relies on only using the @Optional annotation.

This is a blocking issue that makes many commands impossible to fix

TabCompleter Question

Hello, I recently started using your library for my Spigot plugins and I have some questions about the TabCompleter.

I understood that the nodes allow to make sub-commands, but I don't understand how to make that when I make for example "/enchant add" it proposes me afterwards a list of enchantment as tabCompleter (like "/enchant add DAMAGE_ALL" as another example).

Here I hope you can help me possibly explain me something that I would not have understood in relation to this library!

(I don't speak english so if you don't understand don't hesitate to ask me to rephrase it !)

Brigadier Support?

Not sure if this is already implemented, and apologies if it is, but since Brigadier has come out it has allowed for richer tab complete for Minecraft. I was wondering if Intake would ever support this for Bukkit/Spigot (of course 1.13.2+, but still allowing backwards compatibility by just disabling Brigadier components if necessary)? A library already exists for adding this tab complete to existing commands (https://github.com/lucko/commodore, used in https://github.com/lucko/LuckPerms), and I would think it would be a suitable addition to Intake, since it already handles tab complete already (according to me reading code).

Maven Version on readme

https://repo.ashcon.app/nexus/content/repositories/snapshots/app/ashcon/intake/intake-core/

This is on version 1.1 not 1.0 as stated in the readme.

<repositories>
  <repository>
    <id>ashcon.app</id>
    <url>https://repo.ashcon.app/nexus/content/repositories/snapshots/</url>
  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>app.ashcon.intake</groupId>
    <!-- Use "intake-core" if you don't want Minecraft -->
    <artifactId>intake-bukkit</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
</dependencies>

Google error

When I use intake v1.1-SNAPSHOT the following error shows inside the console

07.05 22:45:53 [Server] INFO java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor()Lcom/google/common/util/concurrent/ListeningExecutorService; 07.05 22:45:53 [Server] INFO at dev.loapu.vestriafoodproject.libs.intake.parametric.ParametricBuilder.<init>(ParametricBuilder.java:51) ~[?:?] 07.05 22:45:53 [Server] INFO at dev.loapu.vestriafoodproject.libs.intake.bukkit.graph.BasicBukkitCommandGraph.<init>(BasicBukkitCommandGraph.java:21) ~[?:?] 07.05 22:45:53 [Server] INFO at dev.loapu.vestriafoodproject.VestriaFoodProject.registerCommands(VestriaFoodProject.java:88) ~[?:?] 07.05 22:45:53 [Server] INFO at dev.loapu.vestriafoodproject.VestriaFoodProject.onEnableInner(VestriaFoodProject.java:74) ~[?:?]

I use Spigot (CraftBukkit version git-Spigot-f56e2e7-1a64d4a (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)) on my server. Does this happen because I shadowed the library or is there anything you can do about it?

Quotes are removed from command arguments

If there is an even number of quotes in the arguments of a command, the outer pair is always removed. The string a "string with "quotes"" becomes a string with "quotes", for example. This is not always desirable (see PGMDev/PGM#259).

This appears to be the cause of the problem:

case '"':
final StringBuilder build = new StringBuilder();
final char quotedChar = arg.charAt(0);
int endIndex;
for (endIndex = i; endIndex < args.length; ++endIndex) {
final String arg2 = args[endIndex];
if (arg2.charAt(arg2.length() - 1) == quotedChar && arg2.length() > 1) {
if (endIndex != i) {
build.append(' ');
}
build.append(arg2.substring(endIndex == i ? 1 : 0, arg2.length() - 1));
break;
}
else if (endIndex == i) {
build.append(arg2.substring(1));
}
else {
build.append(' ').append(arg2);
}
}
if (endIndex < args.length) {
arg = build.toString();
i = endIndex;
}
// In case there is an empty quoted string
if (arg.isEmpty()) {
continue;
}
// else raise exception about hanging quotes?
}

Add duration parsing

Add simple support for a Duration provider.

30m -> 30 minutes
5s -> 5 seconds
1h -> 1 hour

Add support for CompletableFutures

Allow Providers to be executed asynchronously with a CompletableFuture, that doesn't require complicated handling of futures in the parametric command.

None of this:

@Command
void getUser(CompletableFuture<User> user) {}

Just this, but executed asynchronously.

@Command
void getUser(User user) {}

Make version independent

A lot of the issues, including #12, have to do with our custom version of Bukkit. Separate into multiple modules and build against several Minecraft versions (1.8 and up).

Command description in help is null

null

How can I fix that?

  • Using the bukkit folder in the repository.
  • Using Spigot 1.8.8

Set command
generation

Wand command
wand

onLoad method
onload

Thanks in advice

Error Registering Commands

org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: app/ashcon/intake/fluent/CommandGraph

I get that error when booting up my Test Server while trying to test my plugin

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.