Skip to content

dwgx/darkpixel

Repository files navigation

DarkPixel

Paper 1.21.4 all-in-one server plugin — lobby, rank, GUI, NPC, AI chat, anti-cheat, moderation.

Paper 1.21.4 综合服务端插件 — 大厅、段位、GUI、NPC、AI 聊天、反作弊、管理。


Overview / 概述

DarkPixel is a server-side plugin for Minecraft Paper 1.21.4 that bundles lobby management, player ranks, dashboard GUIs, NPCs, an AI chat assistant, a lightweight anti-cheat (DarkAC), and moderation tools into a single Gradle-built jar. One plugin instead of ten.

DarkPixel 是一个 Paper 1.21.4 服务端插件,把大厅管理、玩家段位、仪表盘 GUI、NPC、AI 聊天助手、轻量反作弊(DarkAC)和管理工具全塞进一个 Gradle 构建的 jar 里。一个插件干十个的活。


Features / 功能

  • Ranks — set/get/list player ranks and scores (/rank), chat formatting, and a built-in RankServer HTTP service for cross-instance rank sync (falls back to client mode when the port is taken).
  • AI Chat Assistant/aichat public/private conversations, per-model selection, whitelist and message-limit controls, chat history management, optional periodic AI welcome messages. Backed by DeepSeek models via external API.
  • Server Dashboard GUI/dashboard chest-menu panel, supply station (/geiwoqian), sign-in UI (/signin), server-switch chest (/getswitchchest), radio/music chest (/getradio).
  • Lobby NPCs — manage lobby NPCs (/npc), switch-chest and radio-chest zombies, hub return (/hub).
  • Anti-Cheat (DarkAC)/darkac management with head-rotation and aim detectors, alerts, review, player reporting (/report).
  • Moderation — ban/unban with duration and reason (/darkban), player freeze with PvP/invincible/auto-unfreeze modes (/freeze), chat-times limits (/setchattimes).
  • Combat Tweaks — bring-back-blocking sword mechanic (/giveblockablesword) with configurable damage reduction.
  • Player Utilities — sit on blocks/players (/sit, /togglesit), ping check (/ping), join effects (/toggleeffects), MOTD/login-message helpers.
  • Config Hot-Reload/reloadconfig reloads all configs asynchronously.

  • 段位系统 — 设置/查询/列出玩家段位和积分(/rank),聊天格式化,内置 RankServer HTTP 服务跨实例同步段位(端口被占时自动降级为客户端模式)。
  • AI 聊天助手/aichat 公开/私密对话、模型切换、白名单和消息限制、聊天历史管理、可选 AI 定时欢迎消息。对接 DeepSeek 模型。
  • 服务器仪表盘 GUI/dashboard 箱子菜单面板、补给站(/geiwoqian)、签到界面(/signin)、跨服切换箱(/getswitchchest)、电台/音乐箱(/getradio)。
  • 大厅 NPC — 管理大厅 NPC(/npc),切换箱和电台僵尸 NPC,大厅返回(/hub)。
  • 反作弊(DarkAC)/darkac 管理,头部旋转和瞄准检测器,警报、审查、玩家举报(/report)。
  • 管理工具 — 封禁/解封含时长和原因(/darkban),冻结玩家含 PvP/无敌/自动解冻模式(/freeze),聊天次数限制(/setchattimes)。
  • 战斗调整 — 恢复格挡剑机制(/giveblockablesword),可配置伤害减免。
  • 玩家工具 — 坐在方块/玩家上(/sit/togglesit),延迟查看(/ping),加入特效(/toggleeffects),MOTD/登录消息。
  • 配置热重载/reloadconfig 异步重载全部配置。

Tech Stack / 技术栈

Language Java 21
Platform Paper API 1.21.4-R0.1-SNAPSHOT
Build Gradle 8.8 (wrapper)
Dependencies (required plugins) ProtocolLib, NBTAPI, PacketEvents
Libraries (shaded) Gson 2.10.1, NanoHTTPD 2.3.1
Libraries (compile-only) ProtocolLib 5.3.0, item-nbt-api 2.14.1, packetevents-spigot 2.7.1
CI GitHub Actions, Ubuntu + Temurin JDK 21

Project Structure / 项目结构

darkpixel/
├── build.gradle
├── settings.gradle
├── gradle/ gradlew gradlew.bat
├── .github/workflows/ci.yml
└── src/main/
    ├── java/com/darkpixel/
    │   ├── Main.java            # Plugin entry point
    │   ├── Global.java          # Wires up all subsystems
    │   ├── ai/                  # AI chat handler, API client, history
    │   ├── anticheat/           # DarkAC detectors, report command
    │   ├── combat/              # Blocking sword mechanic
    │   ├── gui/                 # Dashboard, chests, sign-in, supply station
    │   ├── manager/             # Ban, Command, Config managers
    │   ├── npc/                 # Lobby NPC handler + entities
    │   ├── rank/                # Rank data, manager, HTTP RankServer
    │   └── utils/               # PlayerData, freeze, sit, MOTD, ping, etc.
    └── resources/
        ├── plugin.yml
        ├── config.yml
        ├── darkac.yml
        ├── minigame.yml
        ├── commands.yml
        └── index.html script.js styles.css  # Rank server web UI

Getting Started / 快速开始

Prerequisites / 前置条件

  • JDK 21
  • Paper 1.21.4 server
  • ProtocolLib, NBTAPI, PacketEvents installed on the server (plugin won't load without them)

Build / 编译

# Linux / macOS
./gradlew build

# Windows
.\gradlew.bat build

Output jar: build/libs/

Install / 安装

  1. Copy the jar to your server's plugins/ directory.
  2. Make sure ProtocolLib, NBTAPI, PacketEvents are also in plugins/.
  3. Restart the server. DarkPixel generates config files on first run.

把 jar 和前置插件一起丢进服务器 plugins/ 目录,重启即可。首次启动自动生成配置文件。


Configuration / 配置

Config files generated under plugins/DarkPixel/:

  • config.yml — main config:
    • mysql — database connection (host, port, database, username, password). Leave password empty to use env var DARKPIXEL_DB_PASSWORD.
    • http_port / rank_server_url — rank HTTP server (default 25560 / http://localhost:25560).
    • AI section — api_key, ai_name, available_models, ai_whitelist, player_message_limits, prompt templates, welcome interval, history max size.
    • blocking — enable/disable and tune blocking sword.
    • npc_enabled / npc_locations — lobby NPC spawn points.
    • dashboard_enabled, freeze, sitting — feature toggles.
  • darkac.yml — anti-cheat detector thresholds (head-rotation max_angle, min_time_ms, etc.).
  • minigame.yml — minigame teleport points.
  • commands.yml — command templates.

Environment Variables / 环境变量

Variable Purpose
DARKPIXEL_DB_PASSWORD MySQL password (used when mysql.password is left empty in config)

Commands / 命令

Command Description / 说明 Permission
/aichat AI chat (public/private, model, whitelist, limits, history)
/dashboard Server dashboard panel / 服务器仪表盘
/hub Return to lobby / 返回大厅
/geiwoqian Supply station / 补给站
/npc Manage lobby NPCs / 管理大厅 NPC darkpixel.npc.manage
/rank Set/get/list ranks / 段位管理
/signin Sign-in UI / 签到
/freeze Freeze/unfreeze player / 冻结玩家 darkpixel.admin
/darkban Ban/unban player / 封禁管理 darkpixel.admin
/setchattimes Set chat message count / 设置聊天次数 darkpixel.admin
/darkac Manage DarkAC / 反作弊管理 darkpixel.admin
/report Report a player / 举报玩家
/sit, /togglesit Sitting / 坐下 darkpixel.admin (togglesit)
/ping Check ping / 查看延迟
/giveblockablesword Give blockable sword / 给格挡剑 darkpixel.giveblockablesword
/getswitchchest, /getradio Switch/radio chests / 切换箱/电台箱 darkpixel.switchchest, darkpixel.radio
/toggleaiwelcome, /toggleeffects Toggle AI welcome / join effects darkpixel.admin (aiwelcome)
/reloadconfig Reload all configs / 重载配置 darkpixel.admin

Full usage strings and permission defaults in plugin.yml.


Status / 状态

Personal project, version 1.0-SNAPSHOT. All listed features are implemented and functional. Under active development.

个人项目,版本 1.0-SNAPSHOT。上面列的功能都已实现可用,持续开发中。


License / 许可证

MIT License. Copyright (c) 2025 DWGX1337. See LICENSE.

About

Paper 1.21.4 server utility plugin with lobby, rank, GUI, NPC, and moderation helpers

Topics

Resources

License

Security policy

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors