Add f fly

This commit is contained in:
Magnus Ulf
2019-01-27 22:30:56 +01:00
parent cf8852524e
commit f35c040af7
9 changed files with 199 additions and 0 deletions

View File

@ -321,6 +321,9 @@ public class MConf extends Entity<MConf>
// Make faction disbanding a confirmation thing
public boolean requireConfirmationForFactionDisbanding = true;
// At what speed can players fly with /f fly?
public float flySpeed = 0.1f;
// -------------------------------------------- //
// DENY COMMANDS

View File

@ -34,6 +34,7 @@ public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, N
public final static transient String ID_PERMANENT = "permanent";
public final static transient String ID_PEACEFUL = "peaceful";
public final static transient String ID_INFPOWER = "infpower";
public final static transient String ID_FLY = "fly";
public final static transient int PRIORITY_OPEN = 1_000;
public final static transient int PRIORITY_MONSTERS = 2_000;
@ -50,6 +51,7 @@ public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, N
public final static transient int PRIORITY_PERMANENT = 13_000;
public final static transient int PRIORITY_PEACEFUL = 14_000;
public final static transient int PRIORITY_INFPOWER = 15_000;
public final static transient int PRIORITY_FLY = 16_000;
// -------------------------------------------- //
// META: CORE
@ -89,6 +91,7 @@ public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, N
getFlagPermanent();
getFlagPeaceful();
getFlagInfpower();
getFlagFly();
}
public static MFlag getFlagOpen() { return getCreative(PRIORITY_OPEN, ID_OPEN, ID_OPEN, "Can the faction be joined without an invite?", "Anyone can join. No invite required.", "An invite is required to join.", false, true, true); }
@ -106,6 +109,7 @@ public class MFlag extends Entity<MFlag> implements Prioritized, Registerable, N
public static MFlag getFlagPermanent() { return getCreative(PRIORITY_PERMANENT, ID_PERMANENT, ID_PERMANENT, "Is the faction immune to deletion?", "The faction can NOT be deleted.", "The faction can be deleted.", false, false, true); }
public static MFlag getFlagPeaceful() { return getCreative(PRIORITY_PEACEFUL, ID_PEACEFUL, ID_PEACEFUL, "Is the faction in truce with everyone?", "The faction is in truce with everyone.", "The faction relations work as usual.", false, false, true); }
public static MFlag getFlagInfpower() { return getCreative(PRIORITY_INFPOWER, ID_INFPOWER, ID_INFPOWER, "Does the faction have infinite power?", "The faction has infinite power.", "The faction power works as usual.", false, false, true); }
public static MFlag getFlagFly() { return getCreative(PRIORITY_FLY, ID_FLY, ID_FLY, "Is flying allowed for members in faction territory?", "Members can fly in faction territory.", "Members can not fly in faction territory.", false, false, true); }
public static MFlag getCreative(int priority, String id, String name, String desc, String descYes, String descNo, boolean standard, boolean editable, boolean visible)
{

View File

@ -175,6 +175,9 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
// Null means default specified in MConf.
private Boolean territoryInfoTitles = null;
// Is the player doing faction flying?
private Boolean flying = null;
// The Faction this player is currently autoclaiming for.
// Null means the player isn't auto claiming.
// NOTE: This field will not be saved to the database ever.
@ -582,6 +585,20 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
this.changed();
}
// -------------------------------------------- //
// FIELD: fly
// -------------------------------------------- //
public boolean isFlying()
{
return this.convertGet(this.flying, false, Perm.FLY);
}
public void setFlying(Boolean flying)
{
this.flying = this.convertSet(flying, this.flying, false);
}
// -------------------------------------------- //
// TITLE, NAME, FACTION NAME AND CHAT
// -------------------------------------------- //