mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 11:46:40 +00:00
removal of aero
This commit is contained in:
@ -14,14 +14,14 @@ import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.config.IConfig;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.base.Validatable;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Ban implements Validatable
|
||||
public class Ban implements IConfig
|
||||
{
|
||||
|
||||
public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z");
|
||||
@ -81,7 +81,7 @@ public class Ban implements Validatable
|
||||
|
||||
public static Ban forPlayerIp(Player player, CommandSender by, Date expiry, String reason)
|
||||
{
|
||||
return new Ban(null, Arrays.asList(Ips.getIp(player)), by.getName(), Date.from(Instant.now()), expiry, reason);
|
||||
return new Ban(null, Arrays.asList(FUtil.getIp(player)), by.getName(), Date.from(Instant.now()), expiry, reason);
|
||||
}
|
||||
|
||||
public static Ban forPlayerIp(String ip, CommandSender by, Date expiry, String reason)
|
||||
@ -116,7 +116,7 @@ public class Ban implements Validatable
|
||||
public static Ban forPlayer(Player player, CommandSender by, Date expiry, String reason)
|
||||
{
|
||||
return new Ban(player.getName(),
|
||||
Ips.getIp(player),
|
||||
FUtil.getIp(player),
|
||||
by.getName(),
|
||||
Date.from(Instant.now()),
|
||||
expiry,
|
||||
@ -126,7 +126,7 @@ public class Ban implements Validatable
|
||||
public static Ban forPlayerFuzzy(Player player, CommandSender by, Date expiry, String reason)
|
||||
{
|
||||
return new Ban(player.getName(),
|
||||
FUtil.getFuzzyIp(Ips.getIp(player)),
|
||||
FUtil.getFuzzyIp(FUtil.getIp(player)),
|
||||
by.getName(),
|
||||
Date.from(Instant.now()),
|
||||
expiry,
|
||||
@ -235,6 +235,16 @@ public class Ban implements Validatable
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadFrom(ConfigurationSection cs)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveTo(ConfigurationSection cs)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid()
|
||||
{
|
||||
|
@ -13,12 +13,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -35,13 +33,8 @@ public class BanManager extends FreedomService
|
||||
|
||||
//
|
||||
|
||||
public BanManager(TotalFreedomMod plugin)
|
||||
{
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart()
|
||||
public void onStart()
|
||||
{
|
||||
bans.clear();
|
||||
try
|
||||
@ -78,7 +71,7 @@ public class BanManager extends FreedomService
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop()
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
@ -120,7 +113,7 @@ public class BanManager extends FreedomService
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Ips.fuzzyIpMatch(ip, loopIp, 4))
|
||||
if (FUtil.fuzzyIpMatch(ip, loopIp, 4))
|
||||
{
|
||||
return loopBan;
|
||||
}
|
||||
@ -231,7 +224,7 @@ public class BanManager extends FreedomService
|
||||
public void onPlayerLogin(PlayerLoginEvent event)
|
||||
{
|
||||
final String username = event.getPlayer().getName();
|
||||
final String ip = Ips.getIp(event);
|
||||
final String ip = FUtil.getIp(event);
|
||||
|
||||
// Regular ban
|
||||
Ban ban = getByUsername(username);
|
||||
@ -265,7 +258,7 @@ public class BanManager extends FreedomService
|
||||
}
|
||||
else
|
||||
{
|
||||
ban = getByIp(Ips.getIp(player));
|
||||
ban = getByIp(FUtil.getIp(player));
|
||||
if (ban != null)
|
||||
{
|
||||
removeBan(ban);
|
||||
|
@ -4,12 +4,10 @@ import com.google.common.collect.Sets;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.config.YamlConfig;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.config.YamlConfig;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -25,13 +23,8 @@ public class PermbanList extends FreedomService
|
||||
@Getter
|
||||
private final Set<String> permbannedIps = Sets.newHashSet();
|
||||
|
||||
public PermbanList(TotalFreedomMod plugin)
|
||||
{
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart()
|
||||
public void onStart()
|
||||
{
|
||||
permbannedNames.clear();
|
||||
permbannedIps.clear();
|
||||
@ -49,7 +42,7 @@ public class PermbanList extends FreedomService
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop()
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
@ -57,7 +50,7 @@ public class PermbanList extends FreedomService
|
||||
public void onPlayerLogin(PlayerLoginEvent event)
|
||||
{
|
||||
final String username = event.getPlayer().getName();
|
||||
final String ip = Ips.getIp(event);
|
||||
final String ip = FUtil.getIp(event);
|
||||
|
||||
// Permbanned IPs
|
||||
for (String testIp : getPermbannedIps())
|
||||
|
Reference in New Issue
Block a user