本文整理汇总了Java中com.intellectualcrafters.plot.generator.HybridPlotManager类的典型用法代码示例。如果您正苦于以下问题:Java HybridPlotManager类的具体用法?Java HybridPlotManager怎么用?Java HybridPlotManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HybridPlotManager类属于com.intellectualcrafters.plot.generator包,在下文中一共展示了HybridPlotManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBlockQueue
import com.intellectualcrafters.plot.generator.HybridPlotManager; //导入依赖的package包/类
private void setupBlockQueue() {
try {
// If it's going to fail, throw an error now rather than later
QueueProvider provider = QueueProvider.of(FaweLocalBlockQueue.class, null);
GlobalBlockQueue.IMP.setProvider(provider);
HybridPlotManager.REGENERATIVE_CLEAR = false;
Fawe.debug(" - QueueProvider: " + FaweLocalBlockQueue.class);
Fawe.debug(" - HybridPlotManager.REGENERATIVE_CLEAR: " + HybridPlotManager.REGENERATIVE_CLEAR);
} catch (Throwable e) {
Fawe.debug("Please update PlotSquared: http://ci.athion.net/job/PlotSquared/");
}
}
示例2: execute
import com.intellectualcrafters.plot.generator.HybridPlotManager; //导入依赖的package包/类
@Override
public boolean execute(final PlotPlayer player, final String... args) {
if (player != null) {
sendMessage(player, C.NOT_CONSOLE);
return false;
}
if (args.length < 1) {
sendMessage(player, C.NEED_PLOT_WORLD);
return false;
}
int height = 0;
if (args.length == 2) {
try {
height = Integer.parseInt(args[1]);
}
catch (NumberFormatException e) {
sendMessage(player, C.NOT_VALID_NUMBER, "(0, 256)");
sendMessage(player, C.COMMAND_SYNTAX, "/plot regenallroads <世界名称> [高度]");
return false;
}
}
final String name = args[0];
final PlotManager manager = PlotSquared.getPlotManager(name);
if ((manager == null) || !(manager instanceof HybridPlotManager)) {
sendMessage(player, C.NOT_VALID_PLOT_WORLD);
return false;
}
final List<ChunkLoc> chunks = ChunkManager.manager.getChunkChunks(name);
PlotSquared.log("&c如果没有设置建筑文件, 将不会有任何事情发生");
PlotSquared.log("&7 - 设置一个建筑文件, 站在地皮上输入 &c/plot createroadschematic");
PlotSquared.log("&6所有区块更新: &7" + (chunks.size() * 1024));
PlotSquared.log("&6预估时间: &7" + (chunks.size()) + " 秒");
final boolean result = HybridUtils.manager.scheduleRoadUpdate(name, height);
if (!result) {
PlotSquared.log("&c无法计划地图文件更新! (是否有进程未完成?)");
return false;
}
return true;
}
示例3: onCommand
import com.intellectualcrafters.plot.generator.HybridPlotManager; //导入依赖的package包/类
@Override
public boolean onCommand(PlotPlayer player, String[] args) {
int height = 0;
if (args.length == 2) {
try {
height = Integer.parseInt(args[1]);
} catch (NumberFormatException ignored) {
MainUtil.sendMessage(player, C.NOT_VALID_NUMBER, "(0, 256)");
MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot regenallroads <world> [height]");
return false;
}
} else if (args.length != 1) {
MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot regenallroads <world> [height]");
return false;
}
PlotArea area = PS.get().getPlotAreaByString(args[0]);
if (area == null) {
C.NOT_VALID_PLOT_WORLD.send(player, args[0]);
return false;
}
String name = args[0];
PlotManager manager = area.getPlotManager();
if (!(manager instanceof HybridPlotManager)) {
MainUtil.sendMessage(player, C.NOT_VALID_PLOT_WORLD);
return false;
}
Set<ChunkLoc> chunks = ChunkManager.manager.getChunkChunks(name);
MainUtil.sendMessage(player, "&cIf no schematic is set, the following will not do anything");
MainUtil.sendMessage(player, "&7 - To set a schematic, stand in a plot and use &c/plot createroadschematic");
MainUtil.sendMessage(player, "&6Potential chunks to update: &7" + (chunks.size() * 1024));
MainUtil.sendMessage(player, "&6Estimated time: &7" + chunks.size() + " seconds");
boolean result = HybridUtils.manager.scheduleRoadUpdate(area, height);
if (!result) {
MainUtil.sendMessage(player, "&cCannot schedule mass schematic update! (Is one already in progress?)");
return false;
}
return true;
}