Improve create warps flag.

Rename the flag to PLACE_WARP as it is a more proper name.
Also, add a click handler that limits setting value from member to owner, as visitors should not be allowed.

Also, set default value outside island range as false.
This commit is contained in:
BONNe 2023-01-19 23:06:45 +02:00 committed by GitHub
parent 8be844b59f
commit 363a628244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -155,9 +155,13 @@ public class Warp extends Addon {
this.setState(State.DISABLED);
}
this.createWarpFlag = new Flag.Builder("SET-WARP", Material.OAK_SIGN)
this.createWarpFlag = new Flag.Builder("PLACE_WARP", Material.OAK_SIGN)
.addon(this)
.defaultRank(RanksManager.MEMBER_RANK)
.clickHandler(new CycleClick("PLACE_WARP",
RanksManager.MEMBER_RANK,
RanksManager.OWNER_RANK)).
.defaultSetting(false).
.mode(Flag.Mode.EXPERT)
.build();