Code Reformat

This commit is contained in:
Driftay 2019-09-11 06:58:46 -04:00
parent bc62491862
commit 9b68687ef7
8 changed files with 16 additions and 16 deletions

View File

@ -24,7 +24,6 @@ import java.util.concurrent.ConcurrentHashMap;
public interface Faction extends EconomyParticipator {
int getWallCheckMinutes();
void setWallCheckMinutes(int minutes);

View File

@ -239,7 +239,7 @@ public class P extends MPlugin {
}
log("Skript addon registered!");
}
if(Conf.useCheckSystem) {
if (Conf.useCheckSystem) {
int minute = 1200;
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 3), 0L, (long) (minute * 3));
this.getServer().getScheduler().runTaskTimerAsynchronously(this, new CheckTask(this, 5), 0L, (long) (minute * 5));

View File

@ -302,7 +302,7 @@ public class FCmdRoot extends FCommand {
if (P.p.getConfig().getBoolean("enable-faction-flight", false)) {
this.addSubCommand(this.cmdFly);
}
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null || Bukkit.getServer().getPluginManager().getPlugin("SaberFTOP") != null) {
if (Bukkit.getServer().getPluginManager().getPlugin("FactionsTop") != null || Bukkit.getServer().getPluginManager().getPlugin("SavageFTOP") != null || Bukkit.getServer().getPluginManager().getPlugin("SaberFTOP") != null) {
P.p.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
} else {
P.p.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");

View File

@ -103,7 +103,7 @@ public class CheckSettingsFrame implements InventoryHolder, FactionGUI {
return minutes + " Minutes";
}
public String color(String message){
public String color(String message) {
return ChatColor.translateAlternateColorCodes('&', message);
}
}

View File

@ -13,9 +13,9 @@ import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
public class CheckTask implements Runnable {
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Conf.dateFormat);
private static List<String> wallChecks = new CopyOnWriteArrayList<>();
private static List<String> bufferChecks = new CopyOnWriteArrayList<>();
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Conf.dateFormat);
private P plugin;
private int minute;
@ -43,6 +43,14 @@ public class CheckTask implements Runnable {
}
}
public static boolean wallCheck(String factionId) {
return CheckTask.wallChecks.remove(factionId);
}
public static boolean bufferCheck(String factionId) {
return CheckTask.bufferChecks.remove(factionId);
}
@Override
public void run() {
long currentTime = System.currentTimeMillis();
@ -86,13 +94,5 @@ public class CheckTask implements Runnable {
}
}
public static boolean wallCheck(String factionId) {
return CheckTask.wallChecks.remove(factionId);
}
public static boolean bufferCheck(String factionId) {
return CheckTask.bufferChecks.remove(factionId);
}
}

View File

@ -20,6 +20,6 @@ public class WeeWooTask implements Runnable {
continue;
}
faction.msg(TL.WEE_WOO_MESSAGE);
}
}
}
}

View File

@ -7,12 +7,13 @@ import org.bukkit.event.Cancellable;
/**
* Represents {@link Role} change of a factions player
*
* @see FPlayer#getRole()
*/
public class FPlayerRoleChangeEvent extends FactionPlayerEvent implements Cancellable {
private boolean cancelled;
private final Role from;
private boolean cancelled;
private Role to;
public FPlayerRoleChangeEvent(Faction faction, FPlayer fPlayer, Role from, Role to) {

View File

@ -101,7 +101,7 @@ public class FactionsPlayerListener implements Listener {
return false;
}
if(me.getFaction() == otherFaction) return true;
if (me.getFaction() == otherFaction) return true;
if (P.p.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) {
return true;