Giter VIP home page Giter VIP logo

intake's Introduction

Intake Build Status

Intake is a command parsing library that can be implemented along various platforms, such as Minecraft.

When a user inputs a command:

/sum 1 2

You can easily handle that request with only a couple lines of code.

public class Commands {
   @Command(
       aliases = "sum",
       desc = "Adds two numbers and returns their result",
       perms = "math.sum",
       usage = "[number] [number]"
   )
   public void sum(CommandSender user, int a, int b) {
       user.sendMessage(a + b);
   }
}

Intake allows you to define custom providers for your own classes and handle errors with ease. Check out the detailed breakdown of the project for more details.

Example

To see how easy it is to implement Intake, take a look at the Bukkit module. For game developers that want to extend that module specifically, all you need to do is add this to your JavaPlugin class:

@Override
public void onLoad() {
   BasicBukkitCommandGraph cmdGraph = new BasicBukkitCommandGraph();
   cmdGraph.getRootDispatcherNode().registerCommands(new Commands());
   new BukkitIntake(this, cmdGraph).register();
}

An example Bukkit plugin is provided for your convenience here.

Installation

Release and snapshot artifacts are automatically deployed to my Nexus repo. Include the following snippet in your pom.xml to start using Intake.

<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.2-SNAPSHOT</version>
  </dependency>
</dependencies>

Compiling

Use Maven to compile Intake.

mvn clean install

Attributions

Intake was adapted from sk89q's abandoned fork, but heavily modified and abstracted. Therefore, it is available under the GNU Lesser General Public License.

I happily accept contributions, especially through pull requests on GitHub!

intake's People

Contributors

electroid avatar iangbb avatar themolkapl avatar crejk avatar cswhite2000 avatar

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.