當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。