[Bleeding] Save when purging (ip)ban list. Resolves #219

Small changes
This commit is contained in:
unknown 2014-06-28 00:22:55 +02:00
parent 1fb14ca1dd
commit 850fd9aa4a
5 changed files with 33 additions and 32 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sun Jun 22 18:05:43 CEST 2014
build.number=876
#Fri Jun 27 23:44:06 CEST 2014
build.number=881

View File

@ -130,26 +130,32 @@ public class TFM_WorldEditBridge
try
{
final LocalSession session = getPlayerSession(player);
if (session != null)
if (session == null)
{
final World selectionWorld = session.getSelectionWorld();
final Region selection = session.getSelection(selectionWorld);
if (TFM_ProtectedArea.isInProtectedArea(
getBukkitVector(selection.getMinimumPoint()),
getBukkitVector(selection.getMaximumPoint()),
selectionWorld.getName()))
{
new BukkitRunnable()
{
@Override
public void run()
{
player.sendMessage(ChatColor.RED + "The region that you selected contained a protected area. Selection cleared.");
session.getRegionSelector(selectionWorld).clear();
}
}.runTaskLater(TotalFreedomMod.plugin, 1L);
}
return;
}
final World selectionWorld = session.getSelectionWorld();
final Region selection = session.getSelection(selectionWorld);
if (TFM_ProtectedArea.isInProtectedArea(
getBukkitVector(selection.getMinimumPoint()),
getBukkitVector(selection.getMaximumPoint()),
selectionWorld.getName()))
{
new BukkitRunnable()
{
@Override
public void run()
{
player.sendMessage(ChatColor.RED + "The region that you selected contained a protected area. Selection cleared.");
session.getRegionSelector(selectionWorld).clear();
}
}.runTask(TotalFreedomMod.plugin);
}
}
catch (IncompleteRegionException ex)
{

View File

@ -27,19 +27,12 @@ public class TFM_TelnetListener implements Listener
if (admin == null || !admin.isTelnetAdmin())
{
event.setCancelled(true);
return;
}
event.setBypassPassword(true);
event.setName(admin.getLastLoginName());
final OfflinePlayer player = Bukkit.getOfflinePlayer(admin.getLastLoginName());
if (player == null)
{
return;
}
event.setName(player.getName());
}
@EventHandler(priority = EventPriority.NORMAL)

View File

@ -246,13 +246,13 @@ public class TFM_AdminList
config.set("clean_threshold_hours", cleanThreshold);
Iterator<Entry<UUID, TFM_Admin>> it = adminList.entrySet().iterator();
final Iterator<Entry<UUID, TFM_Admin>> it = adminList.entrySet().iterator();
while (it.hasNext())
{
Entry<UUID, TFM_Admin> pair = it.next();
final Entry<UUID, TFM_Admin> pair = it.next();
UUID uuid = pair.getKey();
TFM_Admin superadmin = pair.getValue();
final UUID uuid = pair.getKey();
final TFM_Admin superadmin = pair.getValue();
config.set("admins." + uuid + ".last_login_name", superadmin.getLastLoginName());
config.set("admins." + uuid + ".is_activated", superadmin.isActivated());

View File

@ -271,11 +271,13 @@ public class TFM_BanManager
public void purgeIpBans()
{
ipBans.clear();
save();
}
public void purgeUuidBans()
{
uuidBans.clear();
save();
}
public static TFM_BanManager getInstance()