diff --git a/src/main/java/me/cortex/voxy/client/core/VoxelCore.java b/src/main/java/me/cortex/voxy/client/core/VoxelCore.java index a161088c..0bfd9040 100644 --- a/src/main/java/me/cortex/voxy/client/core/VoxelCore.java +++ b/src/main/java/me/cortex/voxy/client/core/VoxelCore.java @@ -10,7 +10,7 @@ import me.cortex.voxy.client.core.util.IrisUtil; import me.cortex.voxy.client.saver.ContextSelectionSystem; import me.cortex.voxy.common.world.WorldEngine; import me.cortex.voxy.client.importers.WorldImporter; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; +import me.cortex.voxy.common.thread.ServiceThreadPool; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.hud.ClientBossBar; import net.minecraft.client.render.Camera; @@ -27,7 +27,6 @@ import org.lwjgl.opengl.GL11; import java.io.File; import java.util.*; -import static org.lwjgl.opengl.ARBDirectStateAccess.glGetNamedFramebufferAttachmentParameteri; import static org.lwjgl.opengl.GL30C.*; //Core class that ingests new data from sources and updates the required systems diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java b/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java index 04885b28..0d0132e6 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java @@ -1,6 +1,5 @@ package me.cortex.voxy.client.core.rendering; -import me.cortex.voxy.client.config.VoxyConfig; import me.cortex.voxy.client.core.model.ModelBakerySubsystem; import me.cortex.voxy.client.core.model.ModelStore; import me.cortex.voxy.client.core.rendering.building.BuiltSection; @@ -14,8 +13,7 @@ import me.cortex.voxy.client.core.rendering.section.MDICSectionRenderer; import me.cortex.voxy.client.core.rendering.util.DownloadStream; import me.cortex.voxy.client.core.rendering.util.UploadStream; import me.cortex.voxy.common.world.WorldEngine; -import me.cortex.voxy.common.world.WorldSection; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; +import me.cortex.voxy.common.thread.ServiceThreadPool; import net.minecraft.client.render.Camera; import java.util.Arrays; diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderGenerationService.java b/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderGenerationService.java index af56205b..a9776135 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderGenerationService.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/building/RenderGenerationService.java @@ -7,13 +7,10 @@ import me.cortex.voxy.client.core.model.ModelBakerySubsystem; import me.cortex.voxy.common.world.WorldEngine; import me.cortex.voxy.common.world.WorldSection; import me.cortex.voxy.common.world.other.Mapper; -import me.cortex.voxy.common.world.thread.ServiceSlice; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; -import net.minecraft.client.MinecraftClient; -import net.minecraft.text.Text; +import me.cortex.voxy.common.thread.ServiceSlice; +import me.cortex.voxy.common.thread.ServiceThreadPool; import java.util.List; -import java.util.concurrent.Semaphore; import java.util.function.Consumer; import java.util.function.Supplier; diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical2/HierarchicalNodeManager.java b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical2/HierarchicalNodeManager.java index 1208834a..8257f415 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical2/HierarchicalNodeManager.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical2/HierarchicalNodeManager.java @@ -102,14 +102,11 @@ public class HierarchicalNodeManager { } public void processBuildResult(BuiltSection section) { - section.free(); - /* if (!section.isEmpty()) { this.geometryManager.uploadSection(section); } else { section.free(); } - */ int nodeId = this.activeSectionMap.get(section.position); if (nodeId == -1) { diff --git a/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java b/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java index 13f4ee37..be3ae7e9 100644 --- a/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/client/importers/WorldImporter.java @@ -5,9 +5,8 @@ import me.cortex.voxy.client.core.util.ByteBufferBackedInputStream; import me.cortex.voxy.common.voxelization.VoxelizedSection; import me.cortex.voxy.common.voxelization.WorldConversionFactory; import me.cortex.voxy.common.world.WorldEngine; -import me.cortex.voxy.common.world.other.Mipper; -import me.cortex.voxy.common.world.thread.ServiceSlice; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; +import me.cortex.voxy.common.thread.ServiceSlice; +import me.cortex.voxy.common.thread.ServiceThreadPool; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -30,13 +29,9 @@ import java.nio.ByteOrder; import java.nio.channels.FileChannel; import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import java.util.Objects; import java.util.concurrent.ConcurrentLinkedDeque; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; -import java.util.function.Function; import java.util.function.Predicate; public class WorldImporter { diff --git a/src/main/java/me/cortex/voxy/client/saver/ContextSelectionSystem.java b/src/main/java/me/cortex/voxy/client/saver/ContextSelectionSystem.java index e5dd2699..089601a3 100644 --- a/src/main/java/me/cortex/voxy/client/saver/ContextSelectionSystem.java +++ b/src/main/java/me/cortex/voxy/client/saver/ContextSelectionSystem.java @@ -9,7 +9,7 @@ import me.cortex.voxy.common.storage.config.StorageConfig; import me.cortex.voxy.common.storage.other.CompressionStorageAdaptor; import me.cortex.voxy.common.storage.rocksdb.RocksDBStorageBackend; import me.cortex.voxy.common.world.WorldEngine; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; +import me.cortex.voxy.common.thread.ServiceThreadPool; import net.minecraft.client.MinecraftClient; import net.minecraft.client.world.ClientWorld; import net.minecraft.util.WorldSavePath; diff --git a/src/main/java/me/cortex/voxy/common/world/thread/ServiceSlice.java b/src/main/java/me/cortex/voxy/common/thread/ServiceSlice.java similarity index 97% rename from src/main/java/me/cortex/voxy/common/world/thread/ServiceSlice.java rename to src/main/java/me/cortex/voxy/common/thread/ServiceSlice.java index ddaaf7ac..e48fecef 100644 --- a/src/main/java/me/cortex/voxy/common/world/thread/ServiceSlice.java +++ b/src/main/java/me/cortex/voxy/common/thread/ServiceSlice.java @@ -1,4 +1,4 @@ -package me.cortex.voxy.common.world.thread; +package me.cortex.voxy.common.thread; import me.cortex.voxy.common.util.TrackedObject; import net.minecraft.client.MinecraftClient; @@ -6,7 +6,6 @@ import net.minecraft.text.Text; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; import java.util.function.BooleanSupplier; import java.util.function.Supplier; diff --git a/src/main/java/me/cortex/voxy/common/world/thread/ServiceThreadPool.java b/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java similarity index 98% rename from src/main/java/me/cortex/voxy/common/world/thread/ServiceThreadPool.java rename to src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java index e4330389..e3eb1965 100644 --- a/src/main/java/me/cortex/voxy/common/world/thread/ServiceThreadPool.java +++ b/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java @@ -1,8 +1,7 @@ -package me.cortex.voxy.common.world.thread; +package me.cortex.voxy.common.thread; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.BooleanSupplier; import java.util.function.Supplier; diff --git a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java index 71673598..30d06b6b 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java @@ -1,13 +1,11 @@ package me.cortex.voxy.common.world; -import me.cortex.voxy.client.Voxy; import me.cortex.voxy.common.voxelization.VoxelizedSection; import me.cortex.voxy.common.world.other.Mapper; import me.cortex.voxy.common.world.service.SectionSavingService; import me.cortex.voxy.common.world.service.VoxelIngestService; import me.cortex.voxy.common.storage.StorageBackend; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; -import org.lwjgl.system.MemoryUtil; +import me.cortex.voxy.common.thread.ServiceThreadPool; import java.util.Arrays; import java.util.function.Consumer; diff --git a/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java b/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java index a19a1f4e..e03140ea 100644 --- a/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java +++ b/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java @@ -3,11 +3,10 @@ package me.cortex.voxy.common.world.service; import me.cortex.voxy.common.world.SaveLoadSystem; import me.cortex.voxy.common.world.WorldEngine; import me.cortex.voxy.common.world.WorldSection; -import me.cortex.voxy.common.world.thread.ServiceSlice; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; +import me.cortex.voxy.common.thread.ServiceSlice; +import me.cortex.voxy.common.thread.ServiceThreadPool; import net.minecraft.client.MinecraftClient; import net.minecraft.text.Text; -import org.lwjgl.system.MemoryUtil; import java.util.concurrent.ConcurrentLinkedDeque; diff --git a/src/main/java/me/cortex/voxy/common/world/service/VoxelIngestService.java b/src/main/java/me/cortex/voxy/common/world/service/VoxelIngestService.java index 4b4d5878..72db34f0 100644 --- a/src/main/java/me/cortex/voxy/common/world/service/VoxelIngestService.java +++ b/src/main/java/me/cortex/voxy/common/world/service/VoxelIngestService.java @@ -1,24 +1,19 @@ package me.cortex.voxy.common.world.service; import it.unimi.dsi.fastutil.Pair; -import me.cortex.voxy.client.Voxy; import me.cortex.voxy.common.voxelization.VoxelizedSection; import me.cortex.voxy.common.voxelization.WorldConversionFactory; import me.cortex.voxy.common.world.WorldEngine; -import me.cortex.voxy.common.world.thread.ServiceSlice; -import me.cortex.voxy.common.world.thread.ServiceThreadPool; -import net.minecraft.client.MinecraftClient; -import net.minecraft.text.Text; +import me.cortex.voxy.common.thread.ServiceSlice; +import me.cortex.voxy.common.thread.ServiceThreadPool; import net.minecraft.util.math.ChunkSectionPos; import net.minecraft.world.LightType; import net.minecraft.world.chunk.ChunkNibbleArray; import net.minecraft.world.chunk.WorldChunk; -import net.minecraft.world.chunk.light.LightStorage; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedDeque; -import java.util.concurrent.Semaphore; public class VoxelIngestService { private static final ThreadLocal SECTION_CACHE = ThreadLocal.withInitial(VoxelizedSection::createEmpty);