dev.polymodloader.api.permission
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
PermissionNode | 레코드 | A named permission, <mod id>.<path>. |
PermissionProvider | 함수형 인터페이스 | Decides permissions, for example from a permissions file or groups. |
PermissionRegistrar | 인터페이스 | Declares a mod's permissions and lets permission mods decide them. |
PermissionResult | 열거형 | What a PermissionProvider decided. |
PermissionNode
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record PermissionNode(String id, int defaultLevel)
A named permission, <mod id>.<path>. Permission providers (a permissions mod) decide it per player; without a decision, players need the default operator level.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
id | String | dotted name, for example my_mod.teleport.others |
defaultLevel | int | operator level needed when no provider decides: 0 everyone, 2 game masters, 4 server owners |
PermissionProvider
함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface PermissionProvider
Decides permissions, for example from a permissions file or groups. Providers are asked in registration order; the first answer other than PermissionResult.UNDECIDED counts. Called on the server thread, often (command suggestions); keep it fast.
check(PlayerView, PermissionNode)
PermissionResult check(PlayerView player, PermissionNode node)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Whether player has node, or PermissionResult.UNDECIDED to let the next provider or the node's default decide.
| 인자 | 타입 | 설명 |
|---|---|---|
player | PlayerView | — |
node | PermissionNode | — |
반환 PermissionResult
PermissionRegistrar
인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface PermissionRegistrar
Declares a mod's permissions and lets permission mods decide them.
node(String, int)
PermissionNode node(String path, int defaultLevel)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Declares <mod id>.<path>.
| 인자 | 타입 | 설명 |
|---|---|---|
path | String | dotted, a-z 0-9 _ . |
defaultLevel | int | — |
반환 PermissionNode
예외 IllegalArgumentException — for an invalid or used path (POLY-PERMISSION-001)
provider(PermissionProvider)
void provider(PermissionProvider provider)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Adds a provider asked for every permission check of every mod.
| 인자 | 타입 | 설명 |
|---|---|---|
provider | PermissionProvider | — |
PermissionResult
열거형 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public enum PermissionResult
What a PermissionProvider decided.
| 상수 | 설명 |
|---|---|
ALLOW | — |
DENY | — |
UNDECIDED | No opinion; the next provider, or the node's default level, decides. |