mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 19:46:42 +00:00
Unsaves SavedFlags
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.world;
|
||||
|
||||
import java.io.File;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -32,8 +29,6 @@ public class Flatlands extends CustomWorld
|
||||
return null;
|
||||
}
|
||||
|
||||
wipeFlatlandsIfFlagged();
|
||||
|
||||
final WorldCreator worldCreator = new WorldCreator(getName());
|
||||
worldCreator.generateStructures(false);
|
||||
worldCreator.type(WorldType.NORMAL);
|
||||
@ -63,32 +58,4 @@ public class Flatlands extends CustomWorld
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
|
||||
public void wipeFlatlandsIfFlagged()
|
||||
{
|
||||
boolean doFlatlandsWipe = false;
|
||||
try
|
||||
{
|
||||
doFlatlandsWipe = plugin.sf.getSavedFlag("do_wipe_flatlands");
|
||||
}
|
||||
catch (Exception ignored)
|
||||
{
|
||||
}
|
||||
|
||||
if (doFlatlandsWipe)
|
||||
{
|
||||
if (Bukkit.getServer().getWorld("flatlands") == null)
|
||||
{
|
||||
FLog.info("Wiping flatlands.");
|
||||
plugin.sf.setSavedFlag("do_wipe_flatlands", false);
|
||||
FileUtils.deleteQuietly(new File("./flatlands"));
|
||||
}
|
||||
else
|
||||
{
|
||||
FLog.severe("Can't wipe flatlands, it is already loaded.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user