当前位置: 首页>>代码示例>>Java>>正文


Java Bukkit.shutdown方法代码示例

本文整理汇总了Java中org.bukkit.Bukkit.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java Bukkit.shutdown方法的具体用法?Java Bukkit.shutdown怎么用?Java Bukkit.shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.Bukkit的用法示例。


在下文中一共展示了Bukkit.shutdown方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CheckAndDownloadPlugin

import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static void CheckAndDownloadPlugin() {
    if (ConfigMain.AutoUpdate == true) {
        try {
            // 整体获取
            File NetworkerFile = new File(EscapeLag.MainThis.getDataFolder(), "networkerlog");
            DowloadFile("http://www.relatev.com/files/EscapeLag/NetWorker.yml", NetworkerFile);
            YamlConfiguration URLLog = YamlConfiguration.loadConfiguration(NetworkerFile);
            // 检查插件并下载新版本
            EscapeLag.MainThis.getLogger().info("正在检查新版本插件,请稍等...");
            int NewVersion = URLLog.getInt("UpdateVersion");
            int NowVersion = Integer.valueOf("%BUILD_NUMBER%");
            if (NewVersion > NowVersion) {
                EscapeLag.MainThis.getLogger().info("插件检测到新版本 " + NewVersion + ",正在自动下载新版本插件...");
                DowloadFile("https://www.relatev.com/files/EscapeLag/EscapeLag.jar", EscapeLag.getPluginsFile());
                EscapeLag.MainThis.getLogger().info("插件更新版本下载完成!正在重启服务器!");
                Bukkit.shutdown();
            } else {
                EscapeLag.MainThis.getLogger().info("EscapeLag插件工作良好,暂无新版本检测更新。");
            }
            // 完成提示
            EscapeLag.MainThis.getLogger().info("全部网络工作都读取完毕了...");
        } catch (IOException ex) {
        }
    }
}
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:26,代码来源:NetWorker.java

示例2: AgarGame

import org.bukkit.Bukkit; //导入方法依赖的package包/类
public AgarGame(GameType type) {
    super("agarmc", AgarMC.NAME, type.getDisplayName(), CPlayer.class);
    gameType = type;
    try
    {
        IGameProperties config = SamaGamesAPI.get().getGameManager().getGameProperties();
        origin = Utils.getLocation(config.getOption("origin", null));
        dimensions = config.getOption("dimensions", null).getAsInt();
        maxstatic = dimensions * dimensions / 24;
        maxvirus = dimensions * dimensions / 1000;
        maxcells = 16;
        Bukkit.getLogger().info("Arena : Origin = " + origin.toString() + ", Dimensions = " + dimensions);
    }
    catch(Exception e)
    {
        Bukkit.getLogger().severe("Error in game.json ! Stopping server !");
        e.printStackTrace();
        Bukkit.shutdown();
    }
}
 
开发者ID:SamaGames,项目名称:AgarMC,代码行数:21,代码来源:AgarGame.java

示例3: connect

import org.bukkit.Bukkit; //导入方法依赖的package包/类
private void connect()
{
    JedisPoolConfig config = new JedisPoolConfig();
    config.setMaxTotal(-1);
    config.setJmxEnabled(false);

    try
    {
        this.cachePool = new JedisPool(config, this.bungee.getIp(), this.bungee.getPort(), 0, this.bungee.getPassword());
        this.cachePool.getResource().close();

        this.plugin.log(Level.INFO, "Connected to database.");
    }
    catch (Exception e)
    {
        plugin.getLogger().log(Level.SEVERE, "Can't connect to the database!", e);
        Bukkit.shutdown();
    }
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:20,代码来源:DatabaseConnector.java

示例4: channelRead0

import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
protected void channelRead0(ChannelHandlerContext ctx, Packet packet) throws Exception {
	if (packet instanceof PacketPing) {
		ctx.channel().writeAndFlush(packet);
	} else if (packet instanceof PacketKillServer) {
		Bukkit.shutdown();
	} else if (packet instanceof PacketToServerDispatchCommand) {
		Bukkit.dispatchCommand(Bukkit.getConsoleSender(), ((PacketToServerDispatchCommand) packet).getCommand());
	}

	SpigotConnectorPlugin.getInstance().getPacketHandlers().forEach(handler -> handler.channelRead(ctx, packet));
}
 
开发者ID:CentauriCloud,项目名称:CentauriCloud,代码行数:13,代码来源:NetworkHandler.java

示例5: run

import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Deprecated
@Override
public void run()
{
    getServer().getPluginManager().disablePlugin(this);
    Bukkit.shutdown();
}
 
开发者ID:Dytanic,项目名称:CloudNet,代码行数:8,代码来源:BukkitBootstrap.java

示例6: RestartServer

import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static void RestartServer(String message){
AzureAPI.log("开始以理由 " + message +"重启服务器...");
List<Player> players = AzurePlayerList.players();
int ps = players.size();
for(int i=0;i<ps;i++){
	Player player = players.get(i);
	player.kickPlayer(loggerPrefix + message);
}
      Bukkit.shutdown();
  }
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:11,代码来源:AzureAPI.java

示例7: run

import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
public void run() {
	TIME += 1;

       Bukkit.getScheduler().scheduleSyncDelayedTask(Walls.instance, new Runnable() {
           @Override
           public void run() {
               Walls.checkWinner();
           }
       });
	
	int limit = 2700;
	if (TIME == limit - 300) {
	    Chat.server("&cGame ending in 5 minutes!");
	    return;
	}
	if (TIME == limit - 120) {
	    Chat.server("&cGame ending in 2 minutes!");
	    return;
	}
	if (TIME == limit - 60) {
	    Chat.server("&cGame ending in 1 minute!");
	    return;
	}
	if (TIME >= limit - 10) {
		Chat.server("&cGame ending in " + Chat.time(2700 - TIME) + "!");
	}
	if (TIME == limit || Bukkit.getOnlinePlayers().length == 0) {
		Bukkit.shutdown();
	}
	
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:33,代码来源:PVPTask.java

示例8: reload

import org.bukkit.Bukkit; //导入方法依赖的package包/类
public void reload()
{
    try
    {
        File file = new File(APIPlugin.getInstance().getDataFolder().getAbsoluteFile().getParentFile().getParentFile(), "game.json");

        if (!file.exists())
        {
            APIPlugin.log(Level.WARNING, "No game properties file found! If this serveur isn't a game server, don't worry about this message!");
            return;
        }

        JsonObject rootJson = new JsonParser().parse(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8"))).getAsJsonObject();
        this.templateID = rootJson.get("template-id").getAsString();
        this.mapName = rootJson.get("map-name").getAsString();
        this.minSlots = rootJson.get("min-slots").getAsInt();
        this.maxSlots = rootJson.get("max-slots").getAsInt();
        this.options = rootJson.get("options").getAsJsonObject();

        File worldFolder = new File(APIPlugin.getInstance().getDataFolder().getAbsoluteFile().getParentFile().getParentFile(), "world");
        File arenaFile = new File(worldFolder, "arena.json");

        if (!arenaFile.exists())
        {
            this.mapProperties = new JsonObject();
            APIPlugin.log(Level.WARNING, "No arena properties file found! If this serveur isn't a game server, don't worry about this message!");
            return;
        }

        this.mapProperties = new JsonParser().parse(new InputStreamReader(new FileInputStream(arenaFile), Charset.forName("UTF-8"))).getAsJsonObject();
    }
    catch (FileNotFoundException e)
    {
        e.printStackTrace();
        APIPlugin.log(Level.SEVERE, "Can't open the game properties file. Abort start!");
        APIPlugin.getInstance().disable();
        Bukkit.shutdown();
    }
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:40,代码来源:GameProperties.java

示例9: run

import org.bukkit.Bukkit; //导入方法依赖的package包/类
@Override
public void run() {
	if (TIME % 20 == 0) {
        Kit.load();
	}
	
	TOTAL_TIME += 1;
	if (Bukkit.getOnlinePlayers().length > 1)
	    TIME -= 1;
	
	if (TOTAL_TIME > 900 && Bukkit.getOnlinePlayers().length <= 3) {
	    Bukkit.shutdown();
	}
	
	if (Bukkit.getOnlinePlayers().length==Bukkit.getMaxPlayers() && TIME >= 15) {
		TIME = 10;
	}
	
	if (TIME==0) {
		boolean start = true;
		for (Team team : Team.list) {
			if (team.getMembers().size() <= 2) {
				start = false;
				break;
			}
		}
		if (start) {
		    Bukkit.getScheduler().scheduleSyncDelayedTask(Walls.instance, new Runnable() {
                   @Override
                   public void run() {
                       Walls.prep();
                   }
		    });
		}
		else {
			Chat.server("&cWe need 2 players per team in order to start the game!");
			TIME = Config.getInt("pre-time");
			return;
		}
		return;
	}
	
	if (TIME % 20 == 0 || TIME <= 10)
		Chat.server("&eGame beginning in &4" + Chat.time(TIME) + "&e!");	
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:46,代码来源:PreTask.java

示例10: finishGeneration

import org.bukkit.Bukkit; //导入方法依赖的package包/类
public void finishGeneration(World world, long time)
{
    this.getLogger().info("Ready in " + time + "ms");
    Bukkit.shutdown();
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:6,代码来源:SurvivalGenerator.java

示例11: fatal

import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static void fatal(final String prefix, final String context) {
    Bukkit.getLogger().severe(prefix + context);
    Bukkit.shutdown();
}
 
开发者ID:Recraft,项目名称:Recreator,代码行数:5,代码来源:AzureAPI.java


注:本文中的org.bukkit.Bukkit.shutdown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。