mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-20 15:11:25 +01:00
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1041 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
825ad4edfc
commit
5125181967
@ -130,35 +130,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
|||||||
@Override
|
@Override
|
||||||
public void onPlayerQuit(PlayerEvent event)
|
public void onPlayerQuit(PlayerEvent event)
|
||||||
{
|
{
|
||||||
if (!Essentials.getSettings().getReclaimSetting())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
User.get(event.getPlayer()).dispose();
|
User.get(event.getPlayer()).dispose();
|
||||||
Thread thread = new Thread(new Runnable()
|
|
||||||
{
|
|
||||||
@SuppressWarnings("LoggerStringConcat")
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Thread.sleep(1000);
|
|
||||||
Runtime rt = Runtime.getRuntime();
|
|
||||||
double mem = rt.freeMemory();
|
|
||||||
rt.runFinalization();
|
|
||||||
rt.gc();
|
|
||||||
mem = rt.freeMemory() - mem;
|
|
||||||
mem /= 1024 * 1024;
|
|
||||||
logger.info("Freed " + mem + " MB.");
|
|
||||||
}
|
|
||||||
catch (InterruptedException ex)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
thread.setPriority(Thread.MIN_PRIORITY);
|
|
||||||
thread.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -151,11 +151,6 @@ public class Settings implements IConf
|
|||||||
return ChatColor.getByCode(Integer.parseInt(colorName, 16));
|
return ChatColor.getByCode(Integer.parseInt(colorName, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getReclaimSetting()
|
|
||||||
{
|
|
||||||
return config.getBoolean("reclaim-onlogout", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNetherName()
|
public String getNetherName()
|
||||||
{
|
{
|
||||||
return config.getString("nether.folder", "nether");
|
return config.getString("nether.folder", "nether");
|
||||||
|
Loading…
Reference in New Issue
Block a user