parent
e9b0a4d67c
commit
b8f742a588
@ -2,6 +2,7 @@ package com.massivecraft.factions.util;
|
|||||||
|
|
||||||
import com.massivecraft.factions.*;
|
import com.massivecraft.factions.*;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -15,7 +16,7 @@ public class AutoLeaveProcessTask extends BukkitRunnable {
|
|||||||
private transient double toleranceMillis;
|
private transient double toleranceMillis;
|
||||||
|
|
||||||
public AutoLeaveProcessTask() {
|
public AutoLeaveProcessTask() {
|
||||||
ArrayList<FPlayer> fplayers = new ArrayList<FPlayer>(FPlayers.getInstance().getAllFPlayers());
|
ArrayList<FPlayer> fplayers = (ArrayList<FPlayer>) FPlayers.getInstance().getAllFPlayers();
|
||||||
this.iterator = fplayers.listIterator();
|
this.iterator = fplayers.listIterator();
|
||||||
this.toleranceMillis = Conf.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000;
|
this.toleranceMillis = Conf.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000;
|
||||||
this.readyToGo = true;
|
this.readyToGo = true;
|
||||||
|
@ -1,32 +1,28 @@
|
|||||||
package com.massivecraft.factions.zcore.persist.json;
|
package com.massivecraft.factions.zcore.persist.json;
|
||||||
|
|
||||||
import com.massivecraft.factions.Conf;
|
import com.massivecraft.factions.Conf;
|
||||||
|
import com.massivecraft.factions.FPlayers;
|
||||||
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
|
import com.massivecraft.factions.zcore.persist.MemoryFPlayer;
|
||||||
|
|
||||||
public class JSONFPlayer extends MemoryFPlayer {
|
public class JSONFPlayer extends MemoryFPlayer {
|
||||||
private transient boolean remove = false;
|
|
||||||
|
|
||||||
public JSONFPlayer(MemoryFPlayer arg0) {
|
public JSONFPlayer(MemoryFPlayer arg0) {
|
||||||
super(arg0);
|
super(arg0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONFPlayer() {
|
|
||||||
remove = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JSONFPlayer(String id) {
|
public JSONFPlayer(String id) {
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
remove = true;
|
((JSONFPlayers) FPlayers.getInstance()).fPlayers.remove(getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldBeSaved() {
|
public boolean shouldBeSaved() {
|
||||||
if (!this.hasFaction() && (this.getPowerRounded() == this.getPowerMaxRounded() || this.getPowerRounded() == (int) Math.round(Conf.powerPlayerStarting))) {
|
if (!this.hasFaction() && (this.getPowerRounded() == this.getPowerMaxRounded() || this.getPowerRounded() == (int) Math.round(Conf.powerPlayerStarting))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return !remove;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user