Skip to content

Add a DEATH_CHEST_ACCESS island protection flag #3

Description

@tastybento

What

Register a DEATH_CHEST_ACCESS island protection flag so island owners can decide, by rank, who may open death chests on their island.

Why

Access is currently a single global boolean, chest.team-access in config.yml, applied server-wide by ChestListener.canAccess(). A server owner can allow all island members or nobody but the owner, and nothing in between, and an individual island cannot deviate from that.

A protection flag is the BentoBox-native answer: it gives per-island, per-rank control through the island settings panel that players already know.

Notes

  • Flag.Builder("DEATH_CHEST_ACCESS", Material.CHEST).type(Flag.Type.PROTECTION).defaultRank(RanksManager.MEMBER_RANK), registered in DeathChest.onEnable() via registerFlag(). Gusher registers two flags this way if an example is wanted.
  • canAccess() becomes: owner always yes; otherwise island.isAllowed(user, DEATH_CHEST_ACCESS).
  • Needs a locale entry under protection.flags.DEATH_CHEST_ACCESS for the name, description and hint.
  • Migration: chest.team-access should either become the flag's default rank (MEMBER_RANK when true, OWNER_RANK when false) or be deprecated with a note in config.yml. Worth deciding before 1.0 so there is no config break later.
  • Also decide whether the flag governs breaking the chest as well as opening it. onBreak() currently shares canAccess().

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions