mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-13 03:40:45 +01:00
Flags#values() will no longer return deprecated flags
Deprecated Flags are flags that will be removed. It is therefore better to not return them in this method.
This commit is contained in:
parent
66de769bb0
commit
095237cd5d
@ -167,6 +167,8 @@ public final class Flags {
|
||||
* - The Crazy World of Arthur Brown
|
||||
*/
|
||||
public static final Flag FIRE = new Flag.Builder("FIRE", Material.FLINT_AND_STEEL).listener(new FireListener()).build();
|
||||
|
||||
|
||||
public static final Flag FIRE_EXTINGUISH = new Flag.Builder("FIRE_EXTINGUISH", Material.POTION).build();
|
||||
|
||||
// Inventories
|
||||
@ -335,7 +337,9 @@ public final class Flags {
|
||||
* @return List of all the flags in this class
|
||||
*/
|
||||
public static List<Flag> values() {
|
||||
return Arrays.stream(Flags.class.getFields()).map(field -> {
|
||||
return Arrays.stream(Flags.class.getFields())
|
||||
.filter(field -> field.getAnnotation(Deprecated.class) == null) // Ensures it is not deprecated
|
||||
.map(field -> {
|
||||
try {
|
||||
return (Flag)field.get(null);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user