• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LoadWorldEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onWorldLoad

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener
public void onWorldLoad(LoadWorldEvent event)
{
    World world = event.getTargetWorld();
    logger.info("World loaded: "+ world.getName());
    UUID uniqueId = world.getUniqueId();
    claimedChunks.put(uniqueId, new HashMap<>());
    try
    {
        worldContexts.put(uniqueId, loadWorldContext(world));
    }
    catch (IOException e)
    {
        logger.error("Failed to load world data");
        Sponge.getServer().shutdown();
    }
}
 
开发者ID:GameModsBR,项目名称:MyChunks,代码行数:18,代码来源:MyChunks.java


示例2: onWorldLoad

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener(order = Order.EARLY, beforeModifications = true)
public void onWorldLoad(LoadWorldEvent event) {
    if (!SpongeImpl.getServer().isServerRunning() || !GriefPreventionPlugin.instance.claimsEnabledForWorld(event.getTargetWorld().getProperties())) {
        return;
    }

    GPTimings.WORLD_LOAD_EVENT.startTimingIfSync();
    GriefPreventionPlugin.instance.dataStore.loadWorldData(event.getTargetWorld());
    net.minecraft.world.World world = (net.minecraft.world.World) event.getTargetWorld();
    world.addEventListener(new EntityRemovalListener());
    GPTimings.WORLD_LOAD_EVENT.stopTimingIfSync();
    if (!GriefPreventionPlugin.getActiveConfig(event.getTargetWorld().getProperties()).getConfig().claim.bankTaxSystem) {
        return;
    }
    if (GriefPreventionPlugin.instance.economyService.isPresent()) {
        // run tax task
        TaxApplyTask taxTask = new TaxApplyTask(event.getTargetWorld().getProperties());
        int taxHour = GriefPreventionPlugin.getActiveConfig(event.getTargetWorld().getProperties()).getConfig().claim.taxApplyHour;
        long delay = TaskUtils.computeDelay(taxHour, 0, 0);
        Sponge.getScheduler().createTaskBuilder().async().delay(delay, TimeUnit.SECONDS).interval(1, TimeUnit.DAYS).execute(taxTask).submit(GriefPreventionPlugin.instance);
    }
}
 
开发者ID:MinecraftPortCentral,项目名称:GriefPrevention,代码行数:23,代码来源:WorldEventHandler.java


示例3: onWorldLoads

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener
public void onWorldLoads(LoadWorldEvent evt) {
    WorldLoadsScriptEvent event = (WorldLoadsScriptEvent) clone();
    event.internal = evt;
    event.world = new WorldTag(evt.getTargetWorld());
    event.cancelled = evt.isCancelled();
    event.run();
    evt.setCancelled(event.cancelled);
}
 
开发者ID:DenizenScript,项目名称:Denizen2Sponge,代码行数:10,代码来源:WorldLoadsScriptEvent.java


示例4: onLoadWorldEvent

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
/**
 * Chargement du monde
 */
@Listener
public void onLoadWorldEvent(final LoadWorldEvent event) {
	if (!event.isCancelled()) {
		this.plugin.getELogger().debug("Load world : " + event.getTargetWorld().getName());
		this.plugin.getService().registerWorldType(event.getTargetWorld().getName());
	}
}
 
开发者ID:EverCraft,项目名称:EverPermissions,代码行数:11,代码来源:EPListener.java


示例5: onWorldLoad

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener
public void onWorldLoad(LoadWorldEvent event) {
    // Even though the world is loaded, it looks like nothing exists at this time.
    // Need to runLater in order for our stuff to hook into existing object etc.
    // The real solution is to hook into chunk load/unloads
    Utils.runLater(() -> {
        try {
            Industrialization.instance().loadDataForWorld(event.getTargetWorld());
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
}
 
开发者ID:simon816,项目名称:Industrialization,代码行数:14,代码来源:WorldEventListeners.java


示例6: onWorldLoad

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener
public void onWorldLoad(LoadWorldEvent e) {
    World w = e.getTargetWorld();
    try {
        RedProtect.get().rm.load(w);
        RedProtect.get().cfgs.loadPerWorlds(w);  
        RedProtect.get().logger.warning("World loaded: " + w.getName());
        
    }
    catch (Exception ex) {
    	RedProtect.get().logger.severe("redprotect problem on load world:");
        ex.printStackTrace();
    }
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:15,代码来源:RPWorldListener.java


示例7: onLoadWorld

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener(order = Order.LAST)
public void onLoadWorld(LoadWorldEvent event)
{
    if (loaded)
    {
        tm.runAsynchronousTask(Locker.class, () -> loadLocksInWorld(event.getTargetWorld()));
    }
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:9,代码来源:LockManager.java


示例8: onLoadWorld

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener
public void onLoadWorld(LoadWorldEvent event) {
    final World world = event.getTargetWorld();
    final String name = world.getName();
    WorldGenerator generator = world.getWorldGenerator();
    GenerationPopulator terrain = generator.getBaseGenerationPopulator();
    if (terrain instanceof GeneratorWrapper) {
        GeneratorWrapper stg = (GeneratorWrapper) terrain;
        PS.get().loadWorld(name, stg);
    }
    else {
        PS.get().loadWorld(name, null);
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:15,代码来源:WorldEvents.java


示例9: onWorldLoad

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Listener
public void onWorldLoad(LoadWorldEvent event)
{
    this.loadRepairBlocks(this.persister.getAll(event.getTargetWorld()));
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:6,代码来源:RepairBlockManager.java


示例10: PoreWorldLoadEvent

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
public PoreWorldLoadEvent(LoadWorldEvent handle) {
    super(null);
    this.handle = checkNotNull(handle, "handle");
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:5,代码来源:PoreWorldLoadEvent.java


示例11: getHandle

import org.spongepowered.api.event.world.LoadWorldEvent; //导入依赖的package包/类
@Override
public LoadWorldEvent getHandle() {
    return handle;
}
 
开发者ID:LapisBlue,项目名称:Pore,代码行数:5,代码来源:PoreWorldLoadEvent.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RegistrationRequest类代码示例发布时间:2022-05-22
下一篇:
Java TestInterDatanodeProtocol类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap