Git Product home page Git Product logo

commandtree's Introduction

CommandTree Library

CommandTree is a Kotlin-based library for managing command trees in your applications.

Installation

You can include CommandTree in your project by adding the JitPack repository to your build configuration and then adding the library as a dependency.

Gradle

Add the JitPack repository to your build.gradle.kts file:

repositories {
    maven { url = uri("https://jitpack.io") }
}

Add the CommandTree dependency:

dependencies {
    implementation("com.github.WantToBeeMe:CommandTree:1.1.0")
}

Usage

To use CommandTree in your Kotlin application, you need to initialize the CommandTreeSystem in your onEnable method:

class YourPlugin : JavaPlugin() {

    override fun onEnable() {
        // Initialize CommandTreeSystem with your plugin instance and title
        CommandTreeSystem.initialize(this, "YourPluginTitle")
        
        // Your other initialization code here
    }

    // Your plugin logic here
}

You need to provide this initialize method with your plugin instance and a title. The instance is used internally whenever it needs something related to the plugin (like a list of all players, or subscribing a command) The title is used for example when an error happens, or any other feedback to the commander.

If you see commander in the source code, you will know that is referencing a player which sends the command in the chat.

Examples

There are 2 examples in the examples folder:

  • HelloWorldCommand: This demonstrates how to use CommandTree with a very basic command
  • GroupCommand: This provides a more advanced usage scenario.

and this is the list of partials that can be used

  • BranchPartial
  • EmptyPartial
  • BooleanPartial
  • StringPartial
  • PlayerPartial
  • IntPartial
  • DoublePartial
  • LocationPartial
  • VarargPartial
  • PairPartial
  • TriplePartial

License

IDK how licenses work. If I ever find the time to assign a license, it will be a license that basically says "do whatever you want with it, Just reference me somewhere in the comments for example"

commandtree's People

Contributors

wanttobeeme avatar

Watchers

 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.