All Projects → heroslender → menu-framework

heroslender / menu-framework

Licence: MIT license
Yet another menu framework for bukkit, but, using maps this time.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to menu-framework

HamsterAPI
Simple and easy to use API to read and write Packets.
Stars: ✭ 25 (-50%)
Mutual labels:  spigot, spigot-api
spigot-tg-bridge
Connect Telegram chats and Minecraft servers seamlessly
Stars: ✭ 27 (-46%)
Mutual labels:  spigot, spigot-api
Lukkit
Lukkit allows developers to create plugins for the Spigot API in an efficient and effective manner using the Lua scripting language. Detailed documentation makes getting started with Lukkit super simple.
Stars: ✭ 62 (+24%)
Mutual labels:  spigot, spigot-api
Bukkit Coding Tutorial
This is the repository for my Bukkit Coding series
Stars: ✭ 44 (-12%)
Mutual labels:  spigot, spigot-api
EliteMobs
This is a spigot plugin that aims to extend Minecraft's survival endgame by making mobs more interesting.
Stars: ✭ 114 (+128%)
Mutual labels:  spigot, spigot-api
UltiTools
This is a sum of some basic plugins of a Bukkit server or Spigot server. Including a few useful and creative functions.
Stars: ✭ 17 (-66%)
Mutual labels:  spigot, spigot-api
NotQuests
Flexible, open & solid paper Quest Plugin [with GUI]
Stars: ✭ 32 (-36%)
Mutual labels:  spigot, spigot-api
Payload
Fail-safe asynchronous profile & object caching via Redis & MongoDB in Java for Spigot
Stars: ✭ 23 (-54%)
Mutual labels:  spigot, spigot-api
Purpur
Purpur is a drop-in replacement for Paper servers designed for configurability, and new fun and exciting gameplay features.
Stars: ✭ 1,224 (+2348%)
Mutual labels:  spigot
NoSpawnChunks
Helps manage server memory by dynamically unloading chunks
Stars: ✭ 21 (-58%)
Mutual labels:  spigot
Hotpur
A fork of Purpur that aims to improve performance and add FabricMC compatibility.
Stars: ✭ 17 (-66%)
Mutual labels:  spigot
ResourcepacksPlugins
Set resource packs on whole proxy, per server and per world!
Stars: ✭ 47 (-6%)
Mutual labels:  spigot
ScriptBlockPlus
任意のブロックにスクリプトを追加するプラグインです。
Stars: ✭ 25 (-50%)
Mutual labels:  spigot
OtherDrops
An updated version of the OtherDrops plugin originally by Cyclo and Zarius; updated by CoolLord22
Stars: ✭ 19 (-62%)
Mutual labels:  spigot
Duels
A duel plugin for minecraft.
Stars: ✭ 66 (+32%)
Mutual labels:  spigot
Spigot-Generator-MCreator
A Spigot Generator plugin for MCreator
Stars: ✭ 15 (-70%)
Mutual labels:  spigot
TradePlus
Easy-to-use, highly configurable trading plugin for Spigot- and Bukkit-based Minecraft servers.
Stars: ✭ 42 (-16%)
Mutual labels:  spigot
BetterChairs
BetterChairs is a Minecraft plugin, that allows you to sit on chairs.
Stars: ✭ 24 (-52%)
Mutual labels:  spigot
WildChests
Sell chests, auto crafters, storage units, larger chests and more in one plugin!
Stars: ✭ 20 (-60%)
Mutual labels:  spigot
ReflectionHelper
API for accessing various classes and their members using reflection. (Specifically for Minecraft)
Stars: ✭ 34 (-32%)
Mutual labels:  spigot

HMF - Heroslender Menu Framework

GitHub Workflow Status Maven metadata URL GitHub stars GitHub issues GitHub last commit Open Source Love

Innovating the way you make menus in minecraft java edition by using maps to render a custom UI and allowing the player to interact with it.

Sample

Creating a new menu

class SampleMenu(player: Player, manager: BukkitMenuManager) : BaseMenu(
    opts = MenuOptions.builder {
        width = 4
        height = 3
        privateFor(player)
    },
    manager = manager,
) {
    private val counter = mutableStateOf(0)
    
    override fun Composable.getUi() {
        Column(modifier = Modifier.fillSize().background(Color.CYAN_7)) {
            Box(
                modifier = Modifier
                    .padding(10)
                    .size(50, 50)
                    .clickable {
                        counter.value++
                        whoCLicked.sendMessage("${ChatColor.GREEN}Counter incremented to ${counter.value}!")
                    }
                    .border(Color.BLACK_1)
                    .background(Color.GREEN_10)
            )
            Box(
                modifier = Modifier
                    .padding(0, 10)
                    .size(50, 50)
                    .clickable {
                        counter.value--
                        whoCLicked.sendMessage("${ChatColor.RED}Counter decremented to ${counter.value}!")
                    }
                    .border(Color.BLACK_1)
                    .background(Color.RED_1)
            )

            // Bind the state to this component, so that the
            // component updates with it.
            val count = withState(counter)
            Label(
                "Couter value: $count",
                style = FontStyle(
                    font = UBUNTU_MONO_16,
                    color = Color.BLACK_1,
                    shadowColor = Color.GRAY_13
                ),
                modifier = Modifier.padding(10)
            )
        }
    }
}

Result:

Render Result

Sending the menu to the player

In order to create menus you need a MenuManager, it is responsible to handle the cursor updates and player interactions. A single MenuManager instance can be shared among multiple menus & players.

val manager = BukkitMenuManager(yourPlugin)

val menu = SampleMenu(player, manager)
menu.send()

// To close the menu just call the `Menu#destroy` method.
menu.destroy()

Dependency

Gradle kts

repositories {
    maven("https://nexus.heroslender.com/repository/maven-public/")
}

dependencies {
    implementation("com.heroslender:hmf-bukkit:0.0.1-SNAPSHOT")
}

Maven

<repository>
    <id>heroslender-repo</id>
    <url>https://nexus.heroslender.com/repository/maven-public/</url>
</repository>
<dependency>
    <groupId>com.heroslender</groupId>
    <artifactId>hmf-bukkit</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].