Add option to disable flying on pvp

This commit is contained in:
Magnus Ulf
2019-07-15 08:08:35 +02:00
parent 35c38ce4b8
commit 6724c4f065
4 changed files with 45 additions and 11 deletions

View File

@@ -323,7 +323,10 @@ public class MConf extends Entity<MConf>
// At what speed can players fly with /f fly?
public float flySpeed = 0.1f;
// Will flying be disabled on pvp
public boolean flyDisableOnPvp = false;
// -------------------------------------------- //
// DENY COMMANDS
// -------------------------------------------- //

View File

@@ -805,12 +805,7 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
// We clean the chunks further by removing what does not change.
// This is also very suggested cleaning of EventFactionsChunksChange input.
Iterator<PS> iter = chunks.iterator();
while (iter.hasNext())
{
PS chunk = iter.next();
Faction oldFaction = BoardColl.get().getFactionAt(chunk);
if (newFaction == oldFaction) iter.remove();
}
chunks.removeIf(chunk -> BoardColl.get().getFactionAt(chunk) == newFaction);
if (chunks.isEmpty())
{
msg("%s<i> already owns this land.", newFaction.describeTo(this, true));