Skip to content

[Feat] SimpleClaims cross-claim protection integration #48

@derrickmehaffy

Description

@derrickmehaffy

Scope

  1. Prevent HyperFactions from claiming chunks already claimed in SimpleClaims
  2. Prevent SimpleClaims from claiming chunks already claimed in HyperFactions (requires SimpleClaims-side integration)
  3. Integration should be a soft dependency (reflection-based, works with or without SimpleClaims installed)
  4. Should respect SimpleClaims reserved chunks (perimeter buffer) in addition to direct claims
  5. Should provide clear feedback to players when a claim is blocked due to the other mod
  6. Optionally configurable (enable/disable in config)

Implementation Details

HyperFactions side (we implement)

  • New SimpleClaimsIntegration class in com.hyperfactions.integration.protection (same pattern as OrbisGuardIntegration)
  • Reflection-based access to ClaimManager.getInstance() singleton
  • Check methods: getChunk(dimension, chunkX, chunkZ) and getReservedChunk(dimension, chunkX, chunkZ)
  • Hook into ClaimManager.claimChunk() to check SimpleClaims before allowing HF claims
  • Config: "simpleclaims": { "enabled": true, "respectReservedChunks": true } in config.json
  • Permission: none needed (server-level config toggle)

SimpleClaims side (PR or suggestion to Buuz135)

  • SimpleClaims should check HyperFactionsAPI.isClaimed(world, chunkX, chunkZ) before allowing claims
  • Our API is now on JitPack: compileOnly 'com.github.HyperSystemsDev:HyperFactions:v0.8.1'
  • SimpleClaims already uses reflection for other integrations (LuckPerms, PartyPro) — same pattern applies
  • Alternative: SimpleClaims could add a generic ClaimChecker interface that external mods register — more extensible

Risks and Alternatives

  1. No stable API — SimpleClaims has no dedicated API package — all classes are internal and mutable. API surface could change between versions without notice.
  2. Reverse integration — The SimpleClaims → HyperFactions direction requires SimpleClaims to adopt our API or accept a PR. Buuz135 may prefer a different integration approach.
  3. Performance — Chunk claim checks happen frequently. Reflection overhead should be minimal since we cache method handles, but worth benchmarking.
  4. Alternative — Instead of direct mod-to-mod integration, both mods could integrate through OrbisGuard as a shared protection layer. However, this adds a mandatory third dependency.

References and Media

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions