本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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) {}
示例5: setupWorld
import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
public abstract String setupWorld(final SetupObject object);
示例6: processSetup
import com.intellectualcrafters.plot.object.SetupObject; //导入依赖的package包/类
public abstract void processSetup(SetupObject object);