From 52b910bb6edfc6756ee390bbebf8325f99e23f44 Mon Sep 17 00:00:00 2001 From: StewStrong Date: Wed, 25 Oct 2023 18:37:55 -0600 Subject: [PATCH] Revert "Don't create render chunks for air sections" This reverts commit babd2876bd736efd060eaa4f8a7c48f219b1edb4. --- .../vanilla_renderer/MixinLevelRendererVanilla.java | 8 -------- .../mod_compat/vanilla_renderer/MixinViewAreaVanilla.java | 3 --- 2 files changed, 11 deletions(-) diff --git a/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinLevelRendererVanilla.java b/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinLevelRendererVanilla.java index 20b33b254..6c9cf355c 100644 --- a/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinLevelRendererVanilla.java +++ b/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinLevelRendererVanilla.java @@ -27,8 +27,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Vec3i; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.LevelChunkSection; import org.jetbrains.annotations.Nullable; import org.joml.Vector3dc; import org.spongepowered.asm.mixin.Final; @@ -124,13 +122,7 @@ private void addShipVisibleChunks( } shipObject.getActiveChunksSet().forEach((x, z) -> { - final ChunkAccess chunk = level.getChunk(x, z); for (int y = level.getMinSection(); y < level.getMaxSection(); y++) { - final LevelChunkSection levelChunkSection = chunk.getSection(y - level.getMinSection()); - if (levelChunkSection.hasOnlyAir()) { - // Skip air sections - continue; - } tempPos.set(x << 4, y << 4, z << 4); final ChunkRenderDispatcher.RenderChunk renderChunk = chunkStorageAccessor.callGetRenderChunkAt(tempPos); diff --git a/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinViewAreaVanilla.java b/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinViewAreaVanilla.java index 104e4db9f..0d18a2c02 100644 --- a/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinViewAreaVanilla.java +++ b/common/src/main/java/org/valkyrienskies/mod/mixin/mod_compat/vanilla_renderer/MixinViewAreaVanilla.java @@ -14,7 +14,6 @@ import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -36,11 +35,9 @@ public class MixinViewAreaVanilla implements IVSViewAreaMethods { protected int chunkGridSizeY; // Maps chunk position to an array of BuiltChunk, indexed by the y value. - @Unique private final Long2ObjectMap vs$shipRenderChunks = new Long2ObjectOpenHashMap<>(); // This creates render chunks - @Unique private ChunkRenderDispatcher vs$chunkBuilder; /**