legendin_yt
📎 1 file 3,163 chars
📄
pasted-code-1794707910966.txt
txt 55 lines
▶
# Leaderboard   
  
  
```
Create a Java Minecraft plugin called HoloBoards.

Server: Paper 26.3, latest Java version Paper requires, Maven. Soft-depend on my plugin CoreEconomy.

GOAL: Animated hologram leaderboards using TextDisplay entities with a semi-transparent black background box. Each board has a colored animated title, a "Top Ten Players" subtitle, and ranked lines like "1. PlayerName: value". Each topic has its own default color, editable in config and in-game.

COMMANDS (alias /lb):
- /leaderboard add  [name] - spawns a board where I'm looking/standing
- /leaderboard remove 
- /leaderboard list
- /leaderboard move  - moves it to my location
- /leaderboard refresh [name|all]
- /leaderboard edit  color 
- /leaderboard edit  title 
- /leaderboard edit  size 
- /leaderboard edit  rows <1-15>
- /leaderboard edit  background 
- /leaderboard edit  refresh 
- /leaderboard reload
All edits apply instantly, save to the board's data, and are also editable in config.yml. Tab completion for every argument.

TOPICS (registry, so new ones are easy to add later):
kills, mob_kills, deaths, kdr, money, gems, blocks_mined, blocks_placed, playtime.

DATA SOURCES:
- From CoreEconomy's public EconomyAPI class: money (getTopMoney), gems (getTopGems), kills (getTopKills), deaths (getTopDeaths), playtime (getTopPlaytime). kdr is calculated from kills and deaths.
- HoloBoards tracks itself in SQLite (async, cached, saved every 30 seconds and on shutdown): mob kills (EntityDeathEvent where killer is a player), blocks mined (BlockBreakEvent), blocks placed (BlockPlaceEvent). Ignore cancelled events. Store player names so offline players show correctly.
- If CoreEconomy is missing, log a clear console warning and hide the topics that need it instead of crashing. Use reflection or a soft-dependency so HoloBoards still loads without it.
- Format playtime as 12h 30m and money as $1,234 / 1.2K (configurable).

DISPLAY AND ANIMATION:
- TextDisplay with black transparent background (configurable alpha), configurable scale, billboard mode (fixed/center), see-through toggle.
- Animated title: color shimmer/gradient wave, speed configurable, can be turned off per board.
- Auto refresh every 60-120 seconds (global default plus per board). Fetch data async, update entities on the main thread.
- Boards survive restarts and chunk unloads: respawn on chunk load and startup, remove duplicates, never leave orphan entities.
- Optional footer "Refreshes in Xs".

CONFIG (config.yml + messages.yml):
- Messages with & colors and hex (&#RRGGBB).
- Per topic: title, color, number format, rows, line format.
- Defaults: top 10, refresh 90s, animation on.
Permissions: leaderboard.admin, leaderboard.view.

REQUIREMENTS:
- Full project structure (pom.xml, plugin.yml with softdepend: [CoreEconomy], main class, all classes).
- Clean, commented code. No placeholders or TODOs.
- Handle errors: no permission, invalid topic, duplicate name, console use, missing CoreEconomy.
- Must compile without errors and work on first run.
```
  
Kodari AI
KodariNov 15 at 2:05 am 2
HoloBoards
Animated hologram leaderboard plugin for Paper servers using TextDisplay entities. Creates semi-transparent black background boards with colored animated titles, top-ten ranked player lists, and configurable per-topic colors. Tracks player statistics in SQLite (mob kills, blocks mined/placed) and integrates with CoreEconomy for money, gems, kills, deaths, and playtime data. Features full command suite with tab completion, instant in-game editing, auto-refresh cycles, chunk-load persistence, and comprehensive config/messages files.
  • Create the Maven/Paper plugin skeleton and configuration for boards, topics, and messages.

  • Implement CoreEconomy reflection, cached SQLite stats, persistent TextDisplay boards, animation, and refresh handling.

  • Add admin commands, permissions, validation, and tab completion.

Created HoloBoards as a Maven Paper plugin with configurable TextDisplay boards, animated titles, per-board editing, tab-completed commands, and persistent locations. It also includes reflection-based CoreEconomy integration, SQLite-backed local stats, and handling for chunk loads and duplicate displays.

Use /leaderboard edit <name> animation true|false to toggle animation per board.

legendin_yt

brooo this is 100% wworking now i want you to just add 1 feature that is own like the leaderboard shows top ten players and at the bottom of it it shows like YOU: and shows your data likee block mined mob killed for every leader board and iff you are already someewhere in ttop tem like you are 5th position onn leaderboard then it will not show You because he is already onleaderboard and in config make us eedit the leaderboard players like we can make thee leaderboard show 15 top players indtead of 10 like that

Kodari AI
KodariNov 15 at 2:57 am 1
  • Add viewer-specific YOU: lines; hide the line when that viewer is already in the displayed ranks.

  • Fetch complete stat lists for personal values, including CoreEconomy topics, while keeping each board’s configured top-row limit.

  • Add a config default for row count and personal-line formatting; clean up private displays on movement, unload, and shutdown.

Added a private, viewer-specific YOU: line to each board. It shows that viewer’s value for the board’s topic and is hidden if they’re already among the displayed ranks.

Set display.rows: 15 for the default row count for new boards; you can override it per topic with topics.<topic>.rows. The limit remains 1–15. Existing boards keep their saved row count in boards.yml, or you can change one with /leaderboard edit <name> rows 15.

legendin_yt

yeah we can add as much row as we want like we can even add 30 the max limit is 50

Kodari AI
KodariNov 15 at 2:59 am 1
  • Raise the row cap to 50 for configured and saved boards.

  • Allow /leaderboard edit <name> rows up to 50 and add larger tab suggestions.

The row limit is now 50. Set display.rows: 30 in config.yml for new boards, or set rows: 30 under a specific topic. Existing boards can be changed with /leaderboard edit <name> rows 30; valid values are 1–50.

legendin_yt

remove kdr mob kills i don't need them and bytheway everything is working i just want to remove kdr and mob kills and i want you to also add scoreboard and tab in score board there will be ____________________ SERVER NAME Name: money: gems: kills: deaths:

Playtime: -------------------- SERVER IP

AND MAKE THE SCOREBOARD AND TAB EDITABLE IN CONFIG

Kodari AI
KodariWed at 1:31 am 4
  1. Remove the KDR and mob-kills leaderboard topics.

  2. Add a configurable scoreboard and tab list with player stats.

  • Removed KDR and mob-kills topics, including their existing boards.

  • Added a configurable scoreboard and tab header/footer under player-displays in config.yml. Change the server name and IP there, then use /leaderboard reload.

  • CoreEconomy values unavailable through its top-list API display as -- rather than an incorrect value.

The scoreboard uses the sidebar, so it may conflict with other scoreboard plugins.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
Code
20 2,093
src/main/java/com/kodari/holoboards/HoloBoardsPlugin.java
package com.kodari.holoboards;

import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public class HoloBoardsPlugin extends JavaPlugin implements Listener {
    private YamlConfiguration messages;
    private TopicRegistry topicRegistry;
    private CoreEconomyHook coreEconomy;
    private SqliteStatsStore statsStore;
    private BoardManager boardManager;
    private LeaderboardService leaderboardService;
    private PlayerDisplayManager playerDisplayManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        loadMessages();

        coreEconomy = new CoreEconomyHook(this);
        coreEconomy.initialize();
        topicRegistry = new TopicRegistry();
        statsStore = new SqliteStatsStore(this);
        boardManager = new BoardManager(this);
        leaderboardService = new LeaderboardService(this, boardManager, topicRegistry, coreEconomy,
                statsStore, new BoardRenderer(this));

        Bukkit.getPluginManager().registerEvents(this, this);
        Bukkit.getPluginManager().registerEvents(new StatsListener(statsStore.cache()), this);
        boardManager.load();
        leaderboardService.start();
        playerDisplayManager = new PlayerDisplayManager(this, coreEconomy);
        playerDisplayManager.start();

        LeaderboardCommand command = new LeaderboardCommand(this);
        getCommand("leaderboard").setExecutor(command);
        getCommand("leaderboard").setTabCompleter(command);

        long saveTicks = Math.max(1, getConfig().getLong("settings.save-seconds", 30)) * 20L;
        Bukkit.getScheduler().runTaskTimerAsynchronously(this, statsStore::saveNow, saveTicks, saveTicks);
    }

    @Override
    public void onDisable() {
        if (playerDisplayManager != null) {
            playerDisplayManager.shutdown();
        }
        if (boardManager != null) {
            boardManager.removeAllPersonalDisplays();
            boardManager.save();
        }
        if (statsStore != null) {
            statsStore.shutdown();
        }
    }

    public void reloadFiles() {
        reloadConfig();
        loadMessages();
        if (playerDisplayManager != null) {
            playerDisplayManager.refreshDisplays();
        }
    }

    public YamlConfiguration getMessages() {
        return messages;
    }

    public TopicRegistry getTopicRegistry() {
        return topicRegistry;
    }

    public CoreEconomyHook getCoreEconomy() {
        return coreEconomy;
    }

    public BoardManager getBoardManager() {
        return boardManager;
    }

    public LeaderboardService getLeaderboardService() {
        return leaderboardService;
    }

    @EventHandler
    public void onChunkLoad(ChunkLoadEvent event) {
        if (boardManager != null) {
            Chunk chunk = event.getChunk();
            boardManager.onChunkLoad(chunk);
        }
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        if (boardManager != null) {
            boardManager.hideDisplaysFrom(event.getPlayer());
        }
    }

    private void loadMessages() {
        File file = new File(getDataFolder(), "messages.yml");
        messages = YamlConfiguration.loadConfiguration(file);
    }
}