Improve a couple data update comments

This commit is contained in:
James Seibel
2023-08-31 21:42:57 -05:00
parent b894cc8836
commit c28ec12983
3 changed files with 7 additions and 4 deletions
@@ -281,13 +281,14 @@ public class ColumnRenderSource
}
}
/** @return true if any data was changed, false otherwise */
public boolean fastWrite(ChunkSizedFullDataAccessor chunkData, IDhClientLevel level)
{
try
{
if (FullDataToRenderDataTransformer.writeFullDataChunkToColumnData(this, level, chunkData))
{
localVersion.incrementAndGet();
this.localVersion.incrementAndGet();
return true;
}
else
@@ -159,6 +159,8 @@ public class FullDataToRenderDataTransformer
/**
* @throws InterruptedException Can be caused by interrupting the thread upstream.
* Generally thrown if the method is running after the client leaves the current world.
*
* @return true if any data was changed, false otherwise
*/
public static boolean writeFullDataChunkToColumnData(ColumnRenderSource renderSource, IDhClientLevel level, ChunkSizedFullDataAccessor chunkDataView) throws InterruptedException, IllegalArgumentException
{
@@ -147,14 +147,14 @@ public class RenderMetaDataFile extends AbstractMetaDataContainerFile implements
if (renderSourceLoadFuture == null) return;
renderSourceLoadFuture.thenAccept((renderSource) -> {
boolean worked = renderSource.fastWrite(chunkDataView, level);
boolean dataUpdated = renderSource.fastWrite(chunkDataView, level);
//if (pos.sectionDetailLevel == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL+5) {
float offset = new Random(System.nanoTime() ^ Thread.currentThread().getId()).nextFloat() * 16f;
Color c = worked ? Color.blue : Color.red;
Color debugColor = dataUpdated ? Color.blue : Color.red;
DebugRenderer.makeParticle(
new DebugRenderer.BoxParticle(
new DebugRenderer.Box(chunkDataView.getLodPos(), 32f, 64f + offset, 0.07f, c),
new DebugRenderer.Box(chunkDataView.getLodPos(), 32f, 64f + offset, 0.07f, debugColor),
2.0, 16f
)
);