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


Java SetupObject类代码示例

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


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

示例1: loadWorld

import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
public void loadWorld(final PlotId id) {
        TaskManager.IMP.sync(new RunnableVal<Object>() {
            @Override
            public void run(Object value) {
                String worldName = id.toCommaSeparatedString();
                if (WorldUtil.IMP.isWorld(worldName)) return;
                SetupObject setup = new SetupObject();
                setup.plotManager = "PlotSquared:single";
                setup.setupGenerator = "PlotSquared:single";
                setup.type = 0;
                setup.terrain = 0;
                setup.step = new ConfigurationNode[0];
                setup.world = worldName;
                SetupUtils.manager.setupWorld(setup);
            }
        });
//        String worldName = plot.getWorldName();
//        World world = Bukkit.getWorld(worldName);
//        if (world != null) {
//            return world;
//        }
//        WorldCreator wc = new WorldCreator(worldName);
//        wc.generator("PlotSquared:single");
//        wc.environment(World.Environment.NORMAL);
//        wc.type(WorldType.FLAT);
//        return AsyncWorld.create(wc);
    }
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:28,代码来源:SinglePlotArea.java

示例2: setGenerator

import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
@Override
public void setGenerator(String worldName) {
    World world = SpongeUtil.getWorld(worldName);
    if (world == null) {
        // create world
        ConfigurationSection worldConfig = PS.get().worlds.getConfigurationSection("worlds." + worldName);
        String manager = worldConfig.getString("generator.plugin", "PlotSquared");
        String generator = worldConfig.getString("generator.init", manager);

        int type = worldConfig.getInt("generator.type");
        int terrain = worldConfig.getInt("generator.terrain");
        SetupObject setup = new SetupObject();
        setup.plotManager = manager;
        setup.setupGenerator = generator;
        setup.type = type;
        setup.terrain = terrain;
        setup.step = new ConfigurationNode[0];
        setup.world = worldName;
        SetupUtils.manager.setupWorld(setup);
        world = SpongeUtil.getWorld(worldName);
    } else {
        throw new IllegalArgumentException("World already loaded: " + worldName + "???");
    }
    WorldGenerator wg = world.getWorldGenerator();
    GenerationPopulator gen = wg.getBaseGenerationPopulator();
    if (gen instanceof GeneratorWrapper) {
        PS.get().loadWorld(worldName, (GeneratorWrapper) gen);
    } else {
        throw new UnsupportedOperationException("NOT IMPLEMENTED YET2! " + worldName + " | " + gen);
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:32,代码来源:SpongeMain.java

示例3: NukkitPlotGenerator

import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
public NukkitPlotGenerator(Map<String, Object> map) {
    if (map == null) {
        throw new IllegalArgumentException("options may not be null!");
    }
    this.settings = map;
    MainUtil.initCache();
    this.world = map.get("world").toString();
    if (map.containsKey("generator")) {
        final Generator cg = (Generator) map.get("generator");
        if (cg instanceof NukkitPlotGenerator) {
            throw new IllegalArgumentException("Generator: " + cg.getClass().getName() + " is already a NukkitPlotGenerator!");
        }
        this.full = false;
        PS.debug("NukkitPlotGenerator does not fully support: " + cg);
        this.platformGenerator = cg;
        this.plotGenerator = new IndependentPlotGenerator() {
            @Override
            public void processSetup(SetupObject setup) {}

            @Override
            public void initialize(PlotArea area) {}

            @Override
            public PlotManager getNewPlotManager() {
                return PS.get().IMP.getDefaultGenerator().getNewPlotManager();
            }

            @Override
            public String getName() {
                return cg.getClass().getName();
            }

            @Override
            public PlotArea getNewPlotArea(String world, String id, PlotId min, PlotId max) {
                return PS.get().IMP.getDefaultGenerator().getNewPlotArea(world, id, min, max);
            }

            @Override
            public void generateChunk(final ScopedLocalBlockQueue result, PlotArea settings, PseudoRandom random) {
                Location min = result.getMin();
                int cx = min.getX() >> 4;
                int cz = min.getZ() >> 4;
                cg.generateChunk(cx, cz);
                cg.populateChunk(cx, cz);
            }
        };
        chunkSetter = new NukkitWrappedChunk(world, null);
        MainUtil.initCache();
    } else {
        this.plotGenerator = (IndependentPlotGenerator) map.get("plot-generator");
        this.platformGenerator = this;
        this.full = true;
        chunkSetter = new NukkitWrappedChunk(world, null);
    }
    PS.get().loadWorld(world, this);
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:57,代码来源:NukkitPlotGenerator.java

示例4: processSetup

import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
/**
 * If any additional setup options need to be changed before world creation.
 *  - e.g. If setup doesn't support some standard options
 * @param setup
 */
public void processSetup(SetupObject setup) {}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:7,代码来源:IndependentPlotGenerator.java

示例5: setupWorld

import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
public abstract String setupWorld(final SetupObject object); 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:2,代码来源:SetupUtils.java

示例6: processSetup

import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
public abstract void processSetup(SetupObject object); 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:2,代码来源:PlotGenerator.java


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