Skip to content

[WorldGuard] いくつかのフラグを追加する #46

@ryuuta0217

Description

@ryuuta0217
  • use-block-disassembler

  • use-block-placer

  • use-crusher

    • これら(Disassembler/Placer/Crusher)はNBTタグ Placer を持つので、TYPE-A。
  • use-monster-ball

    • ThrowEventで判定して防ぐ。TYPE-A。

TYPE-A

Player executor; // Player or UUID

boolean allowed = false;
if (isProtectedArea(loc)) {
    List<ProtectedCuboidRegion> regions = getProtectedRegions(loc);
    ProtectedCuboidRegion region = regions.stream().max(Comparator.comparingInt(ProtectedCuboidRegion::getPriority)).orElse(null);
    if (region != null) {
        FlagState state = region.getFlagState(CustomFlags.CUSTOM_FLAG);
        if (state == FlagState.UNSET) { // -
            allowed = region.isOwner(executor.getUniqueId()) || region.isMember(executor.getUniqueId());
        } else if (state == FlagState.ALLOW) { // allow
            allowed = true;
        } else { // deny
            allowed = region.isOwner(executor.getUniqueId());
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    サードパーティーサードパーティープラグインに関連。機能提案実装予定の機能生活鯖生活鯖に関連。

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions