Coder Social home page Coder Social logo

adventure-kt's Introduction

adventure-kt

English | 简体中文

Warning

This project is still working in progress.

Some interfaces may not work / change in the future.

Use it as your own risk.

⛏️ Full Kotlin support for Kyori Adventure.

🤔 purpose

Since Kotlin brought us the ability to create Extensions, we can create DSLs.

This project aimed to create many DSL utilities for adventure's builder pattern API, which make your life easier.

📦 artifacts

repository

repositories {
    maven(uri("https://maven.nostal.ink/repository/maven-public/"))
}

dependency

dependencies {
    // Use shadowJar to shade the artifact into your jar
    api("ink.pmc.advkt:core:1.0.0-SNAPSHOT")
}

tasks.shadowJar {
    relocate("ink.pmc.advkt", "com.example.libs.advkt")
}

🗯️ chat

  • QQ Group: 682322881

☕ examples

creating a component

component {
    text("This is a text component, nothing special.")
    text("This is a colorized text component.") with red()
    text("This is a colorized text component.") with color(249, 226, 145) // support RGB and hex color
    newline()
    text("This is a styled text component.") with bold() without italic()
}

// you can also use the following syntax
player.send {
    text("This is a text component, nothing special.")
}

creating a title

title {
    mainTitle {
        text("This is a main title.")
    }
    subTitle {
        text("This is a sub title.")
    }
    // support both Kotlin duration and Java duration
    times {
        fadeIn(1.seconds)
        stay(1.seconds)
        fadeOut(1.seconds)
    }
}

adventure-kt's People

Contributors

deechael avatar nostalfinals avatar

Stargazers

 avatar Dreeam avatar Daniel Zhang avatar

Forkers

xiaozhangup

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.