Skip to content

Conversation

@lightsing
Copy link
Contributor

Summary

This PR adds two player attributes—Total Psi and Psi Regeneration—so other mods can interact with Psi’s resource economy via standard Minecraft/NeoForge attribute mechanics (modifiers from equipment, effects, professions, etc.). With Psi alone installed, behavior is unchanged. Defaults: psi:total_psi = 5000, psi:regen = 25.

Motivation

Previously, the total pool and regeneration rate were hardcoded in PlayerDataHandler, which made inter-mod extensions require mixins or other invasive hooks. Exposing them as attributes lets integrators use the usual attribute modifier pipeline (effects, gear, professions, advancements, data-driven systems).

Non-goals

  • No changes to spell logic, CAD behavior, or energy math beyond sourcing totals/regen from attributes.
  • No new config or UI.

Backward compatibility

  • No gameplay change by default: defaults match previous constants (Total Psi = 5000, Regen = 25).
  • Save-compatible: attributes apply default values automatically; no data migration required.

Testing

  • Client and server with only Psi: pool and regeneration unchanged.
  • With attribute modifiers applied: capacity/regen update as expected.

Changelog (for modders)

Added player attributes psi:total_psi and psi:regen. PlayerDataHandler now reads these to determine Psi capacity and regeneration. Defaults preserve prior behavior. Integrate via standard attribute modifiers.

Copy link
Contributor

@Kamefrede Kamefrede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@Kamefrede Kamefrede merged commit 0e5f0e3 into VazkiiMods:master Dec 7, 2025
1 check passed
@lightsing lightsing deleted the feat/psi-attributes branch December 8, 2025 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants