w0819 / InventoryGUI

This is Minecraft paper gui API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InventoryGUI

This is Minecraft paper gui library.

Library Feature

  • DSL style code
  • Modular inventory gui with no event declaration required

Library License

This API uses the GPL-3.0 open source license.

Import Library

  • Maven
<repositories>
    <repository>
        <releases>
            <enabled>true</enabled>
        </releases>
        <id>central</id>
        <url>https://repo.maven.apache.org/maven2</url>
    </repository>
</repositories>

<dependency>
    <groupId>net.projecttl</groupId>
    <artifactId>InventoryGUI-api</artifactId>
    <version>VERSION</version>
</dependency>
  • Gradle (Groovy DSL)
repositories {
  mavenCentral()
}

dependencies {
  compileOnly 'net.projecttl:InventoryGUI-api:VERSION'
}
  • Gradle (Kotlin DSL)
repositories {
  mavenCentral()
}

dependencies {
  compileOnly("net.projecttl:InventoryGUI-api:VERSION")
}

Do not shade it! This can installed without shade (latest only feature)!

  • Plugin.YML (latest only)
# ...
libraries:
  - net.projecttl.InventoryGUI-api:VERSION
# ...

How to use this Library

This api must use kotlin only. (you can use java but it will be hard.)

class TestGui(val plugin: JavaPlugin) {
  fun inventory(player: Player) {
    player.gui(plugin, InventoryType.CHEST_27, Component.text("TestGUI")) {
        slot(0, ItemStack(Material.GRASS_BLOCK)) {
            player.sendMessage("Hello!")
        }

        // dummy slot
        slot(1, ItemStack(Material.IRON_INGOT))
    }
  }
}

About

This is Minecraft paper gui API

License:GNU General Public License v3.0


Languages

Language:Kotlin 99.0%Language:Java 1.0%