跳到正文

Project MMO: Pufferfish Skills Compat

作者:Silvertide

在 Project MMO 和 Pufferfish Skills 之间添加可自定义的兼容桥接。在不同 Project MMO 技能中升级将为你配置的技能树提供 Pufferfish 技能点。

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

PMMO Pufferfish Compat turns Project MMO skill levels into spendable points in Pufferfish Skills trees. Mine some stone → level up Mining in PMMO → unlock nodes in whatever Mining tree your modpack ships. It’s the cable between PMMO’s progression loop and Pufferfish’s skill-tree UI — a pure bridge, configured entirely through datapack JSON.

Features

Datapack-configurable skill mapping

Author one JSON file per PMMO skill in data/<your_pack>/pmmo_pufferfish_compat/skill_map/:

{
  "pmmo_skill": "mining",
  "awards": [
    {
      "skill_category": "your_pack:mining_tree",
      "skill_points": 1,
      "every_x_pmmo_levels": 1,
      "starting_pmmo_level": 1,
      "max_skill_points": 50,
      "reconcile": "additive"
    }
  ]
}

Each award targets one Pufferfish category. A single PMMO skill can feed many categories — point the awards array at as many trees as you want, each with its own rate, threshold, and cap. Multiple files for the same PMMO skill merge cleanly.

Tunable progression per award

Field Default Meaning
skill_points 1 Points awarded per milestone
every_x_pmmo_levels 1 PMMO levels between milestones
starting_pmmo_level 1 Don’t grant anything below this level
max_skill_points unbounded Stop awarding after this total
reconcile additive What to do when expected and granted drift

Worked example: every_x_pmmo_levels: 3, starting_pmmo_level: 5, skill_points: 2 means "starting at PMMO level 5, grant 2 points; another 2 at level 8, 11, 14, and so on."

Four reconcile modes

The genuinely interesting design choice. Configs drift over time — you tweak a rate, a player’s points have been spent, PMMO loses levels on death. Each award picks how the bridge handles it:

  • additive (default) — top up missing points, never claw back. Safest. Players keep what they have when you lower a rate.
  • trim_unspent — top up, and claw back unspent points if the new expected is lower. Won’t refund nodes already bought.
  • strict — enforce exact alignment. If expected drops below granted, the player gets a clean respec: every node in that category refunds, and the total drops to the new expected.
  • none — only react to live level-ups, never audit. Useful when other sources feed the same category and you want this bridge to stay out of the way.

Sync at the right moments

The bridge applies the formula at three well-defined moments — never as a constant background process:

  • On level change — when a player’s PMMO skill levels up (or down), the delta is granted live. Hot path: zero Pufferfish reads, just a write.
  • On player join — one tick after login, every mapping is audited against the player’s current PMMO levels. Catches drift from new mappings added while they were offline.
  • On /reload — every online player is re-audited. Edit a mapping, /reload, the change applies to everyone instantly.

For when those aren’t enough, /pmmopufferfish resync is the admin escape hatch.

Per-source attribution

Pufferfish tracks point grants per source. This bridge uses stable per-skill source IDs (pmmo_pufferfish_compat:pmmo/<skill>), which means:

  • This mod, FTB Quests, an admin’s /puffish_skills command, and a future skill_tree-style content pack can all feed the same category without stepping on each other.
  • Changing a mapping’s rate doesn’t orphan old grants — the source ID is stable, only the expected total moves.
  • Strict-mode respec refunds the nodes the player chose, not their entire point balance.

Performance-aware

The XpEvent listener is the hot path on any active server. It’s been built around that:

  • Source-id strings interned at config load, never rebuilt per event.
  • No Stream chains, no lambda allocation, no boxing on the event path.
  • No Pufferfish read-back for live grants — only the audit moments (login / /reload) do that work.
  • Mappings indexed in primitive-style arrays keyed by PMMO skill name.

Setup

You need two pieces in your datapack:

  1. A Pufferfish category (either authored yourself or shipped by another mod):
    data/<pack>/puffish_skills/config.json          # lists category names
    data/<pack>/puffish_skills/categories/<name>/   # category.json, skills.json, etc.
    
  2. A bridge mapping per PMMO skill you want to wire:
    data/<pack>/pmmo_pufferfish_compat/skill_map/<file>.json
    

Drop a /reload and you’re live.

Commands

/pmmopufferfish resync              — resync the executing player (op-only)
/pmmopufferfish resync <player>     — resync one player
/pmmopufferfish resync @a           — resync everyone online

All variants require permission level 2 (op / cheats enabled).


Why this mod?

PMMO already has a polished skill-up loop — break blocks, kill mobs, brew potions, all of it. Pufferfish Skills already has a polished tree UI with rewards, prerequisites, and per-category point pools. Both are mature mods that hit their slot well.

What was missing was the cable between them. An opinion-free, performance-aware, datapack-configurable cable that lets a modpack author say "1 point in Mining for every level in PMMO Mining, capped at 50, additive reconcile" in one JSON file and have it work — including drift correction, multi-source coexistence, and live config edits.

This mod is that cable.

It was inspired by daedalus_dev’s skill_tree, which uses Pufferfish Skills the same way but with its own custom progression system. PMMO can fit that slot just as well with a small adapter, and I wanted that adapter.

Compatibility

  • Pufferfish Skills 0.17.3+ (required)
  • Project MMO 2.7.35+ (required)
  • Coexists with skill_tree, FTB Quests, admin point grants, and any other source feeding the same Pufferfish categories.
  • NeoForge 1.21.1.

常见问题

Project MMO: Pufferfish Skills Compat 支持哪些 Minecraft 版本?

Project MMO: Pufferfish Skills Compat 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

Project MMO: Pufferfish Skills Compat 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Silvertide 的其他作品

查看全部 →