mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Use custom service abstraction in favour of Aero's AbstractService
Use Aero's YamlConfig in favour of FConfig Refractoring Small edits
This commit is contained in:
parent
7328d20c84
commit
e93ac11172
@ -6,10 +6,10 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
public class Announcer extends AbstractService<TotalFreedomMod>
|
public class Announcer extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private final List<String> announcements = Lists.newArrayList();
|
private final List<String> announcements = Lists.newArrayList();
|
||||||
@ -19,7 +19,7 @@ public class Announcer extends AbstractService<TotalFreedomMod>
|
|||||||
private long interval;
|
private long interval;
|
||||||
@Getter
|
@Getter
|
||||||
private String prefix;
|
private String prefix;
|
||||||
private BukkitRunnable announcer;
|
private BukkitTask announcer;
|
||||||
|
|
||||||
public Announcer(TotalFreedomMod plugin)
|
public Announcer(TotalFreedomMod plugin)
|
||||||
{
|
{
|
||||||
@ -60,9 +60,7 @@ public class Announcer extends AbstractService<TotalFreedomMod>
|
|||||||
|
|
||||||
FUtil.bcastMsg(prefix + announcements.get(current));
|
FUtil.bcastMsg(prefix + announcements.get(current));
|
||||||
}
|
}
|
||||||
};
|
}.runTaskTimer(TotalFreedomMod.plugin, interval, interval);
|
||||||
|
|
||||||
announcer.runTaskTimer(TotalFreedomMod.plugin, interval, interval);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -73,18 +71,9 @@ public class Announcer extends AbstractService<TotalFreedomMod>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
FUtil.cancel(announcer);
|
||||||
{
|
|
||||||
announcer.cancel();
|
|
||||||
}
|
|
||||||
catch (Exception ignored)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
announcer = null;
|
announcer = null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAnnouncements()
|
public List<String> getAnnouncements()
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -12,7 +11,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
|
||||||
public class AntiNuke extends AbstractService<TotalFreedomMod>
|
public class AntiNuke extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public AntiNuke(TotalFreedomMod plugin)
|
public AntiNuke(TotalFreedomMod plugin)
|
||||||
|
@ -3,7 +3,6 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -13,7 +12,7 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
public class AntiSpam extends AbstractService<TotalFreedomMod>
|
public class AntiSpam extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final int MSG_PER_CYCLE = 8;
|
public static final int MSG_PER_CYCLE = 8;
|
||||||
|
@ -2,12 +2,11 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
public class AutoKick extends AbstractService<TotalFreedomMod>
|
public class AutoKick extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final long AUTOKICK_RATE = 10 * 20L;
|
public static final long AUTOKICK_RATE = 10 * 20L;
|
||||||
|
@ -3,14 +3,13 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
|
||||||
public class ChatManager extends AbstractService<TotalFreedomMod>
|
public class ChatManager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public ChatManager(TotalFreedomMod plugin)
|
public ChatManager(TotalFreedomMod plugin)
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
package me.totalfreedom.totalfreedommod;
|
package me.totalfreedom.totalfreedommod;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
|
||||||
public class CommandSpy extends AbstractService<TotalFreedomMod>
|
public class CommandSpy extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public CommandSpy(TotalFreedomMod plugin)
|
public CommandSpy(TotalFreedomMod plugin)
|
||||||
|
@ -5,7 +5,6 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Boat;
|
import org.bukkit.entity.Boat;
|
||||||
@ -22,7 +21,7 @@ import org.bukkit.entity.Projectile;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
public class EntityWiper extends AbstractService<TotalFreedomMod>
|
public class EntityWiper extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long WIPE_RATE = 5 * 20L;
|
private static final long WIPE_RATE = 5 * 20L;
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package me.totalfreedom.totalfreedommod;
|
||||||
|
|
||||||
|
import net.pravian.aero.component.service.AbstractService;
|
||||||
|
|
||||||
|
public abstract class FreedomService extends AbstractService<TotalFreedomMod>
|
||||||
|
{
|
||||||
|
|
||||||
|
public FreedomService(TotalFreedomMod plugin)
|
||||||
|
{
|
||||||
|
super(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -20,7 +20,6 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
|||||||
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import net.pravian.aero.command.CommandReflection;
|
import net.pravian.aero.command.CommandReflection;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -59,7 +58,7 @@ import org.bukkit.util.Vector;
|
|||||||
*
|
*
|
||||||
* - Madgeek and Prozza
|
* - Madgeek and Prozza
|
||||||
*/
|
*/
|
||||||
public class FrontDoor extends AbstractService<TotalFreedomMod>
|
public class FrontDoor extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long UPDATER_INTERVAL = 180L * 20L;
|
private static final long UPDATER_INTERVAL = 180L * 20L;
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package me.totalfreedom.totalfreedommod;
|
package me.totalfreedom.totalfreedommod;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
public class Fuckoff extends AbstractService<TotalFreedomMod>
|
public class Fuckoff extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public Fuckoff(TotalFreedomMod plugin)
|
public Fuckoff(TotalFreedomMod plugin)
|
||||||
|
@ -2,16 +2,14 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
public class GameRuleHandler extends AbstractService<TotalFreedomMod>
|
public class GameRuleHandler extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private final Map<GameRule, Boolean> rules = new EnumMap<GameRule, Boolean>(GameRule.class);
|
private final Map<GameRule, Boolean> rules = new EnumMap<GameRule, Boolean>(GameRule.class);
|
||||||
@ -35,6 +33,7 @@ public class GameRuleHandler extends AbstractService<TotalFreedomMod>
|
|||||||
setGameRule(GameRule.DO_MOB_SPAWNING, !ConfigEntry.MOB_LIMITER_ENABLED.getBoolean(), false);
|
setGameRule(GameRule.DO_MOB_SPAWNING, !ConfigEntry.MOB_LIMITER_ENABLED.getBoolean(), false);
|
||||||
setGameRule(GameRule.DO_TILE_DROPS, false, false);
|
setGameRule(GameRule.DO_TILE_DROPS, false, false);
|
||||||
setGameRule(GameRule.MOB_GRIEFING, false, false);
|
setGameRule(GameRule.MOB_GRIEFING, false, false);
|
||||||
|
setGameRule(GameRule.COMMAND_BLOCK_OUTPUT, false);
|
||||||
setGameRule(GameRule.NATURAL_REGENERATION, true, false);
|
setGameRule(GameRule.NATURAL_REGENERATION, true, false);
|
||||||
commitGameRules();
|
commitGameRules();
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,8 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -15,7 +13,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class LoginProcess extends AbstractService<TotalFreedomMod>
|
public class LoginProcess extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final int DEFAULT_PORT = 25565;
|
public static final int DEFAULT_PORT = 25565;
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
package me.totalfreedom.totalfreedommod;
|
package me.totalfreedom.totalfreedommod;
|
||||||
|
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
public class MovementValidator extends AbstractService<TotalFreedomMod>
|
public class MovementValidator extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final int MAX_XZ_COORD = 30000000;
|
public static final int MAX_XZ_COORD = 30000000;
|
||||||
|
@ -7,7 +7,6 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
|||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -16,7 +15,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
|
||||||
public class Muter extends AbstractService<TotalFreedomMod>
|
public class Muter extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: Match actual commands
|
// TODO: Match actual commands
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package me.totalfreedom.totalfreedommod;
|
package me.totalfreedom.totalfreedommod;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class Orbiter extends AbstractService<TotalFreedomMod>
|
public class Orbiter extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public Orbiter(TotalFreedomMod plugin)
|
public Orbiter(TotalFreedomMod plugin)
|
||||||
|
@ -14,7 +14,6 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -25,7 +24,7 @@ import org.bukkit.event.block.BlockBreakEvent;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class ProtectArea extends AbstractService<TotalFreedomMod>
|
public class ProtectArea extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final double MAX_RADIUS = 50.0;
|
public static final double MAX_RADIUS = 50.0;
|
||||||
|
@ -6,9 +6,8 @@ import java.util.List;
|
|||||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
import net.minecraft.server.v1_8_R3.PropertyManager;
|
import net.minecraft.server.v1_8_R3.PropertyManager;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
|
|
||||||
public class ServerInterface extends AbstractService<TotalFreedomMod>
|
public class ServerInterface extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final String COMPILE_NMS_VERSION = "v1_8_R3";
|
public static final String COMPILE_NMS_VERSION = "v1_8_R3";
|
||||||
|
@ -2,14 +2,13 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.server.ServerListPingEvent;
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
|
|
||||||
public class ServerPing extends AbstractService<TotalFreedomMod>
|
public class ServerPing extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public ServerPing(TotalFreedomMod plugin)
|
public ServerPing(TotalFreedomMod plugin)
|
||||||
|
@ -16,7 +16,6 @@ import java.util.Map.Entry;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
@ -24,7 +23,7 @@ import org.json.simple.JSONArray;
|
|||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import org.json.simple.JSONValue;
|
import org.json.simple.JSONValue;
|
||||||
|
|
||||||
public class ServiceChecker extends AbstractService<TotalFreedomMod>
|
public class ServiceChecker extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
||||||
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.base.ConfigLoadable;
|
import net.pravian.aero.base.ConfigLoadable;
|
||||||
import net.pravian.aero.base.ConfigSavable;
|
import net.pravian.aero.base.ConfigSavable;
|
||||||
|
@ -8,14 +8,14 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.commands.Command_logs;
|
import me.totalfreedom.totalfreedommod.commands.Command_logs;
|
||||||
import me.totalfreedom.totalfreedommod.config.FConfig;
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
import net.pravian.aero.config.YamlConfig;
|
||||||
import net.pravian.aero.util.Ips;
|
import net.pravian.aero.util.Ips;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -26,7 +26,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.plugin.ServicePriority;
|
import org.bukkit.plugin.ServicePriority;
|
||||||
|
|
||||||
public class AdminList extends AbstractService<TotalFreedomMod>
|
public class AdminList extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -38,13 +38,13 @@ public class AdminList extends AbstractService<TotalFreedomMod>
|
|||||||
private final Map<String, Admin> ipTable = Maps.newHashMap();
|
private final Map<String, Admin> ipTable = Maps.newHashMap();
|
||||||
//
|
//
|
||||||
private int cleanThreshold = 24 * 7; // 1 Week in hours
|
private int cleanThreshold = 24 * 7; // 1 Week in hours
|
||||||
private final FConfig config;
|
private final YamlConfig config;
|
||||||
|
|
||||||
public AdminList(TotalFreedomMod plugin)
|
public AdminList(TotalFreedomMod plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
|
|
||||||
this.config = new FConfig(TotalFreedomMod.plugin, TotalFreedomMod.SUPERADMIN_FILENAME, true);
|
this.config = new YamlConfig(TotalFreedomMod.plugin, TotalFreedomMod.SUPERADMIN_FILENAME, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -9,12 +9,12 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import net.pravian.aero.config.YamlConfig;
|
import net.pravian.aero.config.YamlConfig;
|
||||||
import net.pravian.aero.util.Ips;
|
import net.pravian.aero.util.Ips;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -23,7 +23,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
|
|
||||||
public class BanManager extends AbstractService<TotalFreedomMod>
|
public class BanManager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private final Set<Ban> bans = Sets.newHashSet();
|
private final Set<Ban> bans = Sets.newHashSet();
|
||||||
|
@ -4,18 +4,18 @@ import me.totalfreedom.totalfreedommod.util.FLog;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.config.FConfig;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
import net.pravian.aero.config.YamlConfig;
|
||||||
import net.pravian.aero.util.Ips;
|
import net.pravian.aero.util.Ips;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
|
|
||||||
public class PermbanList extends AbstractService<TotalFreedomMod>
|
public class PermbanList extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -34,7 +34,7 @@ public class PermbanList extends AbstractService<TotalFreedomMod>
|
|||||||
permbannedNames.clear();
|
permbannedNames.clear();
|
||||||
permbannedIps.clear();
|
permbannedIps.clear();
|
||||||
|
|
||||||
final FConfig config = new FConfig(TotalFreedomMod.plugin, TotalFreedomMod.PERMBAN_FILENAME, true);
|
final YamlConfig config = new YamlConfig(TotalFreedomMod.plugin, TotalFreedomMod.PERMBAN_FILENAME, true);
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
for (String name : config.getKeys(false))
|
for (String name : config.getKeys(false))
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package me.totalfreedom.totalfreedommod.blocking;
|
package me.totalfreedom.totalfreedommod.blocking;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -13,7 +13,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class BlockBlocker extends AbstractService<TotalFreedomMod>
|
public class BlockBlocker extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlockBlocker(TotalFreedomMod plugin)
|
public BlockBlocker(TotalFreedomMod plugin)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package me.totalfreedom.totalfreedommod.blocking;
|
package me.totalfreedom.totalfreedommod.blocking;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
@ -21,7 +21,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
|
|
||||||
public class EventBlocker extends AbstractService<TotalFreedomMod>
|
public class EventBlocker extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public EventBlocker(TotalFreedomMod plugin)
|
public EventBlocker(TotalFreedomMod plugin)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package me.totalfreedom.totalfreedommod.blocking;
|
package me.totalfreedom.totalfreedommod.blocking;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -12,7 +12,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class InteractBlocker extends AbstractService<TotalFreedomMod>
|
public class InteractBlocker extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public InteractBlocker(TotalFreedomMod plugin)
|
public InteractBlocker(TotalFreedomMod plugin)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package me.totalfreedom.totalfreedommod.blocking;
|
package me.totalfreedom.totalfreedommod.blocking;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Bat;
|
import org.bukkit.entity.Bat;
|
||||||
import org.bukkit.entity.EnderDragon;
|
import org.bukkit.entity.EnderDragon;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -14,7 +14,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
|
|
||||||
public class MobBlocker extends AbstractService<TotalFreedomMod>
|
public class MobBlocker extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public MobBlocker(TotalFreedomMod plugin)
|
public MobBlocker(TotalFreedomMod plugin)
|
||||||
|
@ -5,12 +5,12 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.command.CommandReflection;
|
import net.pravian.aero.command.CommandReflection;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandMap;
|
import org.bukkit.command.CommandMap;
|
||||||
@ -19,7 +19,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
|
||||||
public class CommandBlocker extends AbstractService<TotalFreedomMod>
|
public class CommandBlocker extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static Pattern NUMBER_FLAG_PATTERN = Pattern.compile("(:([0-9]){5,})");
|
public static Pattern NUMBER_FLAG_PATTERN = Pattern.compile("(:([0-9]){5,})");
|
||||||
|
@ -5,15 +5,15 @@ import java.util.Map;
|
|||||||
import me.StevenLawson.BukkitTelnet.api.TelnetCommandEvent;
|
import me.StevenLawson.BukkitTelnet.api.TelnetCommandEvent;
|
||||||
import me.StevenLawson.BukkitTelnet.api.TelnetPreLoginEvent;
|
import me.StevenLawson.BukkitTelnet.api.TelnetPreLoginEvent;
|
||||||
import me.StevenLawson.BukkitTelnet.api.TelnetRequestDataTagsEvent;
|
import me.StevenLawson.BukkitTelnet.api.TelnetRequestDataTagsEvent;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||||
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
|
||||||
public class BukkitTelnetBridge extends AbstractService<TotalFreedomMod>
|
public class BukkitTelnetBridge extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public BukkitTelnetBridge(TotalFreedomMod plugin)
|
public BukkitTelnetBridge(TotalFreedomMod plugin)
|
||||||
|
@ -2,14 +2,14 @@ package me.totalfreedom.totalfreedommod.bridge;
|
|||||||
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
public class EssentialsBridge extends AbstractService<TotalFreedomMod>
|
public class EssentialsBridge extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private Essentials essentialsPlugin = null;
|
private Essentials essentialsPlugin = null;
|
||||||
|
@ -3,14 +3,14 @@ package me.totalfreedom.totalfreedommod.bridge;
|
|||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitPlayer;
|
import com.sk89q.worldedit.bukkit.BukkitPlayer;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
public class WorldEditBridge extends AbstractService<TotalFreedomMod>
|
public class WorldEditBridge extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private static WorldEditPlugin worldEditPlugin = null;
|
private static WorldEditPlugin worldEditPlugin = null;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package me.totalfreedom.totalfreedommod.caging;
|
package me.totalfreedom.totalfreedommod.caging;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -12,7 +12,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
public class Cager extends AbstractService<TotalFreedomMod>
|
public class Cager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public Cager(TotalFreedomMod plugin)
|
public Cager(TotalFreedomMod plugin)
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package me.totalfreedom.totalfreedommod.commands;
|
package me.totalfreedom.totalfreedommod.commands;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import net.pravian.aero.command.handler.SimpleCommandHandler;
|
import net.pravian.aero.command.handler.SimpleCommandHandler;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CommandLoader extends AbstractService<TotalFreedomMod>
|
public class CommandLoader extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -1,175 +0,0 @@
|
|||||||
package me.totalfreedom.totalfreedommod.config;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a definable YAML configuration.
|
|
||||||
*
|
|
||||||
* @see YamlConfiguration
|
|
||||||
*/
|
|
||||||
public class FConfig extends YamlConfiguration // BukkitLib @ https://github.com/Pravian/BukkitLib
|
|
||||||
{
|
|
||||||
|
|
||||||
private final Plugin plugin;
|
|
||||||
private final File configFile;
|
|
||||||
private final boolean copyDefaults;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new YamlConfig instance.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Example:
|
|
||||||
* <pre>
|
|
||||||
* YamlConfig config = new YamlConfig(this, "config.yml", true);
|
|
||||||
* config.load();
|
|
||||||
* </pre></p>
|
|
||||||
*
|
|
||||||
* @param plugin The plugin to which the config belongs.
|
|
||||||
* @param fileName The filename of the config file.
|
|
||||||
* @param copyDefaults If the defaults should be copied and/loaded from a config in the plugin jar-file.
|
|
||||||
*/
|
|
||||||
public FConfig(Plugin plugin, String fileName, boolean copyDefaults)
|
|
||||||
{
|
|
||||||
this(plugin, FUtil.getPluginFile(plugin, fileName), copyDefaults);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new YamlConfig instance.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Example:
|
|
||||||
* <pre>
|
|
||||||
* YamlConfig config = new YamlConfig(this, new File(plugin.getDataFolder() + "/players", "Prozza.yml"), false);
|
|
||||||
* config.load();
|
|
||||||
* </pre></p>
|
|
||||||
*
|
|
||||||
* @param plugin The plugin to which the config belongs.
|
|
||||||
* @param file The file of the config file.
|
|
||||||
* @param copyDefaults If the defaults should be copied and/loaded from a config in the plugin jar-file.
|
|
||||||
*/
|
|
||||||
public FConfig(Plugin plugin, File file, boolean copyDefaults)
|
|
||||||
{
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.configFile = file;
|
|
||||||
this.copyDefaults = copyDefaults;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validates if the configuration exists.
|
|
||||||
*
|
|
||||||
* @return True if the configuration exists.
|
|
||||||
*/
|
|
||||||
public boolean exists()
|
|
||||||
{
|
|
||||||
return configFile.exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Saves the configuration to the predefined file.
|
|
||||||
*
|
|
||||||
* @see #YamlConfig(Plugin, String, boolean)
|
|
||||||
*/
|
|
||||||
public void save()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
super.save(configFile);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
plugin.getLogger().severe("Could not save configuration file: " + configFile.getName());
|
|
||||||
plugin.getLogger().severe(ExceptionUtils.getStackTrace(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the configuration from the predefined file.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Optionally, if loadDefaults has been set to true, the file will be copied over from the default inside the jar-file of the owning plugin.</p>
|
|
||||||
*
|
|
||||||
* @see #YamlConfig(Plugin, String, boolean)
|
|
||||||
*/
|
|
||||||
public void load()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (copyDefaults)
|
|
||||||
{
|
|
||||||
if (!configFile.exists())
|
|
||||||
{
|
|
||||||
configFile.getParentFile().mkdirs();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FUtil.copy(plugin.getResource(configFile.getName()), configFile);
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
plugin.getLogger().severe("Could not write default configuration file: " + configFile.getName());
|
|
||||||
plugin.getLogger().severe(ExceptionUtils.getStackTrace(ex));
|
|
||||||
}
|
|
||||||
plugin.getLogger().info("Installed default configuration " + configFile.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
super.addDefaults(getDefaultConfig());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configFile.exists())
|
|
||||||
{
|
|
||||||
super.load(configFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
plugin.getLogger().severe("Could not load configuration file: " + configFile.getName());
|
|
||||||
plugin.getLogger().severe(ExceptionUtils.getStackTrace(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the raw YamlConfiguration this config is based on.
|
|
||||||
*
|
|
||||||
* @return The YamlConfiguration.
|
|
||||||
* @see YamlConfiguration
|
|
||||||
*/
|
|
||||||
public YamlConfiguration getConfig()
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the default configuration as been stored in the jar-file of the owning plugin.
|
|
||||||
*
|
|
||||||
* @return The default configuration.
|
|
||||||
*/
|
|
||||||
public YamlConfiguration getDefaultConfig()
|
|
||||||
{
|
|
||||||
final YamlConfiguration DEFAULT_CONFIG = new YamlConfiguration();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final InputStreamReader isr = new InputStreamReader(plugin.getResource(configFile.getName()));
|
|
||||||
DEFAULT_CONFIG.load(isr);
|
|
||||||
isr.close();
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
plugin.getLogger().severe("Could not load default configuration: " + configFile.getName());
|
|
||||||
plugin.getLogger().severe(ExceptionUtils.getStackTrace(ex));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
catch (InvalidConfigurationException ex)
|
|
||||||
{
|
|
||||||
plugin.getLogger().severe("Could not load default configuration: " + configFile.getName());
|
|
||||||
plugin.getLogger().severe(ExceptionUtils.getStackTrace(ex));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return DEFAULT_CONFIG;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +1,15 @@
|
|||||||
package me.totalfreedom.totalfreedommod.freeze;
|
package me.totalfreedom.totalfreedommod.freeze;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
public class Freezer extends AbstractService<TotalFreedomMod>
|
public class Freezer extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -3,12 +3,12 @@ package me.totalfreedom.totalfreedommod.fun;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.util.DepreciationAggregator;
|
import me.totalfreedom.totalfreedommod.util.DepreciationAggregator;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -22,7 +22,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class ItemFun extends AbstractService<TotalFreedomMod>
|
public class ItemFun extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private final Random random = new Random();
|
private final Random random = new Random();
|
||||||
|
@ -4,8 +4,8 @@ import com.google.common.collect.Maps;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -13,7 +13,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class Jumppads extends AbstractService<TotalFreedomMod>
|
public class Jumppads extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final Material BLOCK_ID = Material.WOOL;
|
public static final Material BLOCK_ID = Material.WOOL;
|
||||||
|
@ -4,9 +4,9 @@ import java.util.ArrayList;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -17,7 +17,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class Landminer extends AbstractService<TotalFreedomMod>
|
public class Landminer extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package me.totalfreedom.totalfreedommod.fun;
|
package me.totalfreedom.totalfreedommod.fun;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
public class MP44 extends AbstractService<TotalFreedomMod>
|
public class MP44 extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public MP44(TotalFreedomMod plugin)
|
public MP44(TotalFreedomMod plugin)
|
||||||
|
@ -13,17 +13,17 @@ import java.io.IOException;
|
|||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.HTTPSession;
|
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.HTTPSession;
|
||||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
|
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class HTTPDaemon extends AbstractService<TotalFreedomMod>
|
public class HTTPDaemon extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static String MIME_DEFAULT_BINARY = "application/octet-stream";
|
public static String MIME_DEFAULT_BINARY = "application/octet-stream";
|
||||||
|
@ -13,7 +13,6 @@ import me.totalfreedom.totalfreedommod.commands.FreedomCommand;
|
|||||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||||
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.heading;
|
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.heading;
|
||||||
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.paragraph;
|
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.paragraph;
|
||||||
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import net.pravian.aero.command.CommandReflection;
|
import net.pravian.aero.command.CommandReflection;
|
||||||
import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
|
import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
package me.totalfreedom.totalfreedommod.player;
|
package me.totalfreedom.totalfreedommod.player;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.pravian.aero.base.ConfigLoadable;
|
import net.pravian.aero.base.ConfigLoadable;
|
||||||
|
@ -5,11 +5,11 @@ import java.io.File;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import me.totalfreedom.totalfreedommod.config.FConfig;
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
import net.pravian.aero.config.YamlConfig;
|
||||||
import net.pravian.aero.util.Ips;
|
import net.pravian.aero.util.Ips;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
@ -18,7 +18,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
public class PlayerList extends AbstractService<TotalFreedomMod>
|
public class PlayerList extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final long AUTO_PURGE_TICKS = 20L * 60L * 5L;
|
public static final long AUTO_PURGE_TICKS = 20L * 60L * 5L;
|
||||||
@ -62,7 +62,7 @@ public class PlayerList extends AbstractService<TotalFreedomMod>
|
|||||||
{
|
{
|
||||||
for (PlayerData data : dataMap.values())
|
for (PlayerData data : dataMap.values())
|
||||||
{
|
{
|
||||||
FConfig config = getConfig(data);
|
YamlConfig config = getConfig(data);
|
||||||
data.saveTo(config);
|
data.saveTo(config);
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ public class PlayerList extends AbstractService<TotalFreedomMod>
|
|||||||
dataMap.put(player.getName().toLowerCase(), data);
|
dataMap.put(player.getName().toLowerCase(), data);
|
||||||
|
|
||||||
// Save player
|
// Save player
|
||||||
FConfig config = getConfig(data);
|
YamlConfig config = getConfig(data);
|
||||||
data.saveTo(config);
|
data.saveTo(config);
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
@ -214,9 +214,9 @@ public class PlayerList extends AbstractService<TotalFreedomMod>
|
|||||||
return new File(getConfigFolder(), name + ".yml");
|
return new File(getConfigFolder(), name + ".yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FConfig getConfig(PlayerData data)
|
protected YamlConfig getConfig(PlayerData data)
|
||||||
{
|
{
|
||||||
final FConfig config = new FConfig(TotalFreedomMod.plugin, getConfigFile(data.getUsername().toLowerCase()), false);
|
final YamlConfig config = new YamlConfig(TotalFreedomMod.plugin, getConfigFile(data.getUsername().toLowerCase()), false);
|
||||||
config.load();
|
config.load();
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package me.totalfreedom.totalfreedommod.rank;
|
package me.totalfreedom.totalfreedommod.rank;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import net.pravian.aero.util.ChatUtils;
|
import net.pravian.aero.util.ChatUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -18,7 +17,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
public class RankManager extends AbstractService<TotalFreedomMod>
|
public class RankManager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public RankManager(TotalFreedomMod plugin)
|
public RankManager(TotalFreedomMod plugin)
|
||||||
|
@ -7,10 +7,10 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.util.DepreciationAggregator;
|
import me.totalfreedom.totalfreedommod.util.DepreciationAggregator;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -23,7 +23,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
|||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class RollbackManager extends AbstractService<TotalFreedomMod>
|
public class RollbackManager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final Map<String, List<RollbackEntry>> history = Maps.newHashMap();
|
private static final Map<String, List<RollbackEntry>> history = Maps.newHashMap();
|
||||||
|
@ -31,7 +31,7 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.banning.Ban;
|
import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||||
import me.totalfreedom.totalfreedommod.config.FConfig;
|
import net.pravian.aero.config.YamlConfig;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import net.pravian.aero.util.Ips;
|
import net.pravian.aero.util.Ips;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@ -631,7 +631,7 @@ public class FUtil
|
|||||||
public static void createBackups(String file, boolean onlyWeekly)
|
public static void createBackups(String file, boolean onlyWeekly)
|
||||||
{
|
{
|
||||||
final String save = file.split("\\.")[0];
|
final String save = file.split("\\.")[0];
|
||||||
final FConfig config = new FConfig(TotalFreedomMod.plugin, "backup/backup.yml", false);
|
final YamlConfig config = new YamlConfig(TotalFreedomMod.plugin, "backup/backup.yml", false);
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
// Weekly
|
// Weekly
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package me.totalfreedom.totalfreedommod.world;
|
package me.totalfreedom.totalfreedommod.world;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import net.pravian.aero.component.service.AbstractService;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -14,7 +14,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
|||||||
import org.bukkit.event.weather.ThunderChangeEvent;
|
import org.bukkit.event.weather.ThunderChangeEvent;
|
||||||
import org.bukkit.event.weather.WeatherChangeEvent;
|
import org.bukkit.event.weather.WeatherChangeEvent;
|
||||||
|
|
||||||
public class WorldManager extends AbstractService<TotalFreedomMod>
|
public class WorldManager extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public Flatlands flatlands;
|
public Flatlands flatlands;
|
||||||
|
Loading…
Reference in New Issue
Block a user