當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldInitEvent.getWorld方法代碼示例

本文整理匯總了Java中org.bukkit.event.world.WorldInitEvent.getWorld方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldInitEvent.getWorld方法的具體用法?Java WorldInitEvent.getWorld怎麽用?Java WorldInitEvent.getWorld使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.event.world.WorldInitEvent的用法示例。


在下文中一共展示了WorldInitEvent.getWorld方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
    World world = event.getWorld();

    plugin.createConfig(world);

    /*if (plugin.isFeatureEnabled(world.getName(), Feature.SPAWN_CONTROL)){
     WorldServer worldServer = ((CraftWorld) world).getHandle();
			
     try{
     IChunkLoader chunkLoader = ReflectionUtils.getFieldValue(net.minecraft.server.v1_8_R1.ChunkProviderServer.class, "chunkLoader", IChunkLoader.class, worldServer.chunkProviderServer);

     ChunkProviderServer newProvider = new ChunkProviderServer(this.plugin, worldServer, chunkLoader, worldServer.chunkProviderServer.chunkProvider);

     newProvider.chunks = worldServer.chunkProviderServer.chunks;
     newProvider.forceChunkLoad = worldServer.chunkProviderServer.forceChunkLoad;

     worldServer.chunkProviderServer = newProvider;
     }catch (NoSuchFieldException e){
     e.printStackTrace();
     }
     }*/
}
 
開發者ID:Samistine,項目名稱:BloodMoon,代碼行數:24,代碼來源:WorldInitListener.java

示例2: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
    World world = event.getWorld();
    String name = world.getName();
    PlotAreaManager manager = PS.get().getPlotAreaManager();
    if (manager instanceof SinglePlotAreaManager) {
        SinglePlotAreaManager single = (SinglePlotAreaManager) manager;
        if (single.isWorld(name)) {
            world.setKeepSpawnInMemory(false);
            return;
        }
    }
    ChunkGenerator gen = world.getGenerator();
    if (gen instanceof GeneratorWrapper) {
        PS.get().loadWorld(name, (GeneratorWrapper<?>) gen);
    } else {
        PS.get().loadWorld(name, new BukkitPlotGenerator(name, gen));
    }
}
 
開發者ID:IntellectualSites,項目名稱:PlotSquared,代碼行數:20,代碼來源:WorldEvents.java

示例3: onWorldLoad

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public void onWorldLoad(WorldInitEvent evt) {
	if (noSpawnChunks) {
		World world = evt.getWorld();
		world.setKeepSpawnInMemory(false);
		AzureAPI.log("已為世界 " + world.getName() + " 設定不保留出生區塊.");
	}
}
 
開發者ID:GelandiAssociation,項目名稱:EscapeLag,代碼行數:9,代碼來源:NoSpawnChunks.java

示例4: WorldSeterLimitor

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public void WorldSeterLimitor(WorldInitEvent event) {
    World world = event.getWorld();
    FileConfiguration config = EscapeLag.configOptimize.getValue();
    if (config.getBoolean("WorldSpawnLimitor." + world.getName() + ".enable")) {
        world.setMonsterSpawnLimit(config.getInt("WorldSpawnLimitor." + world.getName() + ".PerChunkMonsters"));
        world.setAnimalSpawnLimit(config.getInt("WorldSpawnLimitor." + world.getName() + ".PerChunkAnimals"));
        world.setAmbientSpawnLimit(config.getInt("WorldSpawnLimitor." + world.getName() + ".PerChunkAmbient"));
        EscapeLag.MainThis.getLogger().info("已為世界 " + world.getName() + " 設定了生物刷新速率~");
    }
}
 
開發者ID:GelandiAssociation,項目名稱:EscapeLag,代碼行數:12,代碼來源:WorldSpawnLimiter.java

示例5: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldInit(WorldInitEvent event) {
    World world = event.getWorld();
    world.setAutoSave(false);
    world.setKeepSpawnInMemory(false);
    world.setSpawnFlags(false, false);
}
 
開發者ID:ShootGame,項目名稱:Arcade2,代碼行數:8,代碼來源:GeneralListeners.java

示例6: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
    World world = event.getWorld();

    if (plugin.isEnabled(world) && plugin.isFeatureEnabled(world, Feature.DUNGEONS)) {
        world.getPopulators().add(new DungeonGenerator(plugin));
    }
}
 
開發者ID:Samistine,項目名稱:BloodMoon,代碼行數:9,代碼來源:DungeonListener.java

示例7: onWorldLoad

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public static void onWorldLoad(WorldInitEvent event) {
    if (disableChunkLoad) {
        World world = event.getWorld();
        world.setKeepSpawnInMemory(false);
    }
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:8,代碼來源:BukkitQueue_0.java

示例8: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public static void onWorldInit(final WorldInitEvent event) {
    final World world = event.getWorld();
    String name = getName(world);
    final ChunkGenerator gen = world.getGenerator();
    if (gen instanceof PlotGenerator) {
        //
        PlotSquared.loadWorld(name, (PlotGenerator) gen);
    } else {
        if (PlotSquared.config.contains("worlds." + name)) {
            PlotSquared.loadWorld(name, null);
        }
    }
    lastWorld = null;
}
 
開發者ID:Mayomi,項目名稱:PlotSquared-Chinese,代碼行數:16,代碼來源:WorldEvents.java

示例9: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldInit(WorldInitEvent event)
{
	World world = event.getWorld();
	plugin.getDataHandler().loadWorld(world);
	plugin.getPermissionHandler().registerWorld(world);
}
 
開發者ID:dmulloy2,項目名稱:SwornPermissions,代碼行數:8,代碼來源:WorldListener.java

示例10: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
/**
 * Monitor WorldInit events.
 *
 * @param event The event to watch
 */
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
    World world = event.getWorld();

    if (!new File(world.getWorldFolder(), "mcmmo_data").exists() || plugin == null) {
        return;
    }

    plugin.getLogger().info("Converting block storage for " + world.getName() + " to a new format.");

    new BlockStoreConversionMain(world).run();
}
 
開發者ID:Pershonkey,項目名稱:McMMOPlus,代碼行數:18,代碼來源:WorldListener.java

示例11: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public void onWorldInit(WorldInitEvent event) {
       World world = event.getWorld();
       for (MagicWorld notifyWorld : magicWorlds.values()) {
           notifyWorld.onWorldInit(plugin, world);
       }
	MagicWorld magicWorld = magicWorlds.get(world.getName());
	if (magicWorld == null) return;
	
	logger.info("Initializing world " + world.getName());
	magicWorld.installPopulators(world);
}
 
開發者ID:elBukkit,項目名稱:MagicWorlds,代碼行數:13,代碼來源:MagicWorldsController.java

示例12: onWorldInit

import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldInit(WorldInitEvent event)
{
	World world = event.getWorld();
	if (plugin.isAllWorlds() || plugin.getWorlds().contains(world.getName().toLowerCase()))
		world.setKeepSpawnInMemory(plugin.isKeepSpawnInMemory());
}
 
開發者ID:dmulloy2,項目名稱:NoSpawnChunks,代碼行數:8,代碼來源:WorldListener.java


注:本文中的org.bukkit.event.world.WorldInitEvent.getWorld方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。