Update BauSystem
Dieser Commit ist enthalten in:
Ursprung
c3610be4e1
Commit
6a62dde065
@ -43,6 +43,9 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@ -168,7 +171,19 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
if (autoShutdown != null) {
|
if (autoShutdown != null) {
|
||||||
autoShutdown.cancel();
|
autoShutdown.cancel();
|
||||||
}
|
}
|
||||||
autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 1200);
|
/*autoShutdown = Bukkit.getScheduler().runTaskTimer(this, () -> {
|
||||||
|
try {
|
||||||
|
ProcessBuilder processBuilder = new ProcessBuilder("/bin/bash", "-c", "free");
|
||||||
|
Process process = processBuilder.start();
|
||||||
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||||
|
bufferedReader.readLine();
|
||||||
|
String s = bufferedReader.readLine();
|
||||||
|
} catch (IOException exception) {
|
||||||
|
Bukkit.shutdown();
|
||||||
|
}
|
||||||
|
}, 1200, 1200);*/
|
||||||
|
// (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().freeMemory()) / Runtime.getRuntime().maxMemory() > 0.8
|
||||||
|
autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 6000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren