Fix world gen incorrectly returning some data sources to the pool

This commit is contained in:
James Seibel
2024-10-08 20:17:11 -05:00
parent 3b5208d774
commit bec3b5b576
@@ -417,19 +417,7 @@ public class GeneratedFullDataSourceProvider extends FullDataSourceProviderV2 im
// allows us to reduce cross-chunk lighting issues by lighting the whole 4x4 LOD at once
DhLightingEngine.INSTANCE.bakeDataSourceSkyLight(fullDataSource, LodUtil.MAX_MC_LIGHT);
GeneratedFullDataSourceProvider.this.updateDataSourceAsync(fullDataSource)
.thenRun(() ->
{
try
{
// send this datasource back to the pool to hopefully reduce GC overhead
fullDataSource.close();
}
catch (Exception e)
{
LOGGER.error("Unexpected issue closing full data source", e);
}
});
GeneratedFullDataSourceProvider.this.updateDataSourceAsync(fullDataSource);
}