本文整理汇总了Java中cn.nukkit.level.format.generic.BaseFullChunk.clone方法的典型用法代码示例。如果您正苦于以下问题:Java BaseFullChunk.clone方法的具体用法?Java BaseFullChunk.clone怎么用?Java BaseFullChunk.clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.nukkit.level.format.generic.BaseFullChunk
的用法示例。
在下文中一共展示了BaseFullChunk.clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRun
import cn.nukkit.level.format.generic.BaseFullChunk; //导入方法依赖的package包/类
@Override
public void onRun() {
BaseFullChunk chunk = this.chunk.clone();
if (chunk == null) {
return;
}
chunk.recalculateHeightMap();
chunk.populateSkyLight();
chunk.setLightPopulated();
this.chunk = chunk.clone();
}
示例2: onCompletion
import cn.nukkit.level.format.generic.BaseFullChunk; //导入方法依赖的package包/类
@Override
public void onCompletion(Server server) {
Level level = server.getLevel(this.levelId);
if (level != null) {
if (!this.state) {
level.registerGenerator();
return;
}
BaseFullChunk chunk = this.chunk.clone();
if (chunk == null) {
return;
}
for (int i = 0; i < 9; i++) {
if (i == 4) {
continue;
}
BaseFullChunk c = this.chunks[i];
if (c != null) {
c = c.clone();
level.generateChunkCallback(c.getX(), c.getZ(), c);
}
}
level.generateChunkCallback(chunk.getX(), chunk.getZ(), chunk);
}
}
示例3: onRun
import cn.nukkit.level.format.generic.BaseFullChunk; //导入方法依赖的package包/类
@Override
public void onRun() {
Generator generator = GeneratorPool.get(this.levelId);
if (generator == null) {
this.state = false;
return;
}
SimpleChunkManager manager = (SimpleChunkManager) generator.getChunkManager();
if (manager == null) {
this.state = false;
return;
}
synchronized (manager) {
BaseFullChunk chunk = this.chunk.clone();
if (chunk == null) {
return;
}
manager.setChunk(chunk.getX(), chunk.getZ(), chunk);
generator.generateChunk(chunk.getX(), chunk.getZ());
chunk = manager.getChunk(chunk.getX(), chunk.getZ());
chunk.setGenerated();
this.chunk = chunk.clone();
manager.setChunk(chunk.getX(), chunk.getZ(), null);
}
}