zephyr.storm.pk

Create a Full Replica Of DonutSMP Bounty plugin with folia and paper support here imgs jasa muja chiye

1 image attached
Kodari AI
KodariAug 11 at 10:47 am 3
DonutBountySystem
Implements a comprehensive bounty system plugin for Minecraft servers. Players can set bounties on other players using in-game currency, and hunters can claim rewards by killing the target. Features include bounty board GUI displaying all active bounties, configurable reward multipliers for kill streaks, timed bounty expiration, and leaderboard tracking of top bounty hunters. Supports both Paper and Folia server platforms with thread-safe scheduling, and integrates with Vault economy for currency handling. Includes cooldown systems to prevent bounty abuse, and a full command set with permissions for managing the bounty system.

Plan:

  1. Create the Maven/FoliaLib project skeleton and plugin metadata.

  2. Implement bounty storage, economy integration, commands, GUI, kill rewards, and persistence.

  3. Add configurable messages/settings and README usage notes.

Created a Maven-based BountySMP plugin with Paper and Folia support.

Features included:

  • /bounty GUI bounty board

  • /bounty add <player> <amount>

  • /bounty remove <player>

  • /bounty removeAll

  • /bounty top

  • /bounty reload

  • Configurable GUI, messages, limits, and colors

  • Player-head bounty entries

  • Sorting, refresh, and pagination buttons

  • Vault economy integration

  • Automatic bounty rewards when the target is killed

  • YAML persistence in bounties.yml

  • FoliaLib scheduling and folia-supported: true

  • Maven project setup only, with no Gradle files

zephyr.storm.pk

add support for HEXCOLORS AND PLS MAKE SAME LORES AND DESCRIPTION WITH SAME HEXCOLORS

1 image attached
Kodari AI
KodariAug 11 at 10:50 am 1

Plan:

  1. Add a shared hex/legacy color renderer for messages and GUI text.

  2. Update every bounty GUI title, item lore, and button description to match the shown green/white style.

  3. Preserve Maven-only setup and make all configured text reload-safe.

Added full HEX color support using &#RRGGBB and #RRGGBB formats.

Updated:

  • Message rendering

  • GUI title colors

  • Bounty player names and lore

  • Previous/next buttons

  • Sort button description

  • Refresh button description

  • /bounty add (player) (amount) GUI hint

  • Green/white styling matching the provided design

Example configuration:

YAML
gui:
  title: '&#00D084BOUNTIES &#FFFFFF- {page}/{pages}'
  bounty-name: '&#55FFAA{player}'
  bounty-lore:
    - '&fBounty: &#55FFAA${amount}'

Maven-only setup was preserved; no Gradle files were created.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
Code
14 717
src/main/kotlin/com/kodari/bountysmp/command/BountyCommand.kt
package com.kodari.bountysmp.command

import com.kodari.bountysmp.BountySmpPlugin
import com.kodari.bountysmp.economy.EconomyBridge
import com.kodari.bountysmp.gui.BountyGui
import com.kodari.bountysmp.message.MessageService
import com.kodari.bountysmp.storage.BountyManager
import org.bukkit.Bukkit
import org.bukkit.ChatColor
import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender
import org.bukkit.command.TabCompleter
import org.bukkit.entity.Player
import java.util.Locale

class BountyCommand(
    private val plugin: BountySmpPlugin,
    private val bounties: BountyManager,
    private val economy: EconomyBridge,
    private val gui: BountyGui,
    private val messages: MessageService
) : CommandExecutor, TabCompleter {
    private val subcommands = listOf("add", "remove", "removeAll", "top", "reload")

    override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
        if (!sender.hasPermission("bountysmp.use")) return true
        if (args.isEmpty()) {
            if (sender !is Player) {
                messages.send(sender, "help")
            } else {
                gui.open(sender)
            }
            return true
        }

        when (args[0].lowercase(Locale.ROOT)) {
            "add" -> add(sender, args)
            "remove" -> remove(sender, args)
            "removeall" -> removeAll(sender)
            "top" -> top(sender)
            "reload" -> reload(sender)
            else -> help(sender)
        }
        return true
    }

    private fun add(sender: CommandSender, args: Array<out String>) {
        if (sender !is Player || args.size < 3) {
            messages.send(sender, "help")
            return
        }
        if (!economy.isAvailable()) {
            messages.send(sender, "no-economy")
            return
        }

        val target = resolveTarget(args[1])
        if (target == null) {
            messages.send(sender, "player-not-exist")
            return
        }
        if (plugin.config.getBoolean("settings.prevent-self-bounty", true) && target.uniqueId == sender.uniqueId) {
            messages.send(sender, "cant-self-bounty")
            return
        }
        val amount = args[2].toDoubleOrNull()
        if (amount == null || !amount.isFinite() || amount <= 0.0) {
            messages.send(sender, "invalid-amount")
            return
        }

        val minimum = plugin.config.getDouble("settings.minimum-bounty", 1.0)
        val maximum = plugin.config.getDouble("settings.maximum-bounty", 1_000_000_000.0)
        val current = bounties.get(target.uniqueId)?.amount ?: 0.0
        if (amount < minimum) {
            messages.send(sender, "minimum-price", mapOf("amount" to money(minimum)))
            return
        }
        if (current + amount > maximum) {
            messages.send(sender, "maximum-price", mapOf("amount" to money(maximum)))
            return
        }
        val balance = economy.balance(sender)
        if (balance < amount) {
            messages.send(sender, "insufficient-funds", mapOf("amount" to money(amount), "balance" to money(balance)))
            return
        }
        if (!economy.withdraw(sender, amount)) {
            messages.send(sender, "insufficient-funds", mapOf("amount" to money(amount), "balance" to money(economy.balance(sender))))
            return
        }

        val bounty = bounties.add(target.uniqueId, target.name ?: args[1], amount, sender.uniqueId)
        plugin.saveBountiesAsync()
        if (current > 0.0) {
            messages.send(sender, "increased-bounty", mapOf("player" to bounty.targetName, "amount" to money(bounty.amount)))
        } else {
            messages.send(sender, "new-bounty", mapOf("player" to bounty.targetName, "amount" to money(bounty.amount)))
        }
    }

    private fun remove(sender: CommandSender, args: Array<out String>) {
        if (args.size < 2) {
            messages.send(sender, "help")
            return
        }
        val target = resolveTarget(args[1])
        if (target == null) {
            messages.send(sender, "player-not-exist")
            return
        }
        val bounty = bounties.remove(target.uniqueId)
        if (bounty == null) {
            messages.send(sender, "no-bounty")
            return
        }
        if (sender is Player && economy.isAvailable()) economy.deposit(sender, bounty.amount)
        plugin.saveBountiesAsync()
        messages.send(sender, "removed-bounty", mapOf("player" to bounty.targetName, "amount" to money(bounty.amount)))
    }

    private fun removeAll(sender: CommandSender) {
        if (!sender.hasPermission("bountysmp.admin")) {
            sender.sendMessage(ChatColor.RED.toString() + "You do not have permission to do that.")
            return
        }
        val count = bounties.removeAll()
        plugin.saveBountiesAsync()
        messages.send(sender, "removed-all", mapOf("count" to count.toString()))
    }

    private fun top(sender: CommandSender) {
        sender.sendMessage(messages.render("top-header"))
        bounties.all().sortedByDescending { it.amount }.take(10).forEachIndexed { index, bounty ->
            messages.send(sender, "top-entry", mapOf("position" to (index + 1).toString(), "player" to bounty.targetName, "amount" to money(bounty.amount)))
        }
    }

    private fun reload(sender: CommandSender) {
        if (!sender.hasPermission("bountysmp.admin")) {
            sender.sendMessage(ChatColor.RED.toString() + "You do not have permission to do that.")
            return
        }
        plugin.reloadConfig()
        economy.refresh()
        sender.sendMessage(ChatColor.GREEN.toString() + "BountySMP configuration reloaded.")
    }

    private fun help(sender: CommandSender) {
        messages.renderList("help").forEach(sender::sendMessage)
    }

    private fun resolveTarget(name: String) =
        Bukkit.getPlayerExact(name) ?: Bukkit.getOfflinePlayer(name).takeIf { it.hasPlayedBefore() }

    private fun money(amount: Double): String = String.format(Locale.US, "%,.2f", amount)

    override fun onTabComplete(sender: CommandSender, command: Command, alias: String, args: Array<out String>): List<String> {
        if (args.size == 1) return subcommands.filter { it.startsWith(args[0], ignoreCase = true) }
        if (args.size == 2 && args[0].equals("add", true)) return Bukkit.getOnlinePlayers().map { it.name }.filter { it.startsWith(args[1], true) }
        if (args.size == 2 && args[0].equals("remove", true)) return bounties.all().map { it.targetName }.filter { it.startsWith(args[1], true) }
        return emptyList()
    }
}