mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-01 00:10:40 +01:00
Define a constant instead of duplicating literals
This commit is contained in:
parent
caf994738e
commit
760bc2e086
@ -329,30 +329,34 @@ public final class Flags {
|
||||
.clickHandler(new CycleClick("CHANGE_SETTINGS", RanksManager.MEMBER_RANK, RanksManager.OWNER_RANK))
|
||||
.mode(Flag.Mode.TOP_ROW).build();
|
||||
|
||||
private static final String SCULKSENSOR = "SCULK_SENSOR";
|
||||
|
||||
/**
|
||||
* This flag allows choosing which island member group can activate sculk sensors.
|
||||
* TODO: Enums#getIfPresent is used to support 1.18
|
||||
* @since 1.21.0
|
||||
*/
|
||||
public static final Flag SCULK_SENSOR = new Flag.Builder("SCULK_SENSOR", Enums.getIfPresent(Material.class, "SCULK_SENSOR").or(Material.BARRIER)).
|
||||
public static final Flag SCULK_SENSOR = new Flag.Builder(SCULKSENSOR, Enums.getIfPresent(Material.class, SCULKSENSOR).or(Material.BARRIER)).
|
||||
listener(new SculkSensorListener()).
|
||||
type(Type.PROTECTION).
|
||||
defaultSetting(true).
|
||||
defaultRank(RanksManager.MEMBER_RANK).
|
||||
clickHandler(new CycleClick("SCULK_SENSOR", RanksManager.VISITOR_RANK, RanksManager.MEMBER_RANK)).
|
||||
clickHandler(new CycleClick(SCULKSENSOR, RanksManager.VISITOR_RANK, RanksManager.MEMBER_RANK)).
|
||||
build();
|
||||
|
||||
private static final String SCULKSHRIEKER = "SCULK_SHRIEKER";
|
||||
|
||||
/**
|
||||
* This flag allows choosing which island member group can activate sculk shrieker.
|
||||
* TODO: Enums#getIfPresent is used to support 1.18
|
||||
* @since 1.21.0
|
||||
*/
|
||||
public static final Flag SCULK_SHRIEKER = new Flag.Builder("SCULK_SHRIEKER", Enums.getIfPresent(Material.class, "SCULK_SHRIEKER").or(Material.BARRIER)).
|
||||
public static final Flag SCULK_SHRIEKER = new Flag.Builder(SCULKSHRIEKER, Enums.getIfPresent(Material.class, SCULKSHRIEKER).or(Material.BARRIER)).
|
||||
listener(new SculkShriekerListener()).
|
||||
type(Type.PROTECTION).
|
||||
defaultSetting(true).
|
||||
defaultRank(RanksManager.MEMBER_RANK).
|
||||
clickHandler(new CycleClick("SCULK_SHRIEKER", RanksManager.VISITOR_RANK, RanksManager.MEMBER_RANK)).
|
||||
clickHandler(new CycleClick(SCULKSHRIEKER, RanksManager.VISITOR_RANK, RanksManager.MEMBER_RANK)).
|
||||
build();
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user