BrainrotGame — 插件完整概览
平台:Paper 1.21 · 版本:2.1 · 作者:SevenSas · 主类:ru.giga.brainrot.BrainrotGame
概念
一款运行在单个 Paper 服务器内的 Steal a Brainrot 迷你游戏的 Minecraft 实现。中央大厅设有传送门;每个传送门后方是一个独立的“服务器”世界,拥有专属竞技场、红色传送带、经济系统和玩家进度。玩家可以建造一个 25 格的基地,购买从传送带上走来的脑腐(brainrots),从它们身上赚取金币,偷取邻居的脑腐,刷取重生次数,旋转幸运轮盘,并在融合机中合成脑腐。内置 89 种模型,涵盖 8 种稀有度、15 种突变、33 种特质以及 17 种天气风格事件。
架构:世界与服务器
InstanceManager 维护着一个 GameInstances 列表,包含三种类型:
TIMED — 世界名为 brainrot, brainrot_2, … 直至 servers.timed-count。每隔 servers.wipe-hours 时间重置一次(或在指定的每日 wipe-time 重置)。支持 8 个基地。
ENDLESS — 世界名为 brainrot_endless_N,永不重置。当所有基地都被占用时,会自动生成新的世界。
PARTY — 世界名为 brainrot_party_N,供好友群组使用的封闭地图。基地数量等于派对人数,永不重置。
每个实例都拥有自己的世界(使用平坦的 VoidGenerator,所有内容均由插件构建),以及各自的 Arena、GameManager、EventManager、HudManager、ShopManager、RebirthManager、SpinWheel、FuseMachine、MusicManager 和 GameListener。进度在不同服务器之间不共享——每个服务器拥有独立的 DataStore.scope(id)。只有收藏索引和所选语言是全局共享的。
核心包
arena — Arena 负责生成世界、车道、广场、基座和基地房屋。基地仅有一个:共 3 层(10/8/7),每层分别有 25 个槽位,包含收集盘、锁定基地按钮、激光门和入口路径。BaseLook 负责处理墙壁/屋顶的样式。
data — PlayerData(25 个脑残槽位,含突变和特质、金币、统计数据、重生次数、旋转次数、融合输入、已购买的 gadget、语言、共享索引)。DataStore 是 YAML 后端,每个世界拥有 scope(id) 并支持 wipe()。
event — EventManager 运行计时器和 Boss 条,GameEvent 是基类,Events 捆绑了 17 种具体事件:taco_rain、snow_storm、rain、blood_moon、starfall、nyan_cats、solar_flare、fireworks、lightning、zombie、ufo、disco、glitch、bubblegum、rainbow_rain、molten、storm。一个事件会将材料/投射物洒向车道;命中后授予突变或特质(频率不低于 events.award-gap-seconds)。
game — GameManager(约 1300 行代码,核心):车道队列、定时生成、路径行走、交互(购买 / 重新购买 / 偷窃 / 出售)、每秒收入、盘子收集、基地锁定、重生。GameListener — 对脑残生物右键点击、击中载体、虚空传送、放置/破坏方块。HudManager — 侧边栏和标签列表,包含计时器、收入和排行榜。MusicManager — 音符盒背景音乐,可通过 /br music 单独静音。RebirthManager — 牧师 NPC 和重生 GUI 商店。
instance — GameInstance(服务器组合)、InstanceManager(世界加载、清除、派对开始、加入/前往大厅)、SpawnListener(首次出生直接前往大厅)。
lobby — LobbyBuilder 构建带有喷泉、路径和树木的岛屿。LobbyManager 运行通往各个服务器的传送门、跨越 4 个类别的排行榜、稀有度展示、指南牌、语言地球仪和环境效果。IndexHall — 一个陈列所有 89 个脑残生物的展厅(拥有的会旋转,锁定的为黑色剪影,OG 有自己的基座)。PartyRoom — 一个带有代码和倒计时的派对集合室。LanguageMenu — 旗帜 GUI(ru/en),在首次加入时猜测玩家的语言环境。StaticModel — 用于展示和索引的非动画 BlockDisplay 模型。
machine — FuseMachine:4 个槽位,融合时间 = fuse.seconds-per-rarity × (rarity+1),当 3–4 个输入匹配时有几率升级稀有度,孵化动画和 HUD 标志。SpinWheel:幸运轮盘,每 wheel.free-cooldown-minutes 分钟免费旋转一次,付费旋转价格为 max(spin-min-cost, income/s × spin-cost-income-seconds),奖励脑残生物 / 金币 / 随机突变。
model — Rarity(8 个层级:COMMON, RARE, EPIC, LEGENDARY, MYTHIC, DIVINE, SECRET, OG)。Mutation(15 种,倍率 1.25–13;每种都有自己独特的方块重绘调色板;RAINBOW 循环颜色,YINYANG 将模型分为两半)。Trait(33 种特质;公式 Trait.total(m, traits) = m.multiplier + Σ(t.multiplier − 1);SLEEPY 减半总数值)。BrainrotType — 名称、稀有度、价格、收入、模型。BrainrotRegistry 从
M1..M5
收集 89 种类型,并提供 random(luck) 加权,权重来自 lane.rarity-weights。defs/Kit — 可复用部件(腿、头、翅膀、皇冠、高顶礼帽)。rig 包是一个 DSL,用于使用 BlockDisplays 构建动画模型。
shop — ShopItem:gadgets BAT, SPEED (Speed Coil), JUMP (Gravity Coil), TRAP, WEB (Web Slinger), FREEZE (Freeze Ray), BUBBLE (Force Field), CLOAK (Invisibility Cloak), MAGNET (Coin Magnet), BEE (Bee Launcher — 反转受害者控制), BOOGIE (Boogie Bomb)。ShopManager — 村民商人、GUI、右键激活、蝙蝠击退、语言更改后重新定位。
pack — PackBuilder 组装 brainrot-pack.zip(gadget 纹理和事件图标);ResourcePackManager 在 resource-pack.host-port(默认 8765)上运行一个小型 HTTP 服务器,提供 zip 文件并监听 PlayerResourcePackStatusEvent。该包可通过 required: true 强制启用。
util — Lang/LangVis/LangText/LangBar 用于即时 ru/en 翻译,Text(Adventure 模式和 &#RRGGBB 颜色),Holo(浮动 TextDisplay),Icons(包符号地图),Kiosk,Props。
玩法
每隔 lane.spawn-interval-ticks(默认 40 = 2 秒),一个随机的脑残生物进入车道。稀有度权重来自 lane.rarity-weights。隧道标志板上显示 legendary-every-minutes 和 mythic-every-minutes 的保证机制。
生成时,突变可能会以 lane.gold-chance / lane.diamond-chance 的概率掷出。
在车道上右键点击脑残生物 — 购买。如果它正在走向别人的基地 — 以 +50% 溢价重新购买。在别人基地里右键点击别人的脑残生物 — 偷窃(将其带回家;击中载体会使其掉落)。Shift + 右键点击自己的 — 以 base.sell-percent %(50%)的价格出售。
收入每秒跳动一次:type.income() × Trait.total(mut, traits) × (1 + 0.5 × rebirths)。从基座前的盘子中收集。
基地锁定(Lock Base 牌子)关闭大门,持续时间为 base.lock-seconds + lock-per-rebirth-seconds × rebirths 秒。
重生 — 北广场的牧师 NPC。价格来自 rebirth.costs(500k … 125B),然后是 base-cost × cost-multiplier^n,上限由 rebirth.max(10)限制。每次重生重置金币,增加 +50% 收入、+10 秒锁定时间,并在 floor2-at / floor3-at 时建造第 2 层(18 个槽位)和第 3 层(25 个槽位)。
事件
EventManager 从 events.intervals-minutes 中选择一个随机间隔,并为 events.duration-seconds 运行一个事件。弱事件很常见,强事件很少见(Admin Abuse 永远不会自动开始)。每个事件都会将材料/投射物洒向车道;命中会在随机的脑残生物身上盖上突变或特质印记。下一个事件的计时器和当前事件会显示在 HUD 和隧道标志板上。
命令 (/br, 别名 /brainrot, /sab)
玩家:
/br (或 play) — 前往你的基地,否则前往大厅。
/br lobby (别名 hub, leave);也有独立的 /lobby (/hub, /l)。
/br servers — 服务器列表。
/br join <1|2|endless> — 加入特定服务器。
/lang [ru|en] (/language, /yazik) 或 /br lang — 语言菜单 / 切换。
/br balance (bal) — 当前服务器或所有服务器上的余额。
/br music — 切换背景音乐。
/br pack (rp) — 重新发送资源包。
/br help — 帮助。
管理员 (brainrot.admin, 默认 op):
/br setup [all|lobby|<id>] — 构建/重建大厅和/或竞技场。
/br event <id|admin|stop> [seconds] — 开始事件 / 管理员滥用(同时全部触发)/ 停止。
/br spawn <id> [mutation] [trait,trait] — 将脑腐生物投放到赛道上。
/br coins <name> <amount> — 给予/扣除金币。
/br list — 按稀有度分组的脑腐生物列表。
/br clearlane — 清空赛道。
/br reset <name> — 重置玩家(仅限离线状态;保留索引)。
/br give <item> — 给自己一个 gadget。
/br shop — 打开商店。
/br gift <name> <id> [mutation] [traits] — 直接将脑腐生物赠送给某个基地。
/br spins <name> <n> — 给予转盘抽奖次数。
/br rebirth <name> <n> — 设置转生等级(会重建楼层)。
/br wipe <1|2> — 立即清除定时服务器。
Configuration (config.yml)
部分:start-coins、auto-setup、language.ask-every-join、lane(生成刻数、速度、间隙、运气、变异几率、保底机制、稀有度权重)、base(锁定、出售百分比)、rebirth(成本、倍数、楼层)、music、wheel、fuse.seconds-per-rarity、events(间隔、持续时间、奖励间隙)、resource-pack(内置 HTTP 托管)、servers(限时计数、清除小时/清除时间、无尽模式)、party.wait-seconds、hud.title/footer。
Resources
plugin.yml — 注册命令和 brainrot.admin 权限。
brainrot-pack.zip
— 预构建的资源包(包含 gadget 纹理、事件图标);插件可通过 resource-pack.host-port 自行通过 HTTP 托管该资源包。
en.txt
— 用于即时 UI/消息翻译的英文词典(Lang/LangVis)。
pack-icons.txt — 资源包符号映射表。
Implementation notes
所有插件实体均标记了 NamespacedKey,从而避免了与其他插件在 mob 方面的冲突。
世界使用平坦的 VoidGenerator;插件负责构建所有内容,因此竞技场是确定性的。
脑腐生物模型是由带有 Transformation 的 BlockDisplay 集合组成,并通过 Bone/Motion/Rig 进行动画处理。所有 89 个模型都在 onEnable 时预先完成绑定,以确保首次生成时不会造成卡顿。
PlayerData.reset(清除)操作会保留索引和语言设置不变。
旧版 v1 脑腐生物 ID 会自动重映射(BrainrotRegistry.alias)。
首位玩家的出生点会通过反射订阅 AsyncPlayerSpawnLocationEvent/PlayerSpawnLocationEvent 事件重定向到大厅。
排行榜(收藏、收入、金币、游戏时长)在所有范围内聚合数据,并在大厅中显示。
BrainrotGame — full plugin overview
Platform: Paper 1.21 · Version: 2.1 · Author: SevenSas · Main class: ru.giga.brainrot.BrainrotGame
Concept
A Minecraft implementation of the Steal a Brainrot mini-game hosted inside a single Paper server. A central lobby holds portals; behind each portal is a separate world-"server" with its own arena, red conveyor lane, economy and player progress. Players build a 25-slot base, buy the brainrots walking down the lane, farm coins from them, steal them from neighbors, grind rebirths, spin the luck wheel and fuse brainrots at the fuse machine. Ships with 89 models across 8 rarities, 15 mutations, 33 traits and 17 weather-style events.
Architecture: worlds and servers
InstanceManager keeps a list of GameInstances of three kinds:
TIMED — worlds brainrot, brainrot_2, … up to servers.timed-count. Wiped every servers.wipe-hours (or at wipe-time if daily). 8 bases.
ENDLESS — brainrot_endless_N, no wipe. When every base is taken, a new world spins up automatically.
PARTY — brainrot_party_N, a closed map for a group of friends. Base count = party size, no wipe.
Each instance owns its world (flat VoidGenerator, everything is built by the plugin), its own Arena, GameManager, EventManager, HudManager, ShopManager, RebirthManager, SpinWheel, FuseMachine, MusicManager, GameListener. Progress is not shared between servers — each has its own DataStore.scope(id). Only the collection index and the chosen language are global.
Key packages
arena — Arena generates the world, the lane, plazas, pedestals and base houses. Base is one base: 25 slots on 3 floors (10/8/7), collection plate, Lock Base button, laser gate, entry path. BaseLook handles walls/roof styling.
data — PlayerData (25 brainrot slots with mutation and traits, coins, stats, rebirths, spins, fuse input, purchased gadgets, language, shared index). DataStore is a YAML backend with scope(id) per world and wipe().
event — EventManager runs timers and boss bars, GameEvent is the base class, Events bundles 17 concrete ones: taco_rain, snow_storm, rain, blood_moon, starfall, nyan_cats, solar_flare, fireworks, lightning, zombie, ufo, disco, glitch, bubblegum, rainbow_rain, molten, storm. An event rains materials/projectiles onto the lane; on hit it grants a mutation or trait (no more often than events.award-gap-seconds).
game — GameManager (~1300 lines, the core): lane queue, timed spawning, path walking, interactions (buy / rebuy / steal / sell), per-second income, plate collection, base lock, rebirth. GameListener — right-click on a brainrot, hits on a carrier, void teleport, block-place/break block. HudManager — sidebar and tab list with timers, income and top lists. MusicManager — note-block background music with personal mute via /br music. RebirthManager — priest NPC and rebirth GUI shop.
instance — GameInstance (server composition), InstanceManager (world loading, wipes, party starts, join/toLobby), SpawnListener (first spawn goes straight to the lobby).
lobby — LobbyBuilder builds the island with a fountain, paths and trees. LobbyManager runs portals to every server, top boards across 4 categories, rarity showcases, a guide sign, a language globe and ambient effects. IndexHall — a hall with all 89 brainrots (owned ones spin, locked ones are black silhouettes, OG has its own pedestal). PartyRoom — a party assembly room with codes and a countdown. LanguageMenu — a flag GUI (ru/en) that guesses the player's locale on first join. StaticModel — non-animated BlockDisplay model for showcases and index.
machine — FuseMachine: 4 slots, fuse time fuse.seconds-per-rarity × (rarity+1), chance to upgrade rarity when 3–4 inputs match, hatch animation and HUD signs. SpinWheel: luck wheel, one free spin every wheel.free-cooldown-minutes, paid spin priced at max(spin-min-cost, income/s × spin-cost-income-seconds), rewards a brainrot / coins / a random mutation.
model — Rarity (8 tiers: COMMON, RARE, EPIC, LEGENDARY, MYTHIC, DIVINE, SECRET, OG). Mutation (15 with multipliers 1.25–13; each has its own block-recolor palette; RAINBOW cycles colors, YINYANG splits the model in halves). Trait (33 traits; formula Trait.total(m, traits) = m.multiplier + Σ(t.multiplier − 1); SLEEPY halves the total). BrainrotType — name, rarity, price, income, model. BrainrotRegistry collects 89 types from
M1..M5
and provides random(luck) weighted by lane.rarity-weights. defs/Kit — reusable parts (legs, heads, wings, crown, top hat). The rig package is a DSL for building animated models out of BlockDisplays.
shop — ShopItem: gadgets BAT, SPEED (Speed Coil), JUMP (Gravity Coil), TRAP, WEB (Web Slinger), FREEZE (Freeze Ray), BUBBLE (Force Field), CLOAK (Invisibility Cloak), MAGNET (Coin Magnet), BEE (Bee Launcher — inverts the victim's controls), BOOGIE (Boogie Bomb). ShopManager — Villager merchant, GUI, right-click activation, bat knockback, relocalize on language change.
pack — PackBuilder assembles brainrot-pack.zip (gadget textures and event icons); ResourcePackManager runs a tiny HTTP server on resource-pack.host-port (default 8765), serves the zip and listens to PlayerResourcePackStatusEvent. The pack can be enforced via required: true.
util — Lang/LangVis/LangText/LangBar for on-the-fly ru/en translation, Text (Adventure and &#RRGGBB colors), Holo (floating TextDisplay), Icons (pack symbol map), Kiosk, Props.
Gameplay
Every lane.spawn-interval-ticks (default 40 = 2 s) a random brainrot enters the lane. Rarity weights come from lane.rarity-weights. Guarantees legendary-every-minutes and mythic-every-minutes are shown on the tunnel signboard.
On spawn a mutation may roll with lane.gold-chance / lane.diamond-chance.
Right-click a brainrot on the lane — buy. If it is already walking to someone else's base — rebuy with a +50 % premium. Right-click someone else's brainrot on their base — steal (carry it home; a hit on the carrier drops it). Shift + right-click your own — sell for base.sell-percent % (50 %).
Income ticks once per second: type.income() × Trait.total(mut, traits) × (1 + 0.5 × rebirths). Collected from the plate in front of the pedestal.
Base lock (Lock Base plate) closes the gate for base.lock-seconds + lock-per-rebirth-seconds × rebirths seconds.
Rebirth — priest NPC on the north plaza. Prices from rebirth.costs (500k … 125B), then base-cost × cost-multiplier^n, capped by rebirth.max (10). Each rebirth resets coins, adds +50 % income, +10 s lock time, and at floor2-at / floor3-at the 2nd (18 slots) and 3rd (25 slots) floors are built out.
Events
EventManager picks a random interval from events.intervals-minutes and runs an event for events.duration-seconds. Weak events are common, strong ones are rare (Admin Abuse never auto-starts). Each event rains materials/projectiles onto the lane; hits stamp a mutation or trait onto a random brainrot. The next event timer and the current event show up in the HUD and on the tunnel signboard.
Commands (/br, aliases /brainrot, /sab)
Player:
/br (or play) — to your base, otherwise to the lobby.
/br lobby (aliases hub, leave); also a standalone /lobby (/hub, /l).
/br servers — server list.
/br join <1|2|endless> — join a specific server.
/lang [ru|en] (/language, /yazik) or /br lang — language menu / switch.
/br balance (bal) — balance on the current server or across all of them.
/br music — toggle background music.
/br pack (rp) — re-send the resource pack.
/br help — help.
Admin (brainrot.admin, default op):
/br setup [all|lobby|<id>] — build/rebuild the lobby and/or arenas.
/br event <id|admin|stop> [seconds] — start an event / Admin Abuse (all at once) / stop.
/br spawn <id> [mutation] [trait,trait] — release a brainrot onto the lane.
/br coins <name> <amount> — grant/subtract coins.
/br list — all brainrots grouped by rarity.
/br clearlane — clear the lane.
/br reset <name> — reset a player (offline only; index is kept).
/br give <item> — give yourself a gadget.
/br shop — open the shop.
/br gift <name> <id> [mutation] [traits] — gift a brainrot straight to a base.
/br spins <name> <n> — grant wheel spins.
/br rebirth <name> <n> — set rebirth level (rebuilds floors).
/br wipe <1|2> — wipe a timed server immediately.
Configuration (config.yml)
Sections: start-coins, auto-setup, language.ask-every-join, lane (spawn ticks, speed, gap, luck, mutation chances, guarantees, rarity weights), base (lock, sell %), rebirth (costs, multiplier, floors), music, wheel, fuse.seconds-per-rarity, events (intervals, duration, award gap), resource-pack (built-in HTTP hosting), servers (timed-count, wipe-hours/wipe-time, endless), party.wait-seconds, hud.title/footer.
Resources
plugin.yml — registers commands and the brainrot.admin permission.
brainrot-pack.zip
— prebuilt resource pack (gadget textures, event icons); the plugin can host it itself over HTTP on resource-pack.host-port.
en.txt
— English dictionary for on-the-fly UI/message translation (Lang/LangVis).
pack-icons.txt — pack symbol map.
Implementation notes
All plugin entities are tagged with a NamespacedKey, so conflicts with other plugins over mobs are ruled out.
Worlds use a flat VoidGenerator; the plugin builds everything, so arenas are deterministic.
Brainrot models are BlockDisplay sets with Transformation, animated through Bone/Motion/Rig. All 89 models are pre-rigged on onEnable so the first spawn does not lag.
PlayerData.reset (wipe) leaves index and lang untouched.
Legacy v1 brainrot ids are remapped automatically (BrainrotRegistry.alias).
The first player spawn is redirected to the lobby through a reflective subscription to AsyncPlayerSpawnLocationEvent/PlayerSpawnLocationEvent.
Top lists (collection, income, coins, playtime) aggregate across every scope and are shown in the lobby.
评论 0
登录后参与评分
还没有评论,来抢沙发吧