本文整理了Java中net.minecraft.world.chunk.Chunk.markDirty()
方法的一些代码示例,展示了Chunk.markDirty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Chunk.markDirty()
方法的具体详情如下:
包路径:net.minecraft.world.chunk.Chunk
类名称:Chunk
方法名:markDirty
暂无
代码示例来源:origin: TheCBProject/EnderStorage
public void invert() {
invert_redstone = !invert_redstone;
world.getChunkFromChunkCoords(pos.getX(), pos.getZ()).markDirty();
}
}
代码示例来源:origin: Darkhax-Minecraft/Bookshelf
/**
* Marks a chunk for an update. This will set it dirty, and potentially do a render update.
*
* @param world The world to update chunks in.
* @param chunk The chunk to update.
* @param render Whether or not you want a render update.
*/
public static void markChunkForUpdate (World world, Chunk chunk, boolean render) {
chunk.markDirty();
if (render) {
final BlockPos initial = chunk.getPos().getBlock(1, 1, 1);
world.markBlockRangeForRenderUpdate(initial, initial);
}
}
代码示例来源:origin: RS485/LogisticsPipes
public void markChunkModified(TileEntity tile) {
if (tile != null && chunk != null) {
// items are crossing a chunk boundary, mark both chunks modified
if (container.getPos().getX() >> 4 != tile.getPos().getX() >> 4 || container.getPos().getZ() >> 4 != tile.getPos().getZ() >> 4) {
chunk.markDirty();
if (tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe) tile).pipe != null && ((LogisticsTileGenericPipe) tile).pipe.transport != null && ((LogisticsTileGenericPipe) tile).pipe.transport.chunk != null) {
((LogisticsTileGenericPipe) tile).pipe.transport.chunk.markDirty();
} else {
getWorld().getChunkFromBlockCoords(tile.getPos()).markDirty();
}
}
}
}
代码示例来源:origin: ForestryMC/ForestryMC
public void retroGen(Random random, int chunkX, int chunkZ, World world) {
generateWorld(random, chunkX, chunkZ, world);
ModuleManager.getInternalHandler().populateChunkRetroGen(world, random, chunkX, chunkZ);
world.getChunk(chunkX, chunkZ).markDirty();
}
代码示例来源:origin: ldtteam/minecolonies
/**
* Add a chunk storage to a chunk.
* @param chunk the chunk to add it to.
* @param storage the said storage.
*/
public static void addStorageToChunk(final Chunk chunk, final ChunkLoadStorage storage)
{
final IColonyTagCapability cap = chunk.getCapability(CLOSE_COLONY_CAP, null);
storage.applyToCap(cap);
chunk.markDirty();
if (cap != null)
{
MineColonies.getNetwork().sendToAll(new UpdateChunkCapabilityMessage(cap, chunk.x, chunk.z));
}
}
代码示例来源:origin: Darkhax-Minecraft/Bookshelf
/**
* Attempts to set the biome of an entire chunk. Please note that this will also cause
* conecting chunks to do an update, and will cause the targeted chunk to recieve a render
* update.
*
* @param world The world to set the biome in.
* @param pos The block position to target. This will target the chunk the psotion is in.
* @param biome The biome to set the chunk to.
*/
public static void setBiomes (World world, BlockPos pos, Biome biome) {
try {
final Chunk chunk = world.getChunk(pos);
final byte[] biomes = chunk.getBiomeArray();
Arrays.fill(biomes, (byte) Biome.getIdForBiome(biome));
chunk.markDirty();
updateNearbyChunks(world, chunk, true, true);
}
catch (final Exception e) {
Constants.LOG.warn(e, "Unable to set biome for Pos: {}, Biome: {}", pos.toString(), biome.getRegistryName());
}
}
代码示例来源:origin: ForestryMC/ForestryMC
chunkToSave.markDirty();
代码示例来源:origin: McJtyMods/DeepResonance
world.getChunkFromChunkCoords(chunkX, chunkZ).markDirty();
代码示例来源:origin: ldtteam/minecolonies
chunk.markDirty();
MineColonies.getNetwork().sendToAll(new UpdateChunkCapabilityMessage(cap, chunk.x, chunk.z));
return true;
代码示例来源:origin: superckl/BiomeTweaker
chunk.markDirty();
count++;
final Chunk chunk = world.getChunkFromChunkCoords(x, z);
chunk.setBiomeArray(Arrays.copyOf(biomeArray, biomeArray.length));
chunk.markDirty();
count++;
内容来源于网络,如有侵权,请联系作者删除!