本文整理汇总了Java中com.intellectualcrafters.plot.util.SchematicHandler类的典型用法代码示例。如果您正苦于以下问题:Java SchematicHandler类的具体用法?Java SchematicHandler怎么用?Java SchematicHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SchematicHandler类属于com.intellectualcrafters.plot.util包,在下文中一共展示了SchematicHandler类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupSchematicHandler
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
private void setupSchematicHandler() {
try {
SchematicHandler.manager = new FaweSchematicHandler();
Fawe.debug(" - SchematicHandler: " + SchematicHandler.manager);
} catch (Throwable e) {
Fawe.debug("Please update PlotSquared: http://ci.athion.net/job/PlotSquared/");
}
}
示例2: setupRoadSchematic
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
public boolean setupRoadSchematic(final Plot plot) {
final String world = plot.world;
final Location bot = MainUtil.getPlotBottomLoc(world, plot.id);
final Location top = MainUtil.getPlotTopLoc(world, plot.id);
final HybridPlotWorld plotworld = (HybridPlotWorld) PlotSquared.getPlotWorld(world);
final int sx = (bot.getX() - plotworld.ROAD_WIDTH) + 1;
final int sz = bot.getZ() + 1;
final int sy = plotworld.ROAD_HEIGHT;
final int ex = bot.getX();
final int ez = top.getZ();
final int ey = get_ey(world, sx, ex, sz, ez, sy);
final Location pos1 = new Location(world, sx, sy, sz);
final Location pos2 = new Location(world, ex, ey, ez);
final int bx = sx;
final int bz = sz - plotworld.ROAD_WIDTH;
final int by = sy;
final int tx = ex;
final int tz = sz - 1;
final int ty = get_ey(world, bx, tx, bz, tz, by);
final Location pos3 = new Location(world, bx, by, bz);
final Location pos4 = new Location(world, tx, ty, tz);
final CompoundTag sideroad = SchematicHandler.manager.getCompoundTag(world, pos1, pos2);
final CompoundTag intersection = SchematicHandler.manager.getCompoundTag(world, pos3, pos4);
final String dir = PlotSquared.IMP.getDirectory() + File.separator + "schematics" + File.separator + "GEN_ROAD_SCHEMATIC" + File.separator + plot.world + File.separator;
SchematicHandler.manager.save(sideroad, dir + "sideroad.schematic");
SchematicHandler.manager.save(intersection, dir + "intersection.schematic");
plotworld.ROAD_SCHEMATIC_ENABLED = true;
plotworld.setupSchematics();
return true;
}
示例3: claimPlot
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
public static boolean claimPlot(final PlotPlayer player, final Plot plot, final boolean teleport, final String schematic, final boolean auto) {
if (plot.hasOwner() || plot.settings.isMerged()) {
return false;
}
final boolean result = EventUtil.manager.callClaim(player, plot, false);
if (result) {
MainUtil.createPlot(player.getUUID(), plot);
MainUtil.setSign(player.getName(), plot);
MainUtil.sendMessage(player, C.CLAIMED);
final Location loc = player.getLocation();
if (teleport) {
MainUtil.teleportPlayer(player, loc, plot);
}
final String world = plot.world;
final PlotWorld plotworld = PlotSquared.getPlotWorld(world);
final Plot plot2 = PlotSquared.getPlots(world).get(plot.id);
if (plotworld.SCHEMATIC_ON_CLAIM) {
Schematic sch;
if (schematic.equals("")) {
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
} else {
sch = SchematicHandler.manager.getSchematic(schematic);
if (sch == null) {
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
}
}
SchematicHandler.manager.paste(sch, plot2, 0, 0);
}
PlotSquared.getPlotManager(world).claimPlot(plotworld, plot);
}
return result;
}
示例4: claim
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
public boolean claim(final PlotPlayer player, boolean teleport, String schematic, boolean updateDB) {
boolean result = EventUtil.manager.callClaim(player, this, false);
if (updateDB) {
if (!result || (!create(player.getUUID(), true))) {
return false;
}
} else {
area.addPlot(this);
}
setSign(player.getName());
MainUtil.sendMessage(player, C.CLAIMED);
if (teleport) {
teleportPlayer(player);
}
PlotArea plotworld = getArea();
if (plotworld.SCHEMATIC_ON_CLAIM) {
SchematicHandler.Schematic sch;
if (schematic == null || schematic.isEmpty()) {
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
} else {
sch = SchematicHandler.manager.getSchematic(schematic);
if (sch == null) {
sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);
}
}
SchematicHandler.manager.paste(sch, this, 0, 0, 0, true, new RunnableVal<Boolean>() {
@Override
public void run(Boolean value) {
if (value) {
MainUtil.sendMessage(player, C.SCHEMATIC_PASTE_SUCCESS);
} else {
MainUtil.sendMessage(player, C.SCHEMATIC_PASTE_FAILED);
}
}
});
}
plotworld.getPlotManager().claimPlot(plotworld, this);
return true;
}
示例5: export
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
/**
* Export the plot as a schematic to the configured output directory.
* @return
*/
public void export(final RunnableVal<Boolean> whenDone) {
SchematicHandler.manager.getCompoundTag(this, new RunnableVal<CompoundTag>() {
@Override
public void run(final CompoundTag value) {
if (value == null) {
if (whenDone != null) {
whenDone.value = false;
TaskManager.runTask(whenDone);
}
} else {
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
String name = Plot.this.id + "," + Plot.this.area + ',' + MainUtil.getName(Plot.this.owner);
boolean result =
SchematicHandler.manager.save(value, Settings.Paths.SCHEMATICS + File.separator + name + ".schematic");
if (whenDone != null) {
whenDone.value = result;
TaskManager.runTask(whenDone);
}
}
});
}
}
});
}
示例6: upload
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
/**
* Upload the plot as a schematic to the configured web interface.
* @param whenDone value will be null if uploading fails
*/
public void upload(final RunnableVal<URL> whenDone) {
SchematicHandler.manager.getCompoundTag(this, new RunnableVal<CompoundTag>() {
@Override
public void run(CompoundTag value) {
SchematicHandler.manager.upload(value, null, null, whenDone);
}
});
}
示例7: init
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
public void init() {
if (this.engine != null) {
return;
}
this.engine = new ScriptEngineManager(null).getEngineByName("nashorn");
if (this.engine == null) {
this.engine = new ScriptEngineManager(null).getEngineByName("JavaScript");
}
ScriptContext context = new SimpleScriptContext();
this.scope = context.getBindings(ScriptContext.ENGINE_SCOPE);
// stuff
this.scope.put("MainUtil", new MainUtil());
this.scope.put("Settings", new Settings());
this.scope.put("StringMan", new StringMan());
this.scope.put("MathMan", new MathMan());
this.scope.put("FlagManager", new FlagManager());
// Classes
this.scope.put("Location", Location.class);
this.scope.put("PlotBlock", PlotBlock.class);
this.scope.put("Plot", Plot.class);
this.scope.put("PlotId", PlotId.class);
this.scope.put("Runnable", Runnable.class);
this.scope.put("RunnableVal", RunnableVal.class);
// Instances
this.scope.put("PS", PS.get());
this.scope.put("GlobalBlockQueue", GlobalBlockQueue.IMP);
this.scope.put("ExpireManager", ExpireManager.IMP);
if (PS.get().worldedit != null) {
this.scope.put("WEManager", new WEManager());
}
this.scope.put("TaskManager", TaskManager.IMP);
this.scope.put("TitleManager", AbstractTitle.TITLE_CLASS);
this.scope.put("ConsolePlayer", ConsolePlayer.getConsole());
this.scope.put("SchematicHandler", SchematicHandler.manager);
this.scope.put("ChunkManager", ChunkManager.manager);
this.scope.put("BlockManager", WorldUtil.IMP);
this.scope.put("SetupUtils", SetupUtils.manager);
this.scope.put("EventUtil", EventUtil.manager);
this.scope.put("EconHandler", EconHandler.manager);
this.scope.put("UUIDHandler", UUIDHandler.implementation);
this.scope.put("DBFunc", DBFunc.dbManager);
this.scope.put("HybridUtils", HybridUtils.manager);
this.scope.put("IMP", PS.get().IMP);
this.scope.put("MainCommand", MainCommand.getInstance());
// enums
for (Enum<?> value : C.values()) {
this.scope.put("C_" + value.name(), value);
}
}
示例8: setTile
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
public boolean setTile(int x, int y, int z, CompoundTag tag) {
SchematicHandler.manager.restoreTile(this, tag, x, y, z);
return true;
}
示例9: initSchematicHandler
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
@Override
public SchematicHandler initSchematicHandler() {
return new SpongeSchematicHandler();
}
示例10: getSchematicHandler
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
/**
* SchematicHandler class contains methods related to pasting, reading and writing schematics
*
* @return SchematicHandler
*
* @see com.intellectualcrafters.plot.util.SchematicHandler
*/
public SchematicHandler getSchematicHandler() {
return SchematicHandler.manager;
}
示例11: getSchematicHandler
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
/**
* SchematicHandler class contains methods related to pasting, reading
* and writing schematics.
*
* @return SchematicHandler
*
* @see SchematicHandler
*/
public SchematicHandler getSchematicHandler() {
return SchematicHandler.manager;
}
示例12: initSchematicHandler
import com.intellectualcrafters.plot.util.SchematicHandler; //导入依赖的package包/类
/**
* Get the schematic handler.
* @return The {@link SchematicHandler}
*/
SchematicHandler initSchematicHandler();