Fix carver crash #490

This commit is contained in:
Sollace 2024-10-12 21:44:46 +01:00
parent fd65e7db17
commit a43f5d2022
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -167,7 +167,10 @@ public class CloudCarver extends CaveCarver {
MutableBoolean replacedGrassy MutableBoolean replacedGrassy
) { ) {
if (super.carveAtPoint(context, config, chunk, posToBiome, mask, pos, tmp, aquiferSampler, replacedGrassy)) { if (super.carveAtPoint(context, config, chunk, posToBiome, mask, pos, tmp, aquiferSampler, replacedGrassy)) {
topWrittenPositions.remove(tmp.set(pos).move(Direction.DOWN).asLong()); tmp.set(pos).move(Direction.DOWN);
if (!topWrittenPositions.isEmpty()) {
topWrittenPositions.remove(tmp.asLong());
}
topWrittenPositions.add(pos.asLong()); topWrittenPositions.add(pos.asLong());
if (chunk.getBlockState(tmp).isOf(UBlocks.SOGGY_CLOUD)) { if (chunk.getBlockState(tmp).isOf(UBlocks.SOGGY_CLOUD)) {
chunk.setBlockState(tmp, UBlocks.CLOUD.getDefaultState(), false); chunk.setBlockState(tmp, UBlocks.CLOUD.getDefaultState(), false);