本文整理汇总了Java中com.intellectualcrafters.plot.object.RunnableVal.run方法的典型用法代码示例。如果您正苦于以下问题:Java RunnableVal.run方法的具体用法?Java RunnableVal.run怎么用?Java RunnableVal.run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellectualcrafters.plot.object.RunnableVal
的用法示例。
在下文中一共展示了RunnableVal.run方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setChunkInPlotArea
import com.intellectualcrafters.plot.object.RunnableVal; //导入方法依赖的package包/类
public static void setChunkInPlotArea(RunnableVal<ScopedLocalBlockQueue> force, RunnableVal<ScopedLocalBlockQueue> add, String world, ChunkLoc loc) {
LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(world, false);
if (PS.get().isAugmented(world)) {
int bx = loc.x << 4;
int bz = loc.z << 4;
ScopedLocalBlockQueue scoped = new ScopedLocalBlockQueue(queue, new Location(world, bx, 0, bz), new Location(world, bx + 15, 255, bz + 15));
if (force != null) {
force.run(scoped);
} else {
scoped.regenChunk(loc.x, loc.z);
if (add != null) {
add.run(scoped);
}
}
queue.flush();
} else {
CURRENT_FORCE_CHUNK = force;
CURRENT_ADD_CHUNK = add;
queue.regenChunk(loc.x, loc.z);
CURRENT_FORCE_CHUNK = null;
CURRENT_ADD_CHUNK = null;
}
}
示例2: autoClaimFromDatabase
import com.intellectualcrafters.plot.object.RunnableVal; //导入方法依赖的package包/类
public static void autoClaimFromDatabase(final PlotPlayer player, final PlotArea area, PlotId start, final RunnableVal<Plot> whenDone) {
final Plot plot = area.getNextFreePlot(player, start);
if (plot == null) {
whenDone.run(null);
return;
}
whenDone.value = plot;
plot.owner = player.getUUID();
DBFunc.createPlotSafe(plot, whenDone, new Runnable() {
@Override
public void run() {
autoClaimFromDatabase(player, area, plot.getId(), whenDone);
}
});
}
示例3: foreachPlotArea
import com.intellectualcrafters.plot.object.RunnableVal; //导入方法依赖的package包/类
public void foreachPlotArea(String world, RunnableVal<PlotArea> runnable) {
PlotArea[] array = this.manager.getPlotAreas(world, null);
if (array == null) {
return;
}
for (PlotArea area : array) {
runnable.run(area);
}
}
示例4: foreachPlot
import com.intellectualcrafters.plot.object.RunnableVal; //导入方法依赖的package包/类
public void foreachPlot(RunnableVal<Plot> runnable) {
for (PlotArea area : this.manager.getAllPlotAreas()) {
for (Plot plot : area.getPlots()) {
runnable.run(plot);
}
}
}
示例5: foreachPlotRaw
import com.intellectualcrafters.plot.object.RunnableVal; //导入方法依赖的package包/类
public void foreachPlotRaw(RunnableVal<Plot> runnable) {
for (PlotArea area : this.manager.getAllPlotAreas()) {
for (Plot plot : area.getPlots()) {
runnable.run(plot);
}
}
if (this.plots_tmp != null) {
for (HashMap<PlotId, Plot> entry : this.plots_tmp.values()) {
for (Plot entry2 : entry.values()) {
runnable.run(entry2);
}
}
}
}
示例6: getPersistentMeta
import com.intellectualcrafters.plot.object.RunnableVal; //导入方法依赖的package包/类
public static void getPersistentMeta(UUID uuid, final String key, final RunnableVal<byte[]> result) {
PlotPlayer player = UUIDHandler.getPlayer(uuid);
if (player != null) {
result.run(player.getPersistentMeta(key));
} else {
DBFunc.getPersistentMeta(uuid, new RunnableVal<Map<String, byte[]>>() {
@Override
public void run(Map<String, byte[]> value) {
result.run(value.get(key));
}
});
}
}