SteamWar/BauSystem
Archiviert
13
0

Merge branch 'autoStop' of SteamWar/BauSystem into master

Dieser Commit ist enthalten in:
Lixfel 2020-01-20 06:49:15 +01:00 committet von Gitea
Commit 4d8781a39b

Datei anzeigen

@ -18,6 +18,7 @@ import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
import java.io.File;
import java.io.IOException;
@ -32,6 +33,8 @@ public class BauSystem extends JavaPlugin implements Listener {
public static final String PREFIX = "§eBauSystem§8» §7";
public static final String SECTION_PATH = "/home/minecraft/backbone/server/UserBau/";
private BukkitTask autoShutdown;
@Override
public void onEnable() {
plugin = this;
@ -87,6 +90,8 @@ public class BauSystem extends JavaPlugin implements Listener {
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
Bukkit.getPluginManager().registerEvents(new TNTListener(), this);
Bukkit.getPluginManager().registerEvents(new BauScoreboard(), this);
autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 1200);
}
public static BauSystem getPlugin(){
@ -109,6 +114,11 @@ public class BauSystem extends JavaPlugin implements Listener {
@EventHandler
public void onJoin(PlayerLoginEvent e) {
if(autoShutdown != null){
autoShutdown.cancel();
autoShutdown = null;
}
Player p = e.getPlayer();
PermissionAttachment attachment = p.addAttachment(this);
attachment.setPermission("F3NPerm.use", true);