aikar / aikar/commands

Parameter Switches

Offen
#150 12 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
core help wanted
Vorherrschende Sprache
Java
Sterne
628
Forks
150
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.