Resource icon

Experimental SGUI-API 0.1.0-Alpha

Compatible API Versions
1.0.0
Sourcecode
https://github.com/hhm666/SGUI-API
Contributors
hhm
SGUI-API

Current Versoin:0.1.0-Alpha


SGUI-API depends on KotlinLib

Notice:This plugin is for developers to use. Separate installation does not work. It requires other plugins to work with.

Example usage:

Java:
class SLogin : PluginBase(),Listener {
    private lateinit var loginGUI: LambdaCustomGUI

    override fun onLoad() {
        loginGUI = LambdaCustomGUI("SLogin_login", "Validation")
        loginGUI.addText("t1", "§l§6Welcome,Please enter nice below!")
        loginGUI.addInput("pw", "Verification Code")
        loginGUI.submittedClickedListener = BiConsumer { data, player ->
            if (player !is NukkitPlayer) return@BiConsumer
            if(data["pw"].toString()=="nice") {
                player.sendMessage("Verify success!")
            }else{
                player.kick("§cValidation failed")
            }
        }
        loginGUI.closedClickedListener = Consumer {
            player.kick("§cValidation failed")
        }
        this.server.pluginManager.registerEvents(GUIListener(), this)
        this.server.pluginManager.registerEvents(this, this)
    }
 
    @EventHandler(priority = EventPriority.LOWEST)
    fun onJoin(event: PlayerJoinEvent) {
        if (event.player !is NukkitPlayer) return
        player.showGUI(loginGUI)
    }
}
Please refer to the JavaDoc for specific usage.
Author
hhm
Downloads
999
Views
2,537
First release
Last update
Rating
0.00 star(s) 0 ratings
Top