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


Java BlockPopulator类代码示例

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


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

示例1: getAllPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
/**
 * Get all populators available
 * 
 * @return all the populators available
 */
public List<BlockPopulator> getAllPopulators() {
	ArrayList<BlockPopulator> populators = new ArrayList<BlockPopulator>();
	populators.add(new BiomeTreePopulator());
	populators.add(new CavePopulator(8, 32));
	populators.add(new OrePopulator(Material.COAL_ORE, Material.STONE, 8, 8));
	populators.add(new OrePopulator(Material.IRON_ORE, Material.STONE, 6, 6));
	populators.add(new OrePopulator(Material.LAPIS_ORE, Material.STONE, 2, 4));
	populators.add(new OrePopulator(Material.GOLD_ORE, Material.STONE, 4, 4));
	populators.add(new OrePopulator(Material.DIAMOND_ORE, Material.STONE, 3, 4));
	populators.add(new OrePopulator(Material.REDSTONE_ORE, Material.STONE, 4, 16));
	populators.add(new OrePopulator(Material.EMERALD_ORE, Material.STONE, 1, 3));
	populators.add(new OrePopulator(Material.QUARTZ_ORE, Material.NETHERRACK, 16, 8));
	populators.add(new RidgePopulator(Material.STONE, 3));
	populators.add(new SnowPopulator());
	populators.add(new EndTowerPopulator());
	populators.add(new NetherSoulSandPopulator());
	populators.add(new NetherFirePopulator());
	populators.add(new NetherGlowstonePopulator());
	return populators;
}
 
开发者ID:alyphen,项目名称:BukkitPopulators,代码行数:26,代码来源:BukkitPopulators.java

示例2: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@Override
public List<BlockPopulator> getDefaultPopulators(final World world) {
    if (!this.nmsInitialized && !this.initializeNms(world)) {
        return null;
    }
    return Collections.singletonList((BlockPopulator) this.blockPopulator);
}
 
开发者ID:Ribesg,项目名称:Pure,代码行数:8,代码来源:ProxyChunkGenerator.java

示例3: getBp

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
/**
 * @return the bp
 */
public BlockPopulator getBp() {
    if (beaconPopulator == null) {
        beaconPopulator = new BeaconPopulator(this);
    }
    return beaconPopulator;
}
 
开发者ID:tastybento,项目名称:beaconz,代码行数:10,代码来源:Beaconz.java

示例4: removePopulator

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
public static void removePopulator(final String worldname, final PlotCluster cluster) {
    final World world = Bukkit.getWorld(worldname);
    for (final Iterator<BlockPopulator> iterator = world.getPopulators().iterator(); iterator.hasNext();) {
        final BlockPopulator populator = iterator.next();
        if (populator instanceof AugmentedPopulator) {
            if (((AugmentedPopulator) populator).cluster.equals(cluster)) {
                iterator.remove();
            }
        }
    }
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:12,代码来源:AugmentedPopulator.java

示例5: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List<BlockPopulator> getDefaultPopulators(World world) {
    try {
        if (!loaded) {
            PlotSquared.loadWorld(WorldEvents.getName(world), this);
            PlotWorld plotworld = PlotSquared.getPlotWorld(WorldEvents.getName(world));
            if (!plotworld.MOB_SPAWNING) {
                if (!plotworld.SPAWN_EGGS) {
                    world.setSpawnFlags(false, false);
                }
                world.setAmbientSpawnLimit(0);
                world.setAnimalSpawnLimit(0);
                world.setMonsterSpawnLimit(0);
                world.setWaterAnimalSpawnLimit(0);
            }
            else {
                world.setSpawnFlags(true, true);
                world.setAmbientSpawnLimit(-1);
                world.setAnimalSpawnLimit(-1);
                world.setMonsterSpawnLimit(-1);
                world.setWaterAnimalSpawnLimit(-1);
            }
            loaded = true;
            return (List<BlockPopulator>)(List<?>) getPopulators(WorldEvents.getName(world));
        }
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    return new ArrayList<BlockPopulator>();
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:33,代码来源:PlotGenerator.java

示例6: setGenerator

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
public static void setGenerator(World world) throws Exception {
    SetupUtils.manager.updateGenerators();
    PlotSquared.removePlotWorldAbs(world.getName());
    ChunkGenerator gen = world.getGenerator();
    if (gen == null) {
        return;
    }
    String name = gen.getClass().getCanonicalName();
    boolean set = false;
    for (ChunkGenerator newGen : SetupUtils.generators.values()) {
        if (newGen.getClass().getCanonicalName().equals(name)) {
            // set generator
            Field generator = world.getClass().getDeclaredField("generator");
            Field populators = world.getClass().getDeclaredField("populators");
            generator.setAccessible(true);
            populators.setAccessible(true);
            // Set populators (just in case)
            populators.set(world, new ArrayList<>());
            // Set generator
            Constructor<? extends ChunkGenerator> constructor = newGen.getClass().getConstructor(String.class);
            ChunkGenerator newNewGen = constructor.newInstance(world.getName());
            generator.set(world, newNewGen);
            populators.set(world, newNewGen.getDefaultPopulators(world));
            // end
            set = true;
            break;
        }
    }
    if (!set) {
        Iterator<BlockPopulator> iter = world.getPopulators().iterator();
        while (iter.hasNext()) {
            if (iter.next() instanceof AugmentedPopulator) {
                iter.remove();
            }
        }
    }
    PlotSquared.loadWorld(world.getName(), null);
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:39,代码来源:SetGenCB.java

示例7: getPopulator

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
public static AugmentedPopulator getPopulator(final PlotCluster cluster) {
    final World world = Bukkit.getWorld(cluster.world);
    for (final BlockPopulator populator : world.getPopulators()) {
        if (populator instanceof AugmentedPopulator) {
            if (((AugmentedPopulator) populator).cluster.equals(cluster)) {
                return (AugmentedPopulator) populator;
            }
        }
    }
    return null;
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:12,代码来源:ClusterManager.java

示例8: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@Override
   public List<BlockPopulator> getDefaultPopulators(World world) {
//return Arrays.asList(new BlockPopulator[0]);
List<BlockPopulator> list = new ArrayList<BlockPopulator>(1);
list.add(new SkyGridPop(Settings.gridHeight));
return list;
   }
 
开发者ID:tastybento,项目名称:askygrid,代码行数:8,代码来源:SkyGridGen.java

示例9: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@Override
   public List<BlockPopulator> getDefaultPopulators(final World world) {
       /*
if (world.getEnvironment().equals(World.Environment.NETHER)) {
    return Arrays.<BlockPopulator> asList(new NetherPopulator());
}*/
       return Arrays.asList(new BlockPopulator[0]);
   }
 
开发者ID:tastybento,项目名称:acidisland,代码行数:9,代码来源:ChunkGeneratorWorld.java

示例10: get

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
public static BukkitAugmentedGenerator get(World world) {
    for (BlockPopulator populator : world.getPopulators()) {
        if (populator instanceof BukkitAugmentedGenerator) {
            return (BukkitAugmentedGenerator) populator;
        }
    }
    if (generator == null) {
        generator = new BukkitAugmentedGenerator();
    }
    world.getPopulators().add(generator);
    return generator;
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:13,代码来源:BukkitAugmentedGenerator.java

示例11: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@Override
public List<BlockPopulator> getDefaultPopulators(World world)
{
    if (layerDataValues != null)
    {
        return Arrays.asList((BlockPopulator) new CleanroomBlockPopulator(layerDataValues));
    }
    else
    {
        // This is the default, but just in case default populators change to stock minecraft populators by default...
        return new ArrayList<BlockPopulator>();
    }
}
 
开发者ID:Yoshi41023,项目名称:TatsuCraftMod,代码行数:14,代码来源:CleanroomChunkGenerator.java

示例12: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@Override
public List<BlockPopulator> getDefaultPopulators(World world) {
    List<BlockPopulator> populators = new ArrayList<>();
    populators.add(new OrePopulator(plugin));
    populators.add(new CavePopulator(plugin));
    return populators;
}
 
开发者ID:WaywardRealms,项目名称:Wayward,代码行数:8,代码来源:MiningGenerator.java

示例13: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@Override
public List<BlockPopulator> getDefaultPopulators(World world) {
	return Arrays.asList((BlockPopulator)
			new ChristmasTreePopulator(),
			new TreePopulator(),
			new CandyCanePopulator(),
			new WreathPopulator(),
			new SantaPopulator(),
			new SkySignPopulator(),
			new SnowmanPopulator(),
			new SleighPopulator(),
			new PresentPopulator());
}
 
开发者ID:EmilHernvall,项目名称:tregmine,代码行数:14,代码来源:ChristmasChunkGenerator.java

示例14: onWorldInit

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
@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));
    }
}
 
开发者ID:jaquadro,项目名称:OrePlus,代码行数:13,代码来源:OPListener.java

示例15: getDefaultPopulators

import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
public List<BlockPopulator> getDefaultPopulators(org.bukkit.World world) {
    ArrayList<BlockPopulator> populators = new ArrayList<BlockPopulator>();
    populators.add(new SBlockPopulator());

    try {
        if (options.giantCaves) {
            plugin.getLogger().info("Adding Giant Caves to world '" + world.getName() + "' with settings " + options.caveSettings);
            Config caveConfig = parseCaveConfig(options.caveSettings);
            populators.add(new GiantCavePopulator(plugin, caveConfig));
        }
    } catch (NoClassDefFoundError ex) {
        plugin.getLogger().severe("Failed to locate Giant Caves plugin.");
        plugin.getLogger().severe("Download from http://dev.bukkit.org/bukkit-plugins/giant-caves/");
    }

    if (options.undergroundBiomes) {
        plugin.getLogger().info("Adding underground biomes to world '" + world.getName() + "'");
        populators.add(new UndergroundBiomePopulator());
    } else {
        plugin.getLogger().info("Disabling underground biomes in world '" + world.getName() + "'");
    }

    if (options.silverfish) {
        plugin.getLogger().info("Adding silverfish colonies to world '" + world.getName() + "'");
        populators.add(new SilverfishPopulator());
    } else {
        plugin.getLogger().info("Disabling silverfish colonies in world '" + world.getName() + "'");
    }


    return populators;
}
 
开发者ID:rmichela,项目名称:Subterranea,代码行数:33,代码来源:SChunkGenerator.java


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