Hotfix BauSystem RamUsage and AutoShutdown
Dieser Commit ist enthalten in:
Ursprung
aa4058d5f9
Commit
3cdff4c4b7
@ -161,13 +161,11 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
if (autoShutdown != null) {
|
||||
autoShutdown.cancel();
|
||||
}
|
||||
System.out.println("INIT AutoShutdown");
|
||||
autoShutdown = Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
|
||||
int count = 0;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("RUN AutoShutdown " + count);
|
||||
if (count >= 300) {
|
||||
Bukkit.shutdown();
|
||||
return;
|
||||
@ -178,7 +176,6 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
Bukkit.shutdown();
|
||||
}
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable);
|
||||
Bukkit.shutdown();
|
||||
}
|
||||
|
@ -34,10 +34,8 @@ public class RamUsage {
|
||||
try {
|
||||
long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
|
||||
long freeMemory = ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getFreePhysicalMemorySize();
|
||||
System.out.println(memorySize + " " + freeMemory);
|
||||
return (memorySize - freeMemory) / (double) memorySize;
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable);
|
||||
return 1D;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren