Java 类org.bukkit.event.world.WorldInitEvent 实例源码

项目:BloodMoon    文件:WorldInitListener.java   
@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();
     }
     }*/
}
项目:PlotSquared    文件:WorldEvents.java   
@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));
    }
}
项目:Essentials    文件:GMWorldListener.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldInit(WorldInitEvent event)
{

    String worldName = event.getWorld().getName();

    if (GroupManager.isLoaded() && !plugin.getWorldsHolder().isInList(worldName))
    {
        GroupManager.logger.info("New world detected...");
        GroupManager.logger.info("Creating data for: " + worldName);
        plugin.getWorldsHolder().setupWorldFolder(worldName);
        plugin.getWorldsHolder().loadWorld(worldName);
        if (plugin.getWorldsHolder().isInList(worldName))
        {
            GroupManager.logger.info("Don't forget to configure/mirror this world in config.yml.");
        }
        else
        {
            GroupManager.logger.severe("Failed to configure this world.");
        }
    }
}
项目:Masters    文件:worldHandler.java   
@EventHandler (priority = EventPriority.NORMAL)
public void initialize(final WorldInitEvent evt) {
    StringBuilder players = new StringBuilder();

    for (Player pls : evt.getWorld().getPlayers()) {
        players.append(pls);
    }

    for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
        if (pl.hasPermission("masters.debug")) {
            pl.sendMessage(ChatColor.RED + "World " + evt.getWorld().getName() + " has been loaded by " + players + ".");
        }
    }

    //set string to null
    players.setLength(0);
    players.replace(0, 0, " ");
}
项目:EscapeLag    文件:NoSpawnChunks.java   
@EventHandler
public void onWorldLoad(WorldInitEvent evt) {
    if (noSpawnChunks) {
        World world = evt.getWorld();
        world.setKeepSpawnInMemory(false);
        AzureAPI.log("已为世界 " + world.getName() + " 设定不保留出生区块.");
    }
}
项目:EscapeLag    文件:WorldSpawnLimiter.java   
@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() + " 设定了生物刷新速率~");
    }
}
项目:Arcade2    文件:GeneralListeners.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldInit(WorldInitEvent event) {
    World world = event.getWorld();
    world.setAutoSave(false);
    world.setKeepSpawnInMemory(false);
    world.setSpawnFlags(false, false);
}
项目:Carbon-2    文件:WorldGeneratorInjector.java   
@EventHandler
public void onWorldInit(WorldInitEvent event) {
    WorldServer nmsworld = ((CraftWorld) event.getWorld()).getHandle();
    IChunkProvider genprovider = nmsworld.chunkProviderServer.chunkProvider;
    if (genprovider instanceof SkyLandsChunkGenerator) {
        ReflectionUtils.setFieldValue(NormalChunkGenerator.class, "provider", genprovider, new NewChunkProviderTheEnd(nmsworld, nmsworld.getSeed()));
    }
}
项目:BloodMoon    文件:DungeonListener.java   
@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));
    }
}
项目:UberHardcore    文件:ZombieSeigeHandler.java   
@EventHandler
public void onWorldInit(WorldInitEvent event) throws NoSuchFieldException, IllegalAccessException {
    WorldServer world = ((CraftWorld) event.getWorld()).getHandle();

    if (seigeHandlerField == null) {
        seigeHandlerField = WorldServer.class.getDeclaredField("siegeManager");
        seigeHandlerField.setAccessible(true);
    }

    seigeHandlerField.set(world, new CustomZombieSeige(world));
}
项目:UberHardcore    文件:ZombieSeigeHandler.java   
@EventHandler
public void onWorldInit(WorldInitEvent event) throws NoSuchFieldException, IllegalAccessException {
    WorldServer world = ((CraftWorld) event.getWorld()).getHandle();

    if (seigeHandlerField == null) {
        seigeHandlerField = WorldServer.class.getDeclaredField("siegeManager");
        seigeHandlerField.setAccessible(true);
    }

    seigeHandlerField.set(world, new CustomZombieSeige(world));
}
项目:UberHardcore    文件:ZombieSeigeHandler.java   
@EventHandler
public void onWorldInit(WorldInitEvent event) throws NoSuchFieldException, IllegalAccessException {
    WorldServer world = ((CraftWorld) event.getWorld()).getHandle();

    if (seigeHandlerField == null) {
        seigeHandlerField = WorldServer.class.getDeclaredField("siegeManager");
        seigeHandlerField.setAccessible(true);
    }

    seigeHandlerField.set(world, new CustomZombieSeige(world));
}
项目:FastAsyncWorldedit    文件:BukkitQueue_0.java   
@EventHandler
public static void onWorldLoad(WorldInitEvent event) {
    if (disableChunkLoad) {
        World world = event.getWorld();
        world.setKeepSpawnInMemory(false);
    }
}
项目:Spigot-Plus    文件:WorldManager.java   
@EventHandler
public void onWorldInit(WorldInitEvent evt) {
    if(safeSpawnMode){
        Location spawn = WorldManagerHelper.getSafestSpawnPoint(evt.getWorld());
        evt.getWorld().setSpawnLocation(spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ());
        logInfo("Safe Spawn: Updated spawn location " + spawn);
    }
    WorldManagerHelper.saveWorldConfig(evt.getWorld());
}
项目:beaconz    文件:WorldListener.java   
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onInit(WorldInitEvent event)
{
    //Bukkit.getLogger().info("On World Init called");
    if (event.getWorld().equals(getBeaconzWorld())) {
        if (!getBeaconzWorld().getPopulators().contains(getBlockPopulator())) {
            event.getWorld().getPopulators().add(getBlockPopulator());
        }
    }
}
项目:PlotSquared-Chinese    文件:WorldEvents.java   
@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;
}
项目:Carbon-2    文件:WorldGeneratorInjector.java   
@EventHandler
public void onWorldInit(WorldInitEvent event) {
    WorldServer nmsworld = ((CraftWorld) event.getWorld()).getHandle();
    IChunkProvider genprovider = nmsworld.chunkProviderServer.chunkProvider;
    if (genprovider instanceof SkyLandsChunkGenerator) {
        ReflectionUtils.setFieldValue(NormalChunkGenerator.class, "provider", genprovider, new NewChunkProviderTheEnd(nmsworld, nmsworld.getSeed()));
    }
}
项目:SwornPermissions    文件:WorldListener.java   
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldInit(WorldInitEvent event)
{
    World world = event.getWorld();
    plugin.getDataHandler().loadWorld(world);
    plugin.getPermissionHandler().registerWorld(world);
}
项目:GiantTrees    文件:TreePlugin.java   
@EventHandler
public void onWorldInit(final WorldInitEvent event) {
  for (final String worldName : TreePlugin.this.getConfig()
                                               .getStringList("worlds")) {
    if (worldName.equals(event.getWorld().getName())) {
      TreePlugin.this.getLogger()
                     .info("Attaching giant tree populator to world \""
                               + event.getWorld().getName() + "\"");
      event.getWorld().getPopulators()
           .add(new TreePopulator(TreePlugin.this));
      return;
    }
  }
}
项目:McMMOPlus    文件:WorldListener.java   
/**
 * 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();
}
项目:MagicWorlds    文件:MagicWorldsController.java   
@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);
}
项目:NoSpawnChunks    文件:WorldListener.java   
@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());
}
项目:OrePlus    文件:OPListener.java   
@EventHandler
public void onWorldInit (WorldInitEvent event)
{
    for (BlockPopulator pop : event.getWorld().getPopulators()) {
        if (pop instanceof OrePopulator)
            return;
    }

    if (event.getWorld().getEnvironment() == World.Environment.NORMAL) {
        event.getWorld().getPopulators().add(new OrePopulator(_plugin));
    }
}
项目:Uranium    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:ProjectAres    文件:DisableKeepSpawnInMemoryListener.java   
@EventHandler
public void onWorldInit(WorldInitEvent event) {
    event.getWorld().setKeepSpawnInMemory(false);
}
项目:SurvivalAPI    文件:AbstractGame.java   
@EventHandler
public void onWorldInit(final WorldInitEvent event)
{
    if (event.getWorld().getEnvironment() == World.Environment.NORMAL)
        this.init(event.getWorld());
}
项目:NeverLag    文件:NoSpawnChunkInMemory.java   
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onWorldLoad(WorldInitEvent e) {
    e.getWorld().setKeepSpawnInMemory(cm.isKeepSpawnChunkInMemory);
}
项目:ThermosRebased    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:TallNether    文件:TallNether.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onWorldInit(WorldInitEvent event) {
    prepareWorld(event.getWorld());
}
项目:Thermos    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:KCauldron    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:CauldronGit    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:Cauldron-Old    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:FastSurvival    文件:WorldGenerator.java   
@EventHandler(priority = EventPriority.HIGH)
public void onWorldInit(final WorldInitEvent event) {
    loadWorld(event.getWorld());
}
项目:FastSurvival    文件:WorldGenerator.java   
@EventHandler(priority = EventPriority.HIGH)
public void onWorldInit(final WorldInitEvent event) {
    loadWorld(event.getWorld());
}
项目:FFoKC    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}
项目:SurvivalGamesX    文件:WorldListener.java   
public void disable() {
    WorldInitEvent.getHandlerList().unregister(this);
    WorldUnloadEvent.getHandlerList().unregister(this);
    WorldLoadEvent.getHandlerList().unregister(this);
    WorldSaveEvent.getHandlerList().unregister(this);
}
项目:SurvivalGamesX    文件:WorldListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onWorldInit(WorldInitEvent ev) {
    plugin.getDebug().normal("#### " + ev.getWorld().getName() + " was saved.");
}
项目:Cauldron    文件:CraftServer.java   
@Override
public World createWorld(WorldCreator creator) {
    Validate.notNull(creator, "Creator may not be null");

    String name = creator.name();
    ChunkGenerator generator = creator.generator();
    File folder = new File(getWorldContainer(), name);
    World world = getWorld(name);
    net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName());
    boolean generateStructures = creator.generateStructures();

    if ((folder.exists()) && (!folder.isDirectory())) {
        throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
    }

    if (world != null) {
        return world;
    }

    boolean hardcore = false;
    WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
    net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings);

    pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true;
    System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension

    if (worldserver.getWorld().getKeepSpawnInMemory()) {
        short short1 = 196;
        long i = System.currentTimeMillis();
        for (int j = -short1; j <= short1; j += 16) {
            for (int k = -short1; k <= short1; k += 16) {
                long l = System.currentTimeMillis();

                if (l < i) {
                    i = l;
                }

                if (l > i + 1000L) {
                    int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
                    int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;

                    System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%");
                    i = l;
                }

                net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint();
                worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4);
            }
        }
    }
    pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld()));
    net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false;
    return worldserver.getWorld();
}