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


Java GameReloadEvent类代码示例

本文整理汇总了Java中org.spongepowered.api.event.game.GameReloadEvent的典型用法代码示例。如果您正苦于以下问题:Java GameReloadEvent类的具体用法?Java GameReloadEvent怎么用?Java GameReloadEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GameReloadEvent类属于org.spongepowered.api.event.game包,在下文中一共展示了GameReloadEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReload(GameReloadEvent event)
{
    try
    {
        MessageReceiver src = event.getCause().first(CommandSource.class).orElse(Sponge.getServer().getConsole());
        src.sendMessage(this.translation.take("virtualchest.reload.start"));
        this.loadConfig();
        this.saveConfig();
        src.sendMessage(this.translation.take("virtualchest.reload.finish"));
    }
    catch (IOException e)
    {
        throw Throwables.propagate(e);
    }
}
 
开发者ID:ustc-zzzz,项目名称:VirtualChest,代码行数:17,代码来源:VirtualChestPlugin.java

示例2: onGameReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onGameReload(GameReloadEvent event) {
    if (this.cleanLocksTask != null) {
        this.cleanLocksTask.cancel();
    }

    unregisterListeners();

    config.reloadConfig();
    storageHandler.reloadTables();

    loadConfigurationData();
    registerListeners(true);
    registerTasks();

    logger.info("Latch has been successfully reloaded.");
}
 
开发者ID:ichorpowered,项目名称:latch,代码行数:18,代码来源:Latch.java

示例3: onGameReloadEvent

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onGameReloadEvent(GameReloadEvent event) {

    // Close db sessions
    if (this.persistenceService != null && this.persistenceService.getSessionFactory().isOpen()) {
        this.persistenceService.getSessionFactory().close();
    }

    if (this.setupConfigs() && this.setupDatabase()) {
        if (!this.loaded) {
            this.load();
            this.registerListeners();
            this.registerCommands();
        }
        this.getLogger().info(String.format("%s was reloaded.", Destinations.NAME));
    } else {
        this.getLogger().error(String.format("There was an error reloading %s.", Destinations.NAME));
    }
}
 
开发者ID:mmonkey,项目名称:Destinations,代码行数:20,代码来源:Destinations.java

示例4: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Override
public void onReload(GameReloadEvent event) {
    HashMap<Command, Long> cooldowns = new HashMap<>();
    HashMap<Command, Long> warmups = new HashMap<>();

    CommandsConfig config = UltimateCore.get().getCommandsConfig();
    CommentedConfigurationNode node = config.get();

    for (Command cmd : UltimateCore.get().getCommandService().getCommands()) {
        CommentedConfigurationNode cmdnode = node.getNode("commands", cmd.getIdentifier());
        if (!cmdnode.getNode("cooldown").isVirtual()) {
            cooldowns.put(cmd, TimeUtil.parse(cmdnode.getNode("cooldown").getString()));
        }
        if (!cmdnode.getNode("warmup").isVirtual()) {
            warmups.put(cmd, TimeUtil.parse(cmdnode.getNode("warmup").getString()));
        }
    }

    GlobalData.offer(CommandtimerKeys.COOLDOWNS, cooldowns);
    GlobalData.offer(CommandtimerKeys.WARMUPS, warmups);
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:22,代码来源:CommandtimerModule.java

示例5: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReload(GameReloadEvent event) {
    try {
        Long time = System.currentTimeMillis();
        UltimateCore.get().getGeneralConfig().reload();
        UltimateCore.get().getCommandsConfig().reload();
        UltimateCore.get().getCommandsConfig().postload();
        UltimateCore.get().getModulesConfig().reload();
        UltimateCore.get().getModulesConfig().postload();

        for (Module mod : UltimateCore.get().getModuleService().getModules()) {
            if (mod.getConfig() != null && mod.getConfig().isPresent()) {
                mod.getConfig().get().reload();
                mod.onReload(event);
            }
        }

        getLanguageService().reload();

        time = System.currentTimeMillis() - time;
        Messages.log(Messages.getFormatted("core.load.reload", "%ms%", time));
    } catch (Exception ex) {
        ErrorLogger.log(ex, "Failed to stop UltimateCore");
    }
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:26,代码来源:UltimateCore.java

示例6: reload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void reload(GameReloadEvent event) throws Exception {
	Cause cause = Cause.source(this).build();

	// Unregistering everything
	GameStoppingEvent gameStoppingEvent = SpongeEventFactory.createGameStoppingEvent(cause);
	stop(gameStoppingEvent);

	// Starting over
	GameInitializationEvent gameInitializationEvent = SpongeEventFactory.createGameInitializationEvent(cause);
	init(gameInitializationEvent);

	logger.info("Reloaded successfully!");
}
 
开发者ID:AuraDevelopmentTeam,项目名称:InvSync,代码行数:15,代码来源:InventorySync.java

示例7: onGameReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onGameReload(@Nullable final GameReloadEvent event) {
    this.logger.info("Reloading...");
    this.settings.Load(this.configfullpath, this);
    Tools.Backpack_unlockall(this);
    this.logger.info("Reloaded!");
}
 
开发者ID:poqdavid,项目名称:VirtualTool,代码行数:8,代码来源:VirtualTool.java

示例8: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReload(GameReloadEvent event) {
	// Unregistering everything
	onStop();

	// Starting over
	onInit();
	onLoadComplete();

	logger.info("Reloaded successfully!");
}
 
开发者ID:AuraDevelopmentTeam,项目名称:AuraSunDial,代码行数:12,代码来源:AuraSunDial.java

示例9: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReload(GameReloadEvent evt){
	logger.info("Reloading...");
	
	try {
		load();
	} catch (IOException | ObjectMappingException e) {
		logger.error("Failed to load or create config-file!", e);
		return;
	}
	
	startUpdateTask();
}
 
开发者ID:TBlueF,项目名称:RottenFood,代码行数:14,代码来源:RottenFood.java

示例10: onReloadEvent

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReloadEvent(GameReloadEvent event) {
    try {
        reload();
    } catch (IOException | ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
开发者ID:NucleusPowered,项目名称:Phonon,代码行数:9,代码来源:Phonon.java

示例11: onReloadPlugins

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
   public void onReloadPlugins(GameReloadEvent event) {
	//reload config
	initConfig();
	//reload messages
	initMessages();
}
 
开发者ID:FabioZumbi12,项目名称:Sponge-PixelAutoMessage,代码行数:8,代码来源:PixelAutoMessages.java

示例12: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReload(GameReloadEvent event) {
    cfgLoader = new ConfigLoader(this);
    if (cfgLoader.loadConfig()) cclConfig = cfgLoader.getCclConfig();
    if (cfgLoader.loadMessages()) messages = cfgLoader.getMessagesConfig();
    for (Task task : tasks) {
        task.cancel();
    }
    tasks = new ArrayList<>();
    Task.Builder builder = getGame().getScheduler().createTaskBuilder();
    tasks.add(builder.execute(new ItemClearer())
            .async()
            .delay(cclConfig.interval, TimeUnit.MINUTES)
            .interval(cclConfig.interval, TimeUnit.MINUTES)
            .name("CatClearLag Item Remover")
            .submit(this));
    cclConfig.warnings.forEach((d) ->
            tasks.add(builder.execute(new ItemClearingWarning(((cclConfig.interval * 60) - d)))
                    .async()
                    .delay(d, TimeUnit.SECONDS)
                    .interval(cclConfig.interval, TimeUnit.MINUTES)
                    .name("CatClearLag Removal Warnings")
                    .submit(this)));
    tasks.add(builder.execute(new EntityChecker())
            .async()
            .delay(cclConfig.limits.entityCheckInterval, TimeUnit.MINUTES)
            .interval(cclConfig.limits.entityCheckInterval, TimeUnit.MINUTES)
            .name("CatClearLag hostile checker")
            .submit(this));
}
 
开发者ID:Time6628,项目名称:CatClearLag,代码行数:31,代码来源:CatClearLag.java

示例13: onReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onReload(GameReloadEvent event) throws IOException, ObjectMappingException {
	reloadConfig();

	// Send Messages to console and player
	event.getCause().first(Player.class).ifPresent(p -> p.sendMessage(Messages.get().plugin.reloadSuccess.t()));
	logger.info("Reloaded PlaceholderAPI");
}
 
开发者ID:rojo8399,项目名称:PlaceholderAPI,代码行数:9,代码来源:PlaceholderAPIPlugin.java

示例14: onGameReload

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
public void onGameReload(GameReloadEvent event) {
    LibConfig.loadConfig();
    if (LibConfig.useLanguagePack()) {
        this.languageManager.fetch(this.logger);
    }
}
 
开发者ID:simon816,项目名称:ChatUI,代码行数:8,代码来源:ChatUILib.java

示例15: onReloadPlugins

import org.spongepowered.api.event.game.GameReloadEvent; //导入依赖的package包/类
@Listener
   public void onReloadPlugins(GameReloadEvent event) {
	try {
		reload();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:FabioZumbi12,项目名称:UltimateChat,代码行数:9,代码来源:UChat.java


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