本文整理汇总了Java中net.minecraft.world.chunk.Chunk.setModified方法的典型用法代码示例。如果您正苦于以下问题:Java Chunk.setModified方法的具体用法?Java Chunk.setModified怎么用?Java Chunk.setModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.Chunk
的用法示例。
在下文中一共展示了Chunk.setModified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changeBiomeArea
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public void changeBiomeArea(World world, BlockPos thisPosition)
{
if(world == null) { return; }
if(targetBiome == null) { return; }
if(world.provider.getDimension() != worldId) { return; } //Do nothing unless this is the specified world.
for(byte nX = -5; nX <= 5; nX++)
{
for(byte nZ = -5; nZ <= 5; nZ++)
{
Chunk c = world.getChunkFromBlockCoords(new BlockPos(thisPosition.getX() + nX*16, 0, thisPosition.getZ() + nZ*16));
this.currentArray = c.getBiomeArray();
for(int n = 0; n < this.currentArray.length; n++)
{
this.currentArray[n] = (byte) Biome.getIdForBiome(targetBiome);
}
c.setBiomeArray(this.currentArray);
c.setModified(true);
}
}
PacketHandler.INSTANCE.sendToDimension(new MessageBiomeChange((byte) Biome.getIdForBiome(targetBiome), this.getPos()), world.provider.getDimension());
}
示例2: processMessage
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
private void processMessage(MessageBiomeChange message, MessageContext ctx, WorldClient world)
{
Biome targetBiome = Biome.getBiomeForId(message.biomeID);
if(targetBiome == null)
return;
byte[] currentArray;
for(byte nX = -5; nX <= 5; nX++)
{
for(byte nZ = -5; nZ <= 5; nZ++)
{
Chunk c = world.getChunkFromBlockCoords(new BlockPos(message.changeCenter.getX() + nX*16, 0, message.changeCenter.getZ() + nZ*16));
currentArray = c.getBiomeArray();
for(int n = 0; n < currentArray.length; n++)
{
currentArray[n] = (byte) Biome.getIdForBiome(targetBiome);
}
c.setBiomeArray(currentArray);
c.setModified(true);
}
}
}
示例3: saveChunks
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
/**
* Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks.
* Return true if all chunks have been saved.
*/
public boolean saveChunks(boolean p_73151_1_, IProgressUpdate progressCallback)
{
int i = 0;
List<Chunk> list = Lists.newArrayList(this.loadedChunks);
for (int j = 0; j < ((List)list).size(); ++j)
{
Chunk chunk = (Chunk)list.get(j);
if (p_73151_1_)
{
this.saveChunkExtraData(chunk);
}
if (chunk.needsSaving(p_73151_1_))
{
this.saveChunkData(chunk);
chunk.setModified(false);
++i;
if (i == 24 && !p_73151_1_)
{
return false;
}
}
}
return true;
}
示例4: saveChunks
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public boolean saveChunks(boolean p_186027_1_)
{
int i = 0;
List<Chunk> list = Lists.newArrayList(this.id2ChunkMap.values());
for (int j = 0; j < ((List)list).size(); ++j)
{
Chunk chunk = (Chunk)list.get(j);
if (p_186027_1_)
{
this.saveChunkExtraData(chunk);
}
if (chunk.needsSaving(p_186027_1_))
{
this.saveChunkData(chunk);
chunk.setModified(false);
++i;
if (i == 24 && !p_186027_1_)
{
return false;
}
}
}
return true;
}