本文整理汇总了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;
}
示例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);
}
示例3: getBp
import org.bukkit.generator.BlockPopulator; //导入依赖的package包/类
/**
* @return the bp
*/
public BlockPopulator getBp() {
if (beaconPopulator == null) {
beaconPopulator = new BeaconPopulator(this);
}
return beaconPopulator;
}
示例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();
}
}
}
}
示例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>();
}
示例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);
}
示例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;
}
示例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;
}
示例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]);
}
示例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;
}
示例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>();
}
}
示例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;
}
示例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());
}
示例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));
}
}
示例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;
}