aikar / aikar/commands

Parameter Switches

未關閉
#150 12 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
core help wanted
主要語言
Java
星號
628
分支
150
PR 合併指標
30 天內沒有已合併 PR

描述

Implement @Switch("res") to be used such as:

```java
@Subcommand("set")
public void onResInfo(Player player, @Switch("r,res") Residence res, Permission perm, PermissionState value) {
res.getPermissions().setState(perm, value);
}
```

With this, the following commands should work:
```
/res set 1111 build true
/res set build -res 1111 true
/res set -r 1111 build true
/res set build true -r 1111
```

When a parameter has a switch, it can be "Supplied" at any location of parameters (but not before the subcommands)

Switches should process command replacements

We can achieve this by first pre-parsing all switches during context resolution, marking what parameters have been satisfied, and then iterating the remainder of unsatisfied to complete them in order.

No new registration of switches needs to occur.

Switches should use - prefix by default, but the manager should allow customizing switch prefixes.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。