Invert default value for DenyExitFlag

This commit is contained in:
Alexander Söderberg 2020-02-18 19:34:11 +01:00
parent 132e63e2fb
commit 3fce2cae1a
2 changed files with 4 additions and 3 deletions

View File

@ -95,10 +95,9 @@ public final class GlobalFlagContainer extends FlagContainer {
// Register all default flags here
// Boolean flags
this.addFlag(ExplosionFlag.EXPLOSION_FALSE);
this.addFlag(MusicFlag.MUSIC_FLAG_NONE);
this.addFlag(FlightFlag.FLIGHT_FLAG_FALSE);
this.addFlag(UntrustedVisitFlag.UNTRUSTED_VISIT_FLAG_TRUE);
this.addFlag(DenyExitFlag.DENY_EXIT_FLAG_TRUE);
this.addFlag(DenyExitFlag.DENY_EXIT_FLAG_FALSE);
this.addFlag(DescriptionFlag.DESCRIPTION_FLAG_EMPTY);
this.addFlag(GreetingFlag.GREETING_FLAG_EMPTY);
this.addFlag(FarewellFlag.FAREWELL_FLAG_EMPTY);
@ -176,6 +175,7 @@ public final class GlobalFlagContainer extends FlagContainer {
this.addFlag(GuestGamemodeFlag.GUEST_GAMEMODE_FLAG_DEFAULT);
this.addFlag(BlockedCmdsFlag.BLOCKED_CMDS_FLAG_NONE);
this.addFlag(KeepFlag.KEEP_FLAG_FALSE);
this.addFlag(MusicFlag.MUSIC_FLAG_NONE);
// Internal flags
this.addFlag(new AnalysisFlag(Collections.emptyList()));

View File

@ -7,13 +7,14 @@ import org.jetbrains.annotations.NotNull;
public class DenyExitFlag extends BooleanFlag<DenyExitFlag> {
public static final DenyExitFlag DENY_EXIT_FLAG_TRUE = new DenyExitFlag(true);
public static final DenyExitFlag DENY_EXIT_FLAG_FALSE = new DenyExitFlag(false);
protected DenyExitFlag(boolean value) {
super(value, Captions.FLAG_DESCRIPTION_DENY_EXIT);
}
@Override protected DenyExitFlag flagOf(@NotNull Boolean value) {
return new DenyExitFlag(value);
return value ? DENY_EXIT_FLAG_TRUE : DENY_EXIT_FLAG_FALSE;
}
}