From 806e861edca8d3cef4f0667693caf1b332341e4c Mon Sep 17 00:00:00 2001 From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:52:51 -0700 Subject: [PATCH] Reorganization II --- .../java/com/jozufozu/flywheel/Flywheel.java | 33 ++++---- .../{ => api}/backend/BackendType.java | 7 +- .../instancing => api/backend}/Engine.java | 3 +- .../backend}/RenderDispatcher.java | 7 +- .../component}/ComponentRegistry.java | 2 +- .../component}/ComponentType.java | 2 +- .../{ => api}/event/BeginFrameEvent.java | 4 +- .../{ => api}/event/ReloadRenderersEvent.java | 2 +- .../{core => api/event}/RenderContext.java | 2 +- .../flywheel/api/{ => event}/RenderStage.java | 2 +- .../{ => api}/event/RenderStageEvent.java | 4 +- .../flywheel/api/instance/package-info.java | 6 -- .../structs => api/instancer}/FlatLit.java | 4 +- .../api/instancer/InstancerManager.java | 4 +- .../{core => api}/layout/BufferLayout.java | 3 +- .../{core => api}/layout/InputType.java | 2 +- .../flywheel/{core => api}/model/Mesh.java | 6 +- .../flywheel/{core => api}/model/Model.java | 2 +- .../jozufozu/flywheel/api/package-info.java | 6 -- .../flywheel/api/pipeline/Pipeline.java | 1 - .../pipeline}/SourceComponent.java | 2 +- .../flywheel/api/struct/StructType.java | 2 +- .../flywheel/api/struct/package-info.java | 6 -- .../instancing => api/task}/TaskExecutor.java | 2 +- .../api/vertex/VertexListProvider.java | 2 +- .../flywheel/api/vertex/VertexType.java | 2 +- .../flywheel/api/vertex/package-info.java | 6 -- .../jozufozu/flywheel/backend/Backend.java | 6 +- .../com/jozufozu/flywheel/backend/Loader.java | 2 +- .../{instancing => }/compile/Compilation.java | 4 +- .../compile/CompilationResult.java | 2 +- .../{instancing => }/compile/CompileUtil.java | 2 +- .../compile/CullingContext.java | 2 +- .../compile/CullingContextSet.java | 4 +- .../compile/FailedCompilation.java | 2 +- .../{instancing => }/compile/FlwCompiler.java | 15 ++-- .../{instancing => }/compile/Includer.java | 4 +- .../compile/MaterialAdapterComponent.java | 4 +- .../compile/PipelineContext.java | 2 +- .../compile/PipelineContextSet.java | 18 ++-- .../compile/RecursiveIncluder.java | 4 +- .../compile/ShaderCompiler.java | 4 +- .../StringSubstitutionSourceComponent.java | 4 +- .../compile/UniformComponent.java | 4 +- .../batching/BatchedMeshPool.java | 6 +- .../batching/BatchingDrawTracker.java | 4 +- .../batching/BatchingEngine.java | 12 +-- .../batching/BatchingTransformManager.java | 8 +- .../batching/CPUInstancer.java | 2 +- .../batching/DrawBuffer.java | 6 +- .../batching/DrawBufferSet.java | 4 +- .../batching/TransformCall.java | 4 +- .../indirect/IndirectBuffers.java | 6 +- .../indirect/IndirectComponent.java | 8 +- .../indirect/IndirectCullingGroup.java | 14 ++-- .../indirect/IndirectDraw.java | 6 +- .../indirect/IndirectDrawManager.java | 6 +- .../indirect/IndirectDrawSet.java | 6 +- .../indirect/IndirectEngine.java | 18 ++-- .../indirect/IndirectInstancer.java | 2 +- .../indirect/IndirectMeshPool.java | 6 +- .../indirect/ShaderState.java | 2 +- .../instancing/DrawCall.java | 2 +- .../instancing/ElementBuffer.java | 2 +- .../instancing/GPUInstancer.java | 4 +- .../instancing/InstancedArraysComponent.java | 6 +- .../instancing/InstancedMeshPool.java | 4 +- .../instancing/InstancingDrawManager.java | 8 +- .../instancing/InstancingEngine.java | 24 +++--- .../instancing/ShaderState.java | 2 +- .../backend/instancing/AbstractInstance.java | 4 +- .../backend/instancing/InstanceManager.java | 4 +- .../backend/instancing/InstanceWorld.java | 8 +- .../instancing/InstancedRenderDispatcher.java | 6 +- .../backend/instancing/InstancerKey.java | 4 +- .../instancing/batching/package-info.java | 6 -- .../BlockEntityInstanceManager.java | 4 +- .../instancing/blockentity/package-info.java | 6 -- .../instancing/compile/package-info.java | 6 -- .../effect/EffectInstanceManager.java | 4 +- .../instancing/effect/package-info.java | 6 -- .../entity/EntityInstanceManager.java | 2 +- .../instancing/entity/package-info.java | 6 -- .../instancing/indirect/package-info.java | 6 -- .../instancing/instancing/package-info.java | 6 -- .../backend/instancing/package-info.java | 6 -- .../{ => storage}/AbstractStorage.java | 3 +- .../{ => storage}/One2OneStorage.java | 3 +- .../instancing/{ => storage}/Storage.java | 3 +- .../flywheel/backend/package-info.java | 6 -- .../ParallelTaskExecutor.java | 3 +- .../SerialTaskExecutor.java | 4 +- .../{instancing => task}/WorkGroup.java | 2 +- .../uniform/UniformBuffer.java | 6 +- .../vertex/InferredVertexFormatInfo.java | 2 +- .../vertex/InferredVertexListImpl.java | 3 +- .../InferredVertexListProviderImpl.java | 2 +- .../flywheel/config/BackendTypeArgument.java | 4 +- .../jozufozu/flywheel/config/FlwCommands.java | 8 +- .../jozufozu/flywheel/config/FlwConfig.java | 4 +- .../flywheel/config/package-info.java | 6 -- .../jozufozu/flywheel/core/Components.java | 57 ------------- .../flywheel/core/StitchedSprite.java | 67 --------------- .../flywheel/core/crumbling/package-info.java | 6 -- .../flywheel/core/hardcoded/package-info.java | 6 -- .../core/instancing/ConditionalInstance.java | 61 -------------- .../core/instancing/GroupInstance.java | 84 ------------------- .../core/instancing/SelectInstance.java | 62 -------------- .../flywheel/core/layout/package-info.java | 6 -- .../flywheel/core/model/package-info.java | 6 -- .../jozufozu/flywheel/core/package-info.java | 6 -- .../flywheel/core/structs/StructTypes.java | 17 ---- .../core/structs/oriented/package-info.java | 6 -- .../flywheel/core/structs/package-info.java | 6 -- .../structs/transformed/package-info.java | 6 -- .../flywheel/core/vertex/Formats.java | 12 --- .../flywheel/core/vertex/package-info.java | 6 -- .../flywheel/core/virtual/package-info.java | 6 -- .../jozufozu/flywheel/event/package-info.java | 6 -- .../extension/RenderTypeExtension.java | 2 +- .../flywheel/gl/array/GlVertexArray.java | 2 +- .../jozufozu/flywheel/gl/buffer/GlBuffer.java | 4 +- .../flywheel/gl/buffer/package-info.java | 6 -- .../jozufozu/flywheel/gl/package-info.java | 6 -- .../flywheel/gl/shader/GlProgram.java | 2 +- .../flywheel/gl/shader/package-info.java | 6 -- .../jozufozu/flywheel/glsl/SourceFile.java | 2 +- .../flywheel/glsl/generate/package-info.java | 6 -- .../jozufozu/flywheel/glsl/package-info.java | 6 -- .../flywheel/glsl/parse/package-info.java | 7 -- .../flywheel/glsl/span/package-info.java | 6 -- .../EntityWorldHandler.java | 2 +- .../{event => handler}/ForgeEvents.java | 4 +- .../{core => lib/backend}/BackendTypes.java | 23 ++--- .../{ => lib}/backend/SimpleBackendType.java | 18 ++-- .../flywheel/lib/context/Contexts.java | 28 +++++++ .../{core => lib}/context/SimpleContext.java | 2 +- .../format}/AbstractVertexList.java | 2 +- .../vertex => lib/format}/BlockVertex.java | 9 +- .../format}/BlockVertexList.java | 2 +- .../jozufozu/flywheel/lib/format/Formats.java | 26 ++++++ .../format}/PosTexNormalVertex.java | 9 +- .../format}/PosTexNormalVertexList.java | 2 +- .../{core => lib}/layout/CommonItems.java | 2 +- .../{core => lib}/layout/LayoutItem.java | 3 +- .../{core => lib}/layout/MatInput.java | 3 +- .../{core => lib}/layout/VecInput.java | 3 +- .../{core => lib/material}/Materials.java | 72 +++++++++------- .../material/SimpleMaterial.java | 9 +- .../memory/DebugMemoryBlockImpl.java | 2 +- .../memory/FlwMemoryTracker.java | 2 +- .../{backend => lib}/memory/MemoryBlock.java | 2 +- .../memory/MemoryBlockImpl.java | 2 +- .../memory/TrackedMemoryBlockImpl.java | 2 +- .../{core => lib}/model/ModelUtil.java | 8 +- .../flywheel/{core => lib}/model/Models.java | 12 +-- .../{core => lib/model}/PartialModel.java | 2 +- .../{core => lib}/model/SimpleLazyModel.java | 4 +- .../{core => lib}/model/SimpleMesh.java | 5 +- .../{core => lib}/model/TessellatedModel.java | 4 +- .../model/buffering/BakedModelBuilder.java | 24 +++--- .../model/buffering/BlockModelBuilder.java | 24 +++--- .../LazyDelegatingVertexConsumer.java | 2 +- .../buffering/ModelBufferingObjects.java | 6 +- .../model/buffering/ModelBufferingUtil.java | 2 +- .../buffering/MultiBlockModelBuilder.java | 22 ++--- .../ShadeSeparatingVertexConsumer.java | 2 +- .../modelpart}/ModelPart.java | 12 +-- .../modelpart}/PartBuilder.java | 2 +- .../modelpart}/VertexWriter.java | 2 +- .../modelpart}/VertexWriterImpl.java | 2 +- .../{core => lib/pipeline}/Pipelines.java | 7 +- .../pipeline/SimplePipeline.java | 4 +- .../struct}/ColoredLitPart.java | 3 +- .../struct}/ColoredLitWriter.java | 2 +- .../oriented => lib/struct}/OrientedPart.java | 4 +- .../oriented => lib/struct}/OrientedType.java | 9 +- .../struct}/OrientedWriter.java | 4 +- .../flywheel/lib/struct/StructTypes.java | 27 ++++++ .../struct}/TransformedPart.java | 6 +- .../struct}/TransformedType.java | 9 +- .../struct}/TransformedWriter.java | 3 +- .../{util => lib}/transform/Rotate.java | 2 +- .../{util => lib}/transform/Scale.java | 2 +- .../{util => lib}/transform/Transform.java | 2 +- .../transform/TransformStack.java | 2 +- .../{util => lib}/transform/Translate.java | 2 +- .../uniform/FlwShaderUniforms.java | 13 +-- .../{core => lib/util}/FullscreenQuad.java | 6 +- .../{core => lib/util}/QuadConverter.java | 6 +- .../{backend => lib/util}/RenderWork.java | 2 +- .../util}/ShadersModHandler.java | 4 +- .../virtualworld}/VirtualChunk.java | 2 +- .../virtualworld}/VirtualChunkSection.java | 2 +- .../virtualworld}/VirtualChunkSource.java | 2 +- .../VirtualEmptyBlockGetter.java | 2 +- .../virtualworld}/VirtualEmptyModelData.java | 2 +- .../VirtualLevelEntityGetter.java | 2 +- .../virtualworld}/VirtualRenderWorld.java | 2 +- .../jozufozu/flywheel/light/LightUpdater.java | 4 +- .../jozufozu/flywheel/light/LightVolume.java | 2 +- .../jozufozu/flywheel/light/package-info.java | 7 -- .../flywheel/mixin/FogUpdateMixin.java | 2 +- .../flywheel/mixin/LevelRendererMixin.java | 10 +-- .../flywheel/mixin/RenderTypeMixin.java | 2 +- .../mixin/light/NetworkLightUpdateMixin.java | 2 +- .../flywheel/mixin/matrix/PoseStackMixin.java | 2 +- .../jozufozu/flywheel/util/StringUtil.java | 2 +- .../flywheel/vanilla/BellInstance.java | 12 +-- .../flywheel/vanilla/ChestInstance.java | 14 ++-- .../flywheel/vanilla/MinecartInstance.java | 18 ++-- .../flywheel/vanilla/ShulkerBoxInstance.java | 14 ++-- .../vanilla/effect/ExampleEffect.java | 10 +-- .../flywheel/vanilla/effect/package-info.java | 6 -- .../flywheel/vanilla/package-info.java | 6 -- 215 files changed, 575 insertions(+), 1038 deletions(-) rename src/main/java/com/jozufozu/flywheel/{ => api}/backend/BackendType.java (59%) rename src/main/java/com/jozufozu/flywheel/{backend/instancing => api/backend}/Engine.java (70%) rename src/main/java/com/jozufozu/flywheel/{backend/instancing => api/backend}/RenderDispatcher.java (73%) rename src/main/java/com/jozufozu/flywheel/{core => api/component}/ComponentRegistry.java (98%) rename src/main/java/com/jozufozu/flywheel/{core => api/component}/ComponentType.java (66%) rename src/main/java/com/jozufozu/flywheel/{ => api}/event/BeginFrameEvent.java (75%) rename src/main/java/com/jozufozu/flywheel/{ => api}/event/ReloadRenderersEvent.java (90%) rename src/main/java/com/jozufozu/flywheel/{core => api/event}/RenderContext.java (96%) rename src/main/java/com/jozufozu/flywheel/api/{ => event}/RenderStage.java (86%) rename src/main/java/com/jozufozu/flywheel/{ => api}/event/RenderStageEvent.java (88%) delete mode 100644 src/main/java/com/jozufozu/flywheel/api/instance/package-info.java rename src/main/java/com/jozufozu/flywheel/{core/structs => api/instancer}/FlatLit.java (91%) rename src/main/java/com/jozufozu/flywheel/{core => api}/layout/BufferLayout.java (95%) rename src/main/java/com/jozufozu/flywheel/{core => api}/layout/InputType.java (89%) rename src/main/java/com/jozufozu/flywheel/{core => api}/model/Mesh.java (92%) rename src/main/java/com/jozufozu/flywheel/{core => api}/model/Model.java (87%) delete mode 100644 src/main/java/com/jozufozu/flywheel/api/package-info.java rename src/main/java/com/jozufozu/flywheel/{core => api/pipeline}/SourceComponent.java (83%) delete mode 100644 src/main/java/com/jozufozu/flywheel/api/struct/package-info.java rename src/main/java/com/jozufozu/flywheel/{backend/instancing => api/task}/TaskExecutor.java (78%) delete mode 100644 src/main/java/com/jozufozu/flywheel/api/vertex/package-info.java rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/Compilation.java (97%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/CompilationResult.java (91%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/CompileUtil.java (97%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/CullingContext.java (66%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/CullingContextSet.java (87%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/FailedCompilation.java (97%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/FlwCompiler.java (93%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/Includer.java (85%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/MaterialAdapterComponent.java (97%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/PipelineContext.java (91%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/PipelineContextSet.java (63%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/RecursiveIncluder.java (89%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/ShaderCompiler.java (96%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/StringSubstitutionSourceComponent.java (92%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => }/compile/UniformComponent.java (94%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/BatchedMeshPool.java (96%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/BatchingDrawTracker.java (95%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/BatchingEngine.java (89%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/BatchingTransformManager.java (95%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/CPUInstancer.java (90%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/DrawBuffer.java (95%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/DrawBufferSet.java (89%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/batching/TransformCall.java (96%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectBuffers.java (97%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectComponent.java (92%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectCullingGroup.java (93%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectDraw.java (93%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectDrawManager.java (94%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectDrawSet.java (93%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectEngine.java (86%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectInstancer.java (96%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/IndirectMeshPool.java (94%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/indirect/ShaderState.java (80%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/DrawCall.java (96%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/ElementBuffer.java (91%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/GPUInstancer.java (95%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/InstancedArraysComponent.java (92%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/InstancedMeshPool.java (98%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/InstancingDrawManager.java (95%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/InstancingEngine.java (86%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => engine}/instancing/ShaderState.java (80%) delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/batching/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/compile/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/effect/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java rename src/main/java/com/jozufozu/flywheel/backend/instancing/{ => storage}/AbstractStorage.java (91%) rename src/main/java/com/jozufozu/flywheel/backend/instancing/{ => storage}/One2OneStorage.java (94%) rename src/main/java/com/jozufozu/flywheel/backend/instancing/{ => storage}/Storage.java (78%) delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/package-info.java rename src/main/java/com/jozufozu/flywheel/backend/{instancing => task}/ParallelTaskExecutor.java (98%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => task}/SerialTaskExecutor.java (78%) rename src/main/java/com/jozufozu/flywheel/backend/{instancing => task}/WorkGroup.java (97%) rename src/main/java/com/jozufozu/flywheel/{core => backend}/uniform/UniformBuffer.java (95%) rename src/main/java/com/jozufozu/flywheel/{core => backend}/vertex/InferredVertexFormatInfo.java (97%) rename src/main/java/com/jozufozu/flywheel/{core => backend}/vertex/InferredVertexListImpl.java (98%) rename src/main/java/com/jozufozu/flywheel/{core => backend}/vertex/InferredVertexListProviderImpl.java (92%) delete mode 100644 src/main/java/com/jozufozu/flywheel/config/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/Components.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/hardcoded/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/instancing/ConditionalInstance.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/instancing/GroupInstance.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/instancing/SelectInstance.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/layout/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/model/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/structs/StructTypes.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/structs/oriented/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/structs/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/structs/transformed/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/vertex/Formats.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/vertex/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/core/virtual/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/event/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/gl/buffer/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/gl/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/gl/shader/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/glsl/generate/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/glsl/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/glsl/parse/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/glsl/span/package-info.java rename src/main/java/com/jozufozu/flywheel/{event => handler}/EntityWorldHandler.java (94%) rename src/main/java/com/jozufozu/flywheel/{event => handler}/ForgeEvents.java (93%) rename src/main/java/com/jozufozu/flywheel/{core => lib/backend}/BackendTypes.java (81%) rename src/main/java/com/jozufozu/flywheel/{ => lib}/backend/SimpleBackendType.java (86%) create mode 100644 src/main/java/com/jozufozu/flywheel/lib/context/Contexts.java rename src/main/java/com/jozufozu/flywheel/{core => lib}/context/SimpleContext.java (93%) rename src/main/java/com/jozufozu/flywheel/{core/vertex => lib/format}/AbstractVertexList.java (91%) rename src/main/java/com/jozufozu/flywheel/{core/vertex => lib/format}/BlockVertex.java (74%) rename src/main/java/com/jozufozu/flywheel/{core/vertex => lib/format}/BlockVertexList.java (99%) create mode 100644 src/main/java/com/jozufozu/flywheel/lib/format/Formats.java rename src/main/java/com/jozufozu/flywheel/{core/vertex => lib/format}/PosTexNormalVertex.java (70%) rename src/main/java/com/jozufozu/flywheel/{core/vertex => lib/format}/PosTexNormalVertexList.java (98%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/layout/CommonItems.java (98%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/layout/LayoutItem.java (84%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/layout/MatInput.java (89%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/layout/VecInput.java (95%) rename src/main/java/com/jozufozu/flywheel/{core => lib/material}/Materials.java (74%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/material/SimpleMaterial.java (91%) rename src/main/java/com/jozufozu/flywheel/{backend => lib}/memory/DebugMemoryBlockImpl.java (97%) rename src/main/java/com/jozufozu/flywheel/{backend => lib}/memory/FlwMemoryTracker.java (98%) rename src/main/java/com/jozufozu/flywheel/{backend => lib}/memory/MemoryBlock.java (95%) rename src/main/java/com/jozufozu/flywheel/{backend => lib}/memory/MemoryBlockImpl.java (97%) rename src/main/java/com/jozufozu/flywheel/{backend => lib}/memory/TrackedMemoryBlockImpl.java (96%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/ModelUtil.java (95%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/Models.java (82%) rename src/main/java/com/jozufozu/flywheel/{core => lib/model}/PartialModel.java (98%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/SimpleLazyModel.java (88%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/SimpleMesh.java (92%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/TessellatedModel.java (83%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/BakedModelBuilder.java (84%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/BlockModelBuilder.java (83%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/LazyDelegatingVertexConsumer.java (97%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/ModelBufferingObjects.java (71%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/ModelBufferingUtil.java (99%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/MultiBlockModelBuilder.java (85%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/model/buffering/ShadeSeparatingVertexConsumer.java (97%) rename src/main/java/com/jozufozu/flywheel/{core/hardcoded => lib/modelpart}/ModelPart.java (85%) rename src/main/java/com/jozufozu/flywheel/{core/hardcoded => lib/modelpart}/PartBuilder.java (99%) rename src/main/java/com/jozufozu/flywheel/{core/hardcoded => lib/modelpart}/VertexWriter.java (73%) rename src/main/java/com/jozufozu/flywheel/{core/hardcoded => lib/modelpart}/VertexWriterImpl.java (93%) rename src/main/java/com/jozufozu/flywheel/{core => lib/pipeline}/Pipelines.java (82%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/pipeline/SimplePipeline.java (95%) rename src/main/java/com/jozufozu/flywheel/{core/structs => lib/struct}/ColoredLitPart.java (94%) rename src/main/java/com/jozufozu/flywheel/{core/structs => lib/struct}/ColoredLitWriter.java (91%) rename src/main/java/com/jozufozu/flywheel/{core/structs/oriented => lib/struct}/OrientedPart.java (93%) rename src/main/java/com/jozufozu/flywheel/{core/structs/oriented => lib/struct}/OrientedType.java (91%) rename src/main/java/com/jozufozu/flywheel/{core/structs/oriented => lib/struct}/OrientedWriter.java (86%) create mode 100644 src/main/java/com/jozufozu/flywheel/lib/struct/StructTypes.java rename src/main/java/com/jozufozu/flywheel/{core/structs/transformed => lib/struct}/TransformedPart.java (91%) rename src/main/java/com/jozufozu/flywheel/{core/structs/transformed => lib/struct}/TransformedType.java (88%) rename src/main/java/com/jozufozu/flywheel/{core/structs/transformed => lib/struct}/TransformedWriter.java (77%) rename src/main/java/com/jozufozu/flywheel/{util => lib}/transform/Rotate.java (97%) rename src/main/java/com/jozufozu/flywheel/{util => lib}/transform/Scale.java (78%) rename src/main/java/com/jozufozu/flywheel/{util => lib}/transform/Transform.java (95%) rename src/main/java/com/jozufozu/flywheel/{util => lib}/transform/TransformStack.java (84%) rename src/main/java/com/jozufozu/flywheel/{util => lib}/transform/Translate.java (97%) rename src/main/java/com/jozufozu/flywheel/{core => lib}/uniform/FlwShaderUniforms.java (88%) rename src/main/java/com/jozufozu/flywheel/{core => lib/util}/FullscreenQuad.java (92%) rename src/main/java/com/jozufozu/flywheel/{core => lib/util}/QuadConverter.java (94%) rename src/main/java/com/jozufozu/flywheel/{backend => lib/util}/RenderWork.java (92%) rename src/main/java/com/jozufozu/flywheel/{backend => lib/util}/ShadersModHandler.java (98%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualChunk.java (99%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualChunkSection.java (95%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualChunkSource.java (96%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualEmptyBlockGetter.java (98%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualEmptyModelData.java (93%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualLevelEntityGetter.java (94%) rename src/main/java/com/jozufozu/flywheel/{core/virtual => lib/virtualworld}/VirtualRenderWorld.java (99%) delete mode 100644 src/main/java/com/jozufozu/flywheel/light/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/vanilla/effect/package-info.java delete mode 100644 src/main/java/com/jozufozu/flywheel/vanilla/package-info.java diff --git a/src/main/java/com/jozufozu/flywheel/Flywheel.java b/src/main/java/com/jozufozu/flywheel/Flywheel.java index 5c0e809c7..4ef08c393 100644 --- a/src/main/java/com/jozufozu/flywheel/Flywheel.java +++ b/src/main/java/com/jozufozu/flywheel/Flywheel.java @@ -4,21 +4,24 @@ import org.apache.maven.artifact.versioning.ArtifactVersion; import org.slf4j.Logger; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.backend.RenderWork; -import com.jozufozu.flywheel.backend.ShadersModHandler; +import com.jozufozu.flywheel.backend.engine.batching.DrawBuffer; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; -import com.jozufozu.flywheel.backend.instancing.batching.DrawBuffer; import com.jozufozu.flywheel.config.BackendTypeArgument; import com.jozufozu.flywheel.config.FlwCommands; import com.jozufozu.flywheel.config.FlwConfig; -import com.jozufozu.flywheel.core.BackendTypes; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.PartialModel; -import com.jozufozu.flywheel.core.QuadConverter; -import com.jozufozu.flywheel.core.StitchedSprite; -import com.jozufozu.flywheel.core.model.Models; -import com.jozufozu.flywheel.event.EntityWorldHandler; -import com.jozufozu.flywheel.event.ForgeEvents; +import com.jozufozu.flywheel.handler.EntityWorldHandler; +import com.jozufozu.flywheel.handler.ForgeEvents; +import com.jozufozu.flywheel.lib.backend.BackendTypes; +import com.jozufozu.flywheel.lib.context.Contexts; +import com.jozufozu.flywheel.lib.format.Formats; +import com.jozufozu.flywheel.lib.material.Materials; +import com.jozufozu.flywheel.lib.model.Models; +import com.jozufozu.flywheel.lib.model.PartialModel; +import com.jozufozu.flywheel.lib.pipeline.Pipelines; +import com.jozufozu.flywheel.lib.struct.StructTypes; +import com.jozufozu.flywheel.lib.util.QuadConverter; +import com.jozufozu.flywheel.lib.util.RenderWork; +import com.jozufozu.flywheel.lib.util.ShadersModHandler; import com.jozufozu.flywheel.mixin.PausedPartialTickAccessor; import com.jozufozu.flywheel.vanilla.VanillaInstances; import com.mojang.logging.LogUtils; @@ -98,13 +101,15 @@ public class Flywheel { modEventBus.addListener(PartialModel::onModelRegistry); modEventBus.addListener(PartialModel::onModelBake); - modEventBus.addListener(StitchedSprite::onTextureStitchPre); - modEventBus.addListener(StitchedSprite::onTextureStitchPost); // forgeEventBus.addListener(ExampleEffect::tick); // forgeEventBus.addListener(ExampleEffect::onReload); - Components.init(); + Formats.init(); + StructTypes.init(); + Materials.init(); + Contexts.init(); + Pipelines.init(); VanillaInstances.init(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/BackendType.java b/src/main/java/com/jozufozu/flywheel/api/backend/BackendType.java similarity index 59% rename from src/main/java/com/jozufozu/flywheel/backend/BackendType.java rename to src/main/java/com/jozufozu/flywheel/api/backend/BackendType.java index 0762e3596..46a8bd2a2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/BackendType.java +++ b/src/main/java/com/jozufozu/flywheel/api/backend/BackendType.java @@ -1,9 +1,8 @@ -package com.jozufozu.flywheel.backend; +package com.jozufozu.flywheel.api.backend; import org.jetbrains.annotations.Nullable; -import com.jozufozu.flywheel.backend.instancing.Engine; -import com.jozufozu.flywheel.core.pipeline.SimplePipeline; +import com.jozufozu.flywheel.api.pipeline.Pipeline; import net.minecraft.network.chat.Component; @@ -21,5 +20,5 @@ public interface BackendType { boolean supported(); - @Nullable SimplePipeline pipelineShader(); + @Nullable Pipeline pipelineShader(); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/Engine.java b/src/main/java/com/jozufozu/flywheel/api/backend/Engine.java similarity index 70% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/Engine.java rename to src/main/java/com/jozufozu/flywheel/api/backend/Engine.java index 4389fcb94..6a58260e8 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/Engine.java +++ b/src/main/java/com/jozufozu/flywheel/api/backend/Engine.java @@ -1,8 +1,9 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.api.backend; import java.util.List; import com.jozufozu.flywheel.api.instancer.InstancerManager; +import com.jozufozu.flywheel.backend.instancing.InstanceManager; public interface Engine extends RenderDispatcher, InstancerManager { void attachManagers(InstanceManager... listener); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/RenderDispatcher.java b/src/main/java/com/jozufozu/flywheel/api/backend/RenderDispatcher.java similarity index 73% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/RenderDispatcher.java rename to src/main/java/com/jozufozu/flywheel/api/backend/RenderDispatcher.java index 610c9dc4d..0071261f4 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/RenderDispatcher.java +++ b/src/main/java/com/jozufozu/flywheel/api/backend/RenderDispatcher.java @@ -1,7 +1,8 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.api.backend; -import com.jozufozu.flywheel.api.RenderStage; -import com.jozufozu.flywheel.core.RenderContext; +import com.jozufozu.flywheel.api.event.RenderContext; +import com.jozufozu.flywheel.api.event.RenderStage; +import com.jozufozu.flywheel.api.task.TaskExecutor; import net.minecraft.client.Camera; diff --git a/src/main/java/com/jozufozu/flywheel/core/ComponentRegistry.java b/src/main/java/com/jozufozu/flywheel/api/component/ComponentRegistry.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/core/ComponentRegistry.java rename to src/main/java/com/jozufozu/flywheel/api/component/ComponentRegistry.java index a46ec70bc..5371bd73e 100644 --- a/src/main/java/com/jozufozu/flywheel/core/ComponentRegistry.java +++ b/src/main/java/com/jozufozu/flywheel/api/component/ComponentRegistry.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.api.component; import java.util.ArrayList; import java.util.Collection; diff --git a/src/main/java/com/jozufozu/flywheel/core/ComponentType.java b/src/main/java/com/jozufozu/flywheel/api/component/ComponentType.java similarity index 66% rename from src/main/java/com/jozufozu/flywheel/core/ComponentType.java rename to src/main/java/com/jozufozu/flywheel/api/component/ComponentType.java index 0b9f922df..0ff129c9b 100644 --- a/src/main/java/com/jozufozu/flywheel/core/ComponentType.java +++ b/src/main/java/com/jozufozu/flywheel/api/component/ComponentType.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.api.component; public enum ComponentType { MATERIAL, diff --git a/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java b/src/main/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java similarity index 75% rename from src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java rename to src/main/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java index 4ef40af54..9a90f0fbd 100644 --- a/src/main/java/com/jozufozu/flywheel/event/BeginFrameEvent.java +++ b/src/main/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java @@ -1,6 +1,4 @@ -package com.jozufozu.flywheel.event; - -import com.jozufozu.flywheel.core.RenderContext; +package com.jozufozu.flywheel.api.event; import net.minecraftforge.eventbus.api.Event; diff --git a/src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java b/src/main/java/com/jozufozu/flywheel/api/event/ReloadRenderersEvent.java similarity index 90% rename from src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java rename to src/main/java/com/jozufozu/flywheel/api/event/ReloadRenderersEvent.java index 01e90a44f..0206ed3ce 100644 --- a/src/main/java/com/jozufozu/flywheel/event/ReloadRenderersEvent.java +++ b/src/main/java/com/jozufozu/flywheel/api/event/ReloadRenderersEvent.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.event; +package com.jozufozu.flywheel.api.event; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/jozufozu/flywheel/core/RenderContext.java b/src/main/java/com/jozufozu/flywheel/api/event/RenderContext.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/core/RenderContext.java rename to src/main/java/com/jozufozu/flywheel/api/event/RenderContext.java index 21125364a..a3cd89d06 100644 --- a/src/main/java/com/jozufozu/flywheel/core/RenderContext.java +++ b/src/main/java/com/jozufozu/flywheel/api/event/RenderContext.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.api.event; import org.jetbrains.annotations.NotNull; import org.joml.FrustumIntersection; diff --git a/src/main/java/com/jozufozu/flywheel/api/RenderStage.java b/src/main/java/com/jozufozu/flywheel/api/event/RenderStage.java similarity index 86% rename from src/main/java/com/jozufozu/flywheel/api/RenderStage.java rename to src/main/java/com/jozufozu/flywheel/api/event/RenderStage.java index 42d36d1cc..dc9883d09 100644 --- a/src/main/java/com/jozufozu/flywheel/api/RenderStage.java +++ b/src/main/java/com/jozufozu/flywheel/api/event/RenderStage.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.api; +package com.jozufozu.flywheel.api.event; public enum RenderStage { BEFORE_SKY, diff --git a/src/main/java/com/jozufozu/flywheel/event/RenderStageEvent.java b/src/main/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java similarity index 88% rename from src/main/java/com/jozufozu/flywheel/event/RenderStageEvent.java rename to src/main/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java index 17bbb2d0f..8c4040737 100644 --- a/src/main/java/com/jozufozu/flywheel/event/RenderStageEvent.java +++ b/src/main/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java @@ -1,7 +1,5 @@ -package com.jozufozu.flywheel.event; +package com.jozufozu.flywheel.api.event; -import com.jozufozu.flywheel.api.RenderStage; -import com.jozufozu.flywheel.core.RenderContext; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix4f; diff --git a/src/main/java/com/jozufozu/flywheel/api/instance/package-info.java b/src/main/java/com/jozufozu/flywheel/api/instance/package-info.java deleted file mode 100644 index aab0f0d30..000000000 --- a/src/main/java/com/jozufozu/flywheel/api/instance/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.api.instance; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/FlatLit.java b/src/main/java/com/jozufozu/flywheel/api/instancer/FlatLit.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/core/structs/FlatLit.java rename to src/main/java/com/jozufozu/flywheel/api/instancer/FlatLit.java index b0f753503..188933eac 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/FlatLit.java +++ b/src/main/java/com/jozufozu/flywheel/api/instancer/FlatLit.java @@ -1,6 +1,4 @@ -package com.jozufozu.flywheel.core.structs; - -import com.jozufozu.flywheel.api.instancer.InstancedPart; +package com.jozufozu.flywheel.api.instancer; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockAndTintGetter; diff --git a/src/main/java/com/jozufozu/flywheel/api/instancer/InstancerManager.java b/src/main/java/com/jozufozu/flywheel/api/instancer/InstancerManager.java index 1b2842a7b..552ba0be9 100644 --- a/src/main/java/com/jozufozu/flywheel/api/instancer/InstancerManager.java +++ b/src/main/java/com/jozufozu/flywheel/api/instancer/InstancerManager.java @@ -1,8 +1,8 @@ package com.jozufozu.flywheel.api.instancer; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.core.model.Model; import net.minecraft.core.Vec3i; diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/BufferLayout.java b/src/main/java/com/jozufozu/flywheel/api/layout/BufferLayout.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/core/layout/BufferLayout.java rename to src/main/java/com/jozufozu/flywheel/api/layout/BufferLayout.java index 9b49eef14..285ed97ff 100644 --- a/src/main/java/com/jozufozu/flywheel/core/layout/BufferLayout.java +++ b/src/main/java/com/jozufozu/flywheel/api/layout/BufferLayout.java @@ -1,10 +1,11 @@ -package com.jozufozu.flywheel.core.layout; +package com.jozufozu.flywheel.api.layout; import java.util.List; import com.google.common.collect.ImmutableList; import com.jozufozu.flywheel.api.vertex.VertexType; import com.jozufozu.flywheel.gl.array.VertexAttribute; +import com.jozufozu.flywheel.lib.layout.LayoutItem; /** * Classic Vertex Format struct with a clever name. diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/InputType.java b/src/main/java/com/jozufozu/flywheel/api/layout/InputType.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/core/layout/InputType.java rename to src/main/java/com/jozufozu/flywheel/api/layout/InputType.java index 6077affcc..b34d1c3a6 100644 --- a/src/main/java/com/jozufozu/flywheel/core/layout/InputType.java +++ b/src/main/java/com/jozufozu/flywheel/api/layout/InputType.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.layout; +package com.jozufozu.flywheel.api.layout; import java.util.function.Consumer; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/Mesh.java b/src/main/java/com/jozufozu/flywheel/api/model/Mesh.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/core/model/Mesh.java rename to src/main/java/com/jozufozu/flywheel/api/model/Mesh.java index 7abae09cb..07787f5d1 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/Mesh.java +++ b/src/main/java/com/jozufozu/flywheel/api/model/Mesh.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.api.model; import org.joml.Vector4fc; import com.jozufozu.flywheel.api.vertex.MutableVertexList; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.instancing.instancing.ElementBuffer; -import com.jozufozu.flywheel.core.QuadConverter; +import com.jozufozu.flywheel.backend.engine.instancing.ElementBuffer; +import com.jozufozu.flywheel.lib.util.QuadConverter; /** * A holder for arbitrary vertex data that can be written to memory or a vertex list. diff --git a/src/main/java/com/jozufozu/flywheel/core/model/Model.java b/src/main/java/com/jozufozu/flywheel/api/model/Model.java similarity index 87% rename from src/main/java/com/jozufozu/flywheel/core/model/Model.java rename to src/main/java/com/jozufozu/flywheel/api/model/Model.java index 092c4a3cd..6998040c2 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/Model.java +++ b/src/main/java/com/jozufozu/flywheel/api/model/Model.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.api.model; import java.util.Map; diff --git a/src/main/java/com/jozufozu/flywheel/api/package-info.java b/src/main/java/com/jozufozu/flywheel/api/package-info.java deleted file mode 100644 index 5dce95a6c..000000000 --- a/src/main/java/com/jozufozu/flywheel/api/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.api; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/api/pipeline/Pipeline.java b/src/main/java/com/jozufozu/flywheel/api/pipeline/Pipeline.java index 04939a553..df5eda7ad 100644 --- a/src/main/java/com/jozufozu/flywheel/api/pipeline/Pipeline.java +++ b/src/main/java/com/jozufozu/flywheel/api/pipeline/Pipeline.java @@ -2,7 +2,6 @@ package com.jozufozu.flywheel.api.pipeline; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.core.SourceComponent; import com.jozufozu.flywheel.gl.GLSLVersion; import com.jozufozu.flywheel.glsl.ShaderSources; diff --git a/src/main/java/com/jozufozu/flywheel/core/SourceComponent.java b/src/main/java/com/jozufozu/flywheel/api/pipeline/SourceComponent.java similarity index 83% rename from src/main/java/com/jozufozu/flywheel/core/SourceComponent.java rename to src/main/java/com/jozufozu/flywheel/api/pipeline/SourceComponent.java index 16ae4102f..f7a2931cc 100644 --- a/src/main/java/com/jozufozu/flywheel/core/SourceComponent.java +++ b/src/main/java/com/jozufozu/flywheel/api/pipeline/SourceComponent.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.api.pipeline; import java.util.Collection; diff --git a/src/main/java/com/jozufozu/flywheel/api/struct/StructType.java b/src/main/java/com/jozufozu/flywheel/api/struct/StructType.java index 86689b885..37b2d678c 100644 --- a/src/main/java/com/jozufozu/flywheel/api/struct/StructType.java +++ b/src/main/java/com/jozufozu/flywheel/api/struct/StructType.java @@ -1,8 +1,8 @@ package com.jozufozu.flywheel.api.struct; import com.jozufozu.flywheel.api.instancer.InstancedPart; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.api.vertex.MutableVertexList; -import com.jozufozu.flywheel.core.layout.BufferLayout; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/api/struct/package-info.java b/src/main/java/com/jozufozu/flywheel/api/struct/package-info.java deleted file mode 100644 index da8cef289..000000000 --- a/src/main/java/com/jozufozu/flywheel/api/struct/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.api.struct; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/TaskExecutor.java b/src/main/java/com/jozufozu/flywheel/api/task/TaskExecutor.java similarity index 78% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/TaskExecutor.java rename to src/main/java/com/jozufozu/flywheel/api/task/TaskExecutor.java index c341dab83..ee4b722bd 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/TaskExecutor.java +++ b/src/main/java/com/jozufozu/flywheel/api/task/TaskExecutor.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.api.task; import java.util.concurrent.Executor; diff --git a/src/main/java/com/jozufozu/flywheel/api/vertex/VertexListProvider.java b/src/main/java/com/jozufozu/flywheel/api/vertex/VertexListProvider.java index 10a28891e..4ed8e74b6 100644 --- a/src/main/java/com/jozufozu/flywheel/api/vertex/VertexListProvider.java +++ b/src/main/java/com/jozufozu/flywheel/api/vertex/VertexListProvider.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.api.vertex; -import com.jozufozu.flywheel.core.vertex.InferredVertexListProviderImpl; +import com.jozufozu.flywheel.backend.vertex.InferredVertexListProviderImpl; import com.jozufozu.flywheel.extension.VertexFormatExtension; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/src/main/java/com/jozufozu/flywheel/api/vertex/VertexType.java b/src/main/java/com/jozufozu/flywheel/api/vertex/VertexType.java index cde253249..b8b2f4634 100644 --- a/src/main/java/com/jozufozu/flywheel/api/vertex/VertexType.java +++ b/src/main/java/com/jozufozu/flywheel/api/vertex/VertexType.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.api.vertex; -import com.jozufozu.flywheel.core.layout.BufferLayout; +import com.jozufozu.flywheel.api.layout.BufferLayout; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/api/vertex/package-info.java b/src/main/java/com/jozufozu/flywheel/api/vertex/package-info.java deleted file mode 100644 index 3da8d0b05..000000000 --- a/src/main/java/com/jozufozu/flywheel/api/vertex/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.api.vertex; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/Backend.java b/src/main/java/com/jozufozu/flywheel/backend/Backend.java index 056979f0a..38bcd3b34 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Backend.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Backend.java @@ -5,9 +5,11 @@ import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import com.jozufozu.flywheel.api.FlywheelLevel; -import com.jozufozu.flywheel.backend.instancing.ParallelTaskExecutor; +import com.jozufozu.flywheel.api.backend.BackendType; +import com.jozufozu.flywheel.backend.task.ParallelTaskExecutor; import com.jozufozu.flywheel.config.FlwConfig; -import com.jozufozu.flywheel.core.BackendTypes; +import com.jozufozu.flywheel.lib.backend.BackendTypes; +import com.jozufozu.flywheel.lib.util.RenderWork; import com.mojang.logging.LogUtils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/jozufozu/flywheel/backend/Loader.java b/src/main/java/com/jozufozu/flywheel/backend/Loader.java index 756d705bf..a1f612cc6 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Loader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Loader.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.backend; +import com.jozufozu.flywheel.backend.compile.FlwCompiler; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; -import com.jozufozu.flywheel.backend.instancing.compile.FlwCompiler; import com.jozufozu.flywheel.glsl.ShaderSources; import com.jozufozu.flywheel.glsl.error.ErrorReporter; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/Compilation.java b/src/main/java/com/jozufozu/flywheel/backend/compile/Compilation.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/Compilation.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/Compilation.java index aa8f89a42..c97ad44b2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/Compilation.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/Compilation.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.io.File; import java.io.FileWriter; @@ -9,8 +9,8 @@ import java.util.stream.Collectors; import org.jetbrains.annotations.NotNull; import org.lwjgl.opengl.GL20; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.core.SourceComponent; import com.jozufozu.flywheel.gl.GLSLVersion; import com.jozufozu.flywheel.gl.shader.GlShader; import com.jozufozu.flywheel.gl.shader.ShaderType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CompilationResult.java b/src/main/java/com/jozufozu/flywheel/backend/compile/CompilationResult.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CompilationResult.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/CompilationResult.java index 8376af63d..21149cde4 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CompilationResult.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/CompilationResult.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CompileUtil.java b/src/main/java/com/jozufozu/flywheel/backend/compile/CompileUtil.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CompileUtil.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/CompileUtil.java index de2ec5278..dfd28be45 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CompileUtil.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/CompileUtil.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import static org.lwjgl.opengl.GL11.GL_TRUE; import static org.lwjgl.opengl.GL20.GL_LINK_STATUS; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CullingContext.java b/src/main/java/com/jozufozu/flywheel/backend/compile/CullingContext.java similarity index 66% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CullingContext.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/CullingContext.java index 80464f50f..e481d1c78 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CullingContext.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/CullingContext.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import com.jozufozu.flywheel.api.struct.StructType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CullingContextSet.java b/src/main/java/com/jozufozu/flywheel/backend/compile/CullingContextSet.java similarity index 87% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CullingContextSet.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/CullingContextSet.java index bd6981c4a..04d6c5d8d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/CullingContextSet.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/CullingContextSet.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import com.jozufozu.flywheel.api.component.ComponentRegistry; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.core.ComponentRegistry; public class CullingContextSet { static CullingContextSet create() { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/FailedCompilation.java b/src/main/java/com/jozufozu/flywheel/backend/compile/FailedCompilation.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/FailedCompilation.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/FailedCompilation.java index e265ca1b0..ca3f97c36 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/FailedCompilation.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/FailedCompilation.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.List; import java.util.regex.Matcher; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/FlwCompiler.java b/src/main/java/com/jozufozu/flywheel/backend/compile/FlwCompiler.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/FlwCompiler.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/FlwCompiler.java index 4f6e4e0f8..0737c490f 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/FlwCompiler.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/FlwCompiler.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import static org.lwjgl.opengl.GL20.glAttachShader; import static org.lwjgl.opengl.GL20.glCreateProgram; @@ -12,17 +12,15 @@ import java.util.stream.Collectors; import com.google.common.collect.ImmutableList; import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.context.Context; import com.jozufozu.flywheel.api.pipeline.Pipeline; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.uniform.ShaderUniforms; import com.jozufozu.flywheel.api.vertex.VertexType; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.backend.instancing.indirect.IndirectComponent; -import com.jozufozu.flywheel.core.ComponentRegistry; -import com.jozufozu.flywheel.core.Pipelines; -import com.jozufozu.flywheel.core.SourceComponent; -import com.jozufozu.flywheel.core.context.SimpleContext; -import com.jozufozu.flywheel.core.pipeline.SimplePipeline; +import com.jozufozu.flywheel.backend.engine.indirect.IndirectComponent; import com.jozufozu.flywheel.gl.GLSLVersion; import com.jozufozu.flywheel.gl.shader.GlProgram; import com.jozufozu.flywheel.gl.shader.ShaderType; @@ -30,6 +28,7 @@ import com.jozufozu.flywheel.glsl.ShaderLoadingException; import com.jozufozu.flywheel.glsl.ShaderSources; import com.jozufozu.flywheel.glsl.generate.FnSignature; import com.jozufozu.flywheel.glsl.generate.GlslExpr; +import com.jozufozu.flywheel.lib.pipeline.Pipelines; import com.jozufozu.flywheel.util.StringUtil; public class FlwCompiler { @@ -126,7 +125,7 @@ public class FlwCompiler { shaderCompiler.delete(); } - public GlProgram getPipelineProgram(VertexType vertexType, StructType structType, SimpleContext contextShader, SimplePipeline pipelineShader) { + public GlProgram getPipelineProgram(VertexType vertexType, StructType structType, Context contextShader, Pipeline pipelineShader) { return pipelinePrograms.get(new PipelineContext(vertexType, structType, contextShader, pipelineShader)); } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/Includer.java b/src/main/java/com/jozufozu/flywheel/backend/compile/Includer.java similarity index 85% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/Includer.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/Includer.java index b25b03920..0ea86c1a1 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/Includer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/Includer.java @@ -1,9 +1,9 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.function.Consumer; import com.google.common.collect.ImmutableList; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; /** * A component of a ShaderCompiler, responsible for expanding root sources into the complete set of included sources. diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/MaterialAdapterComponent.java b/src/main/java/com/jozufozu/flywheel/backend/compile/MaterialAdapterComponent.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/MaterialAdapterComponent.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/MaterialAdapterComponent.java index 3aa388337..91c8ff5c0 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/MaterialAdapterComponent.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/MaterialAdapterComponent.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.ArrayList; import java.util.Collection; @@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import com.google.common.collect.ImmutableList; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.glsl.ShaderSources; import com.jozufozu.flywheel.glsl.generate.FnSignature; import com.jozufozu.flywheel.glsl.generate.GlslBlock; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/PipelineContext.java b/src/main/java/com/jozufozu/flywheel/backend/compile/PipelineContext.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/PipelineContext.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/PipelineContext.java index 179924cfa..21165069b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/PipelineContext.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/PipelineContext.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import com.jozufozu.flywheel.api.context.Context; import com.jozufozu.flywheel.api.pipeline.Pipeline; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/PipelineContextSet.java b/src/main/java/com/jozufozu/flywheel/backend/compile/PipelineContextSet.java similarity index 63% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/PipelineContextSet.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/PipelineContextSet.java index e103c9fff..21981a3a5 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/PipelineContextSet.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/PipelineContextSet.java @@ -1,24 +1,24 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.context.Context; +import com.jozufozu.flywheel.api.pipeline.Pipeline; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.core.BackendTypes; -import com.jozufozu.flywheel.core.ComponentRegistry; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.context.SimpleContext; -import com.jozufozu.flywheel.core.pipeline.SimplePipeline; +import com.jozufozu.flywheel.lib.backend.BackendTypes; +import com.jozufozu.flywheel.lib.context.Contexts; public class PipelineContextSet { static PipelineContextSet create() { var builder = new PipelineContextSet(); - for (SimplePipeline pipelineShader : BackendTypes.availablePipelineShaders()) { + for (Pipeline pipelineShader : BackendTypes.availablePipelineShaders()) { for (StructType structType : ComponentRegistry.structTypes) { for (VertexType vertexType : ComponentRegistry.vertexTypes) { - builder.add(vertexType, structType, Components.WORLD, pipelineShader); + builder.add(vertexType, structType, Contexts.WORLD, pipelineShader); } } } @@ -39,7 +39,7 @@ public class PipelineContextSet { return contexts.size(); } - private void add(VertexType vertexType, StructType structType, SimpleContext world, SimplePipeline pipelineShader) { + private void add(VertexType vertexType, StructType structType, Context world, Pipeline pipelineShader) { var ctx = new PipelineContext(vertexType, structType, world, pipelineShader); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/RecursiveIncluder.java b/src/main/java/com/jozufozu/flywheel/backend/compile/RecursiveIncluder.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/RecursiveIncluder.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/RecursiveIncluder.java index 031371097..38766c5ce 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/RecursiveIncluder.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/RecursiveIncluder.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.LinkedHashSet; import java.util.Set; import java.util.function.Consumer; import com.google.common.collect.ImmutableList; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; public class RecursiveIncluder implements Includer { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/ShaderCompiler.java b/src/main/java/com/jozufozu/flywheel/backend/compile/ShaderCompiler.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/ShaderCompiler.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/ShaderCompiler.java index f35bec3a0..2beadb80e 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/ShaderCompiler.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/ShaderCompiler.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.HashMap; import java.util.Map; @@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import com.google.common.collect.ImmutableList; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.gl.GLSLVersion; import com.jozufozu.flywheel.gl.shader.GlShader; import com.jozufozu.flywheel.gl.shader.ShaderType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/StringSubstitutionSourceComponent.java b/src/main/java/com/jozufozu/flywheel/backend/compile/StringSubstitutionSourceComponent.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/StringSubstitutionSourceComponent.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/StringSubstitutionSourceComponent.java index 52c341ea9..d7c2eed12 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/StringSubstitutionSourceComponent.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/StringSubstitutionSourceComponent.java @@ -1,9 +1,9 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.Collection; import java.util.Map; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.util.ResourceUtil; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/UniformComponent.java b/src/main/java/com/jozufozu/flywheel/backend/compile/UniformComponent.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/compile/UniformComponent.java rename to src/main/java/com/jozufozu/flywheel/backend/compile/UniformComponent.java index 04de57ebe..10d9fe7c3 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/UniformComponent.java +++ b/src/main/java/com/jozufozu/flywheel/backend/compile/UniformComponent.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.backend.instancing.compile; +package com.jozufozu.flywheel.backend.compile; import java.util.ArrayList; import java.util.Collection; import java.util.List; import com.google.common.collect.ImmutableList; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.glsl.ShaderSources; import com.jozufozu.flywheel.glsl.SourceFile; import com.jozufozu.flywheel.glsl.generate.GlslBuilder; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMeshPool.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchedMeshPool.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMeshPool.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchedMeshPool.java index 649c79989..777e1473c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMeshPool.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchedMeshPool.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.util.ArrayList; import java.util.HashMap; @@ -9,10 +9,10 @@ import org.jetbrains.annotations.Nullable; import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; import com.jozufozu.flywheel.api.vertex.VertexListProvider; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.model.Mesh; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; import com.mojang.blaze3d.vertex.VertexFormat; public class BatchedMeshPool { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingDrawTracker.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingDrawTracker.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingDrawTracker.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingDrawTracker.java index 329876a08..b423dcc96 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingDrawTracker.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingDrawTracker.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.util.EnumMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.extension.BufferBuilderExtension; import com.jozufozu.flywheel.extension.RenderTypeExtension; import com.mojang.blaze3d.vertex.BufferBuilder; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingEngine.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingEngine.java index 88c47df7c..0b091f6b4 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingEngine.java @@ -1,16 +1,16 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.util.List; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.backend.Engine; +import com.jozufozu.flywheel.api.event.RenderContext; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.Instancer; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.backend.instancing.Engine; +import com.jozufozu.flywheel.api.task.TaskExecutor; import com.jozufozu.flywheel.backend.instancing.InstanceManager; -import com.jozufozu.flywheel.backend.instancing.TaskExecutor; -import com.jozufozu.flywheel.core.RenderContext; -import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.util.FlwUtil; import com.mojang.blaze3d.vertex.PoseStack; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingTransformManager.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingTransformManager.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingTransformManager.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingTransformManager.java index e93032f79..4491e9710 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingTransformManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/BatchingTransformManager.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.util.ArrayList; import java.util.Collection; @@ -14,13 +14,13 @@ import org.jetbrains.annotations.NotNull; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ListMultimap; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.Instancer; +import com.jozufozu.flywheel.api.model.Mesh; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.backend.instancing.InstancerKey; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.Model; import com.mojang.blaze3d.vertex.VertexFormat; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/CPUInstancer.java similarity index 90% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/CPUInstancer.java index e65deb393..6bffb6938 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/CPUInstancer.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.struct.StructType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBuffer.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/DrawBuffer.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBuffer.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/DrawBuffer.java index 914982d06..20a4dcb7c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/DrawBuffer.java @@ -1,14 +1,14 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; +import com.jozufozu.flywheel.api.event.ReloadRenderersEvent; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; import com.jozufozu.flywheel.api.vertex.VertexListProvider; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.event.ReloadRenderersEvent; import com.jozufozu.flywheel.extension.BufferBuilderExtension; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; import com.mojang.blaze3d.vertex.VertexFormat; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBufferSet.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/DrawBufferSet.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBufferSet.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/DrawBufferSet.java index 56ccd328a..2d9b1630f 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/DrawBufferSet.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/DrawBufferSet.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.util.EnumMap; import java.util.Map; import org.jetbrains.annotations.ApiStatus; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.vertex.VertexListProvider; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/TransformCall.java b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/TransformCall.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/batching/TransformCall.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/batching/TransformCall.java index b2cf9c3e3..5aebed403 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/TransformCall.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/batching/TransformCall.java @@ -1,13 +1,13 @@ -package com.jozufozu.flywheel.backend.instancing.batching; +package com.jozufozu.flywheel.backend.engine.batching; import java.util.List; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.material.Material; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.api.task.TaskExecutor; import com.jozufozu.flywheel.api.vertex.MutableVertexList; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; -import com.jozufozu.flywheel.backend.instancing.TaskExecutor; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix3f; import com.mojang.math.Matrix4f; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectBuffers.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectBuffers.java index a76b661fb..1c1ffaa11 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectBuffers.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import static org.lwjgl.opengl.GL15.glBindBuffer; import static org.lwjgl.opengl.GL15.glDeleteBuffers; @@ -21,8 +21,8 @@ import static org.lwjgl.opengl.GL45.nglNamedBufferSubData; import org.lwjgl.system.MemoryUtil; import org.lwjgl.system.Pointer; -import com.jozufozu.flywheel.backend.memory.FlwMemoryTracker; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; public class IndirectBuffers { public static final int BUFFER_COUNT = 4; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectComponent.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectComponent.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectComponent.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectComponent.java index 219542599..7c0ce5533 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectComponent.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectComponent.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import java.util.Collection; import java.util.List; @@ -6,16 +6,16 @@ import java.util.List; import com.google.common.collect.ImmutableList; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.api.pipeline.Pipeline; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.core.Pipelines; -import com.jozufozu.flywheel.core.SourceComponent; -import com.jozufozu.flywheel.core.layout.LayoutItem; import com.jozufozu.flywheel.glsl.ShaderSources; import com.jozufozu.flywheel.glsl.SourceFile; import com.jozufozu.flywheel.glsl.generate.FnSignature; import com.jozufozu.flywheel.glsl.generate.GlslBlock; import com.jozufozu.flywheel.glsl.generate.GlslBuilder; import com.jozufozu.flywheel.glsl.generate.GlslExpr; +import com.jozufozu.flywheel.lib.layout.LayoutItem; +import com.jozufozu.flywheel.lib.pipeline.Pipelines; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectCullingGroup.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectCullingGroup.java index 56bd82f99..1c7ef6524 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectCullingGroup.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import static org.lwjgl.opengl.GL30.glBindVertexArray; import static org.lwjgl.opengl.GL30.glDeleteVertexArrays; @@ -11,15 +11,15 @@ import static org.lwjgl.opengl.GL45.glEnableVertexArrayAttrib; import static org.lwjgl.opengl.GL45.glVertexArrayElementBuffer; import static org.lwjgl.opengl.GL45.glVertexArrayVertexBuffer; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.instancing.compile.FlwCompiler; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.Pipelines; -import com.jozufozu.flywheel.core.QuadConverter; +import com.jozufozu.flywheel.backend.compile.FlwCompiler; import com.jozufozu.flywheel.gl.shader.GlProgram; +import com.jozufozu.flywheel.lib.context.Contexts; +import com.jozufozu.flywheel.lib.pipeline.Pipelines; +import com.jozufozu.flywheel.lib.util.QuadConverter; public class IndirectCullingGroup { @@ -62,7 +62,7 @@ public class IndirectCullingGroup { setupVertexArray(); compute = FlwCompiler.INSTANCE.getCullingProgram(structType); - draw = FlwCompiler.INSTANCE.getPipelineProgram(vertexType, structType, Components.WORLD, Pipelines.INDIRECT); + draw = FlwCompiler.INSTANCE.getPipelineProgram(vertexType, structType, Contexts.WORLD, Pipelines.INDIRECT); } private void setupVertexArray() { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDraw.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDraw.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDraw.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDraw.java index ce7d7f099..6baadda7c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDraw.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDraw.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.material.Material; -import com.jozufozu.flywheel.core.ComponentRegistry; public final class IndirectDraw { private final IndirectInstancer instancer; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDrawManager.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDrawManager.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDrawManager.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDrawManager.java index 9396be2e1..7cb47a1ae 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDrawManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDrawManager.java @@ -1,17 +1,17 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.Instancer; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.vertex.VertexType; import com.jozufozu.flywheel.backend.instancing.InstancerKey; -import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.util.Pair; public class IndirectDrawManager { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDrawSet.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDrawSet.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDrawSet.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDrawSet.java index c5715ea84..614a1866d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectDrawSet.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectDrawSet.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import static org.lwjgl.opengl.GL11.GL_TRIANGLES; import static org.lwjgl.opengl.GL11.GL_UNSIGNED_INT; @@ -10,10 +10,10 @@ import java.util.EnumMap; import java.util.List; import java.util.Map; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.material.Material; -import com.jozufozu.flywheel.core.ComponentRegistry; import com.jozufozu.flywheel.util.Textures; public class IndirectDrawSet { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectEngine.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectEngine.java similarity index 86% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectEngine.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectEngine.java index 24d26c739..d8056ab09 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectEngine.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectEngine.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import java.util.Collections; import java.util.List; @@ -6,16 +6,16 @@ import java.util.Set; import org.lwjgl.opengl.GL32; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.backend.Engine; +import com.jozufozu.flywheel.api.context.Context; +import com.jozufozu.flywheel.api.event.RenderContext; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.Instancer; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.backend.instancing.Engine; +import com.jozufozu.flywheel.api.task.TaskExecutor; import com.jozufozu.flywheel.backend.instancing.InstanceManager; -import com.jozufozu.flywheel.backend.instancing.TaskExecutor; -import com.jozufozu.flywheel.core.RenderContext; -import com.jozufozu.flywheel.core.context.SimpleContext; -import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.gl.GlStateTracker; import com.jozufozu.flywheel.gl.GlTextureUnit; import com.jozufozu.flywheel.util.FlwUtil; @@ -37,12 +37,12 @@ public class IndirectEngine implements Engine { */ private final Set> instanceManagers = FlwUtil.createWeakHashSet(); - protected final SimpleContext context; + protected final Context context; protected final int sqrMaxOriginDistance; protected BlockPos originCoordinate = BlockPos.ZERO; - public IndirectEngine(SimpleContext context, int sqrMaxOriginDistance) { + public IndirectEngine(Context context, int sqrMaxOriginDistance) { this.context = context; this.sqrMaxOriginDistance = sqrMaxOriginDistance; } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectInstancer.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectInstancer.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectInstancer.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectInstancer.java index e1a44890c..cf8fca1c0 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectInstancer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectInstancer.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import org.lwjgl.system.MemoryUtil; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectMeshPool.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectMeshPool.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectMeshPool.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectMeshPool.java index d18671817..f7da98d36 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectMeshPool.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/IndirectMeshPool.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import static org.lwjgl.opengl.GL15.glDeleteBuffers; import static org.lwjgl.opengl.GL44.GL_DYNAMIC_STORAGE_BIT; @@ -13,9 +13,9 @@ import java.util.Map; import org.jetbrains.annotations.Nullable; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.model.Mesh; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; public class IndirectMeshPool { private final VertexType vertexType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/ShaderState.java b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/ShaderState.java similarity index 80% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/ShaderState.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/indirect/ShaderState.java index 7f1844eb2..5c1cec97e 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/ShaderState.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/indirect/ShaderState.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.indirect; +package com.jozufozu.flywheel.backend.engine.indirect; import com.jozufozu.flywheel.api.material.Material; import com.jozufozu.flywheel.api.struct.StructType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/DrawCall.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/DrawCall.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/DrawCall.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/DrawCall.java index df24fe3b5..7c86e5f3e 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/DrawCall.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/DrawCall.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import com.jozufozu.flywheel.api.material.Material; import com.jozufozu.flywheel.api.vertex.VertexType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/ElementBuffer.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/ElementBuffer.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/ElementBuffer.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/ElementBuffer.java index d5bbb1f31..556b8026d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/ElementBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/ElementBuffer.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import com.jozufozu.flywheel.gl.buffer.GlBufferType; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/GPUInstancer.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/GPUInstancer.java index 1e4ecea3d..a3662cfd5 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/GPUInstancer.java @@ -1,14 +1,14 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import java.util.HashSet; import java.util.Set; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.api.instancer.InstancedPart; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.struct.StructWriter; import com.jozufozu.flywheel.backend.instancing.AbstractInstancer; -import com.jozufozu.flywheel.core.layout.BufferLayout; import com.jozufozu.flywheel.gl.array.GlVertexArray; import com.jozufozu.flywheel.gl.buffer.GlBuffer; import com.jozufozu.flywheel.gl.buffer.GlBufferType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedArraysComponent.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancedArraysComponent.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedArraysComponent.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancedArraysComponent.java index 518ff101c..97fd22f38 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedArraysComponent.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancedArraysComponent.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import java.util.Collection; import java.util.Collections; @@ -6,12 +6,12 @@ import java.util.List; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.api.pipeline.Pipeline; -import com.jozufozu.flywheel.core.SourceComponent; -import com.jozufozu.flywheel.core.layout.LayoutItem; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.glsl.generate.FnSignature; import com.jozufozu.flywheel.glsl.generate.GlslBlock; import com.jozufozu.flywheel.glsl.generate.GlslBuilder; import com.jozufozu.flywheel.glsl.generate.GlslExpr; +import com.jozufozu.flywheel.lib.layout.LayoutItem; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMeshPool.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancedMeshPool.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMeshPool.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancedMeshPool.java index 71ecad955..155dd3e19 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMeshPool.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancedMeshPool.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import java.util.ArrayList; import java.util.HashMap; @@ -11,8 +11,8 @@ import org.jetbrains.annotations.Nullable; import org.lwjgl.opengl.GL32; import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.core.model.Mesh; import com.jozufozu.flywheel.gl.GlPrimitive; import com.jozufozu.flywheel.gl.array.GlVertexArray; import com.jozufozu.flywheel.gl.buffer.GlBuffer; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingDrawManager.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancingDrawManager.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingDrawManager.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancingDrawManager.java index 6bd7d40f1..459397b3d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingDrawManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancingDrawManager.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import java.util.ArrayList; import java.util.Collection; @@ -13,14 +13,14 @@ import org.jetbrains.annotations.NotNull; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ListMultimap; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.Instancer; +import com.jozufozu.flywheel.api.model.Mesh; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.vertex.VertexType; import com.jozufozu.flywheel.backend.instancing.InstancerKey; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.Model; public class InstancingDrawManager { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancingEngine.java similarity index 86% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancingEngine.java index 09ebd637b..fa3f88cdb 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/InstancingEngine.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import java.util.Collections; import java.util.List; @@ -6,21 +6,21 @@ import java.util.Set; import org.lwjgl.opengl.GL32; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.backend.Engine; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.context.Context; +import com.jozufozu.flywheel.api.event.RenderContext; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.Instancer; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.backend.instancing.Engine; +import com.jozufozu.flywheel.api.task.TaskExecutor; +import com.jozufozu.flywheel.backend.compile.FlwCompiler; import com.jozufozu.flywheel.backend.instancing.InstanceManager; -import com.jozufozu.flywheel.backend.instancing.TaskExecutor; -import com.jozufozu.flywheel.backend.instancing.compile.FlwCompiler; -import com.jozufozu.flywheel.core.ComponentRegistry; -import com.jozufozu.flywheel.core.Pipelines; -import com.jozufozu.flywheel.core.RenderContext; -import com.jozufozu.flywheel.core.context.SimpleContext; -import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.gl.GlStateTracker; import com.jozufozu.flywheel.gl.GlTextureUnit; +import com.jozufozu.flywheel.lib.pipeline.Pipelines; import com.jozufozu.flywheel.util.FlwUtil; import com.mojang.blaze3d.systems.RenderSystem; @@ -40,12 +40,12 @@ public class InstancingEngine implements Engine { */ private final Set> instanceManagers = FlwUtil.createWeakHashSet(); - protected final SimpleContext context; + protected final Context context; protected final int sqrMaxOriginDistance; protected BlockPos originCoordinate = BlockPos.ZERO; - public InstancingEngine(SimpleContext context, int sqrMaxOriginDistance) { + public InstancingEngine(Context context, int sqrMaxOriginDistance) { this.context = context; this.sqrMaxOriginDistance = sqrMaxOriginDistance; } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/ShaderState.java b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/ShaderState.java similarity index 80% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/ShaderState.java rename to src/main/java/com/jozufozu/flywheel/backend/engine/instancing/ShaderState.java index 70bbdea73..c38be8946 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/ShaderState.java +++ b/src/main/java/com/jozufozu/flywheel/backend/engine/instancing/ShaderState.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; +package com.jozufozu.flywheel.backend.engine.instancing; import com.jozufozu.flywheel.api.material.Material; import com.jozufozu.flywheel.api.struct.StructType; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java index a01577dc9..aa9c0b083 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java @@ -6,9 +6,9 @@ import java.util.stream.Stream; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.Instance; import com.jozufozu.flywheel.api.instance.TickableInstance; +import com.jozufozu.flywheel.api.instancer.FlatLit; import com.jozufozu.flywheel.api.instancer.InstancerManager; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstanceManager; -import com.jozufozu.flywheel.core.structs.FlatLit; import com.jozufozu.flywheel.light.LightListener; import com.jozufozu.flywheel.util.box.ImmutableBox; @@ -50,7 +50,7 @@ public abstract class AbstractInstance implements Instance, LightListener { /** * Free any acquired resources. */ - protected abstract void remove(); + public abstract void remove(); /** * Update instance data here. Good for when data doesn't change very often and when animations are GPU based. diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java index 7b92033c2..51e3b7c22 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java @@ -9,14 +9,16 @@ import java.util.function.Consumer; import org.joml.FrustumIntersection; +import com.jozufozu.flywheel.api.event.RenderContext; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.TickableInstance; +import com.jozufozu.flywheel.api.task.TaskExecutor; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.ratelimit.BandedPrimeLimiter; import com.jozufozu.flywheel.backend.instancing.ratelimit.DistanceUpdateLimiter; import com.jozufozu.flywheel.backend.instancing.ratelimit.NonLimiter; +import com.jozufozu.flywheel.backend.instancing.storage.Storage; import com.jozufozu.flywheel.config.FlwConfig; -import com.jozufozu.flywheel.core.RenderContext; import com.jozufozu.flywheel.light.LightUpdater; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java index c0b375c71..3ba4849a4 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java @@ -1,6 +1,9 @@ package com.jozufozu.flywheel.backend.instancing; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.backend.Engine; +import com.jozufozu.flywheel.api.event.BeginFrameEvent; +import com.jozufozu.flywheel.api.event.RenderContext; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.TickableInstance; import com.jozufozu.flywheel.backend.Backend; @@ -8,8 +11,7 @@ import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstanceM import com.jozufozu.flywheel.backend.instancing.effect.Effect; import com.jozufozu.flywheel.backend.instancing.effect.EffectInstanceManager; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstanceManager; -import com.jozufozu.flywheel.core.RenderContext; -import com.jozufozu.flywheel.event.BeginFrameEvent; +import com.jozufozu.flywheel.backend.task.ParallelTaskExecutor; import com.jozufozu.flywheel.extension.ClientLevelExtension; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java index ac962230d..09ba5491b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java @@ -2,13 +2,13 @@ package com.jozufozu.flywheel.backend.instancing; import java.util.List; +import com.jozufozu.flywheel.api.event.BeginFrameEvent; +import com.jozufozu.flywheel.api.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.api.event.RenderStageEvent; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.effect.Effect; import com.jozufozu.flywheel.config.FlwCommands; import com.jozufozu.flywheel.config.FlwConfig; -import com.jozufozu.flywheel.event.BeginFrameEvent; -import com.jozufozu.flywheel.event.ReloadRenderersEvent; -import com.jozufozu.flywheel.event.RenderStageEvent; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.WorldAttached; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancerKey.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancerKey.java index aeb4dcb21..22b8c1d02 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancerKey.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancerKey.java @@ -1,9 +1,9 @@ package com.jozufozu.flywheel.backend.instancing; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instancer.InstancedPart; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.core.model.Model; public record InstancerKey(StructType type, Model model, RenderStage stage) { } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/package-info.java deleted file mode 100644 index 0a8a7db98..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.batching; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/BlockEntityInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/BlockEntityInstanceManager.java index 7daf01429..fa490ee2a 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/BlockEntityInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/BlockEntityInstanceManager.java @@ -7,8 +7,8 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import com.jozufozu.flywheel.backend.instancing.One2OneStorage; -import com.jozufozu.flywheel.backend.instancing.Storage; +import com.jozufozu.flywheel.backend.instancing.storage.One2OneStorage; +import com.jozufozu.flywheel.backend.instancing.storage.Storage; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/package-info.java deleted file mode 100644 index ceb2b6de9..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/blockentity/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.blockentity; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/package-info.java deleted file mode 100644 index ddcf60e2e..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/compile/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.compile; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/EffectInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/EffectInstanceManager.java index 3a57e6673..7283eed47 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/EffectInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/EffectInstanceManager.java @@ -6,9 +6,9 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.jozufozu.flywheel.api.instancer.InstancerManager; import com.jozufozu.flywheel.backend.instancing.AbstractInstance; -import com.jozufozu.flywheel.backend.instancing.AbstractStorage; import com.jozufozu.flywheel.backend.instancing.InstanceManager; -import com.jozufozu.flywheel.backend.instancing.Storage; +import com.jozufozu.flywheel.backend.instancing.storage.AbstractStorage; +import com.jozufozu.flywheel.backend.instancing.storage.Storage; import com.jozufozu.flywheel.light.LightUpdater; public class EffectInstanceManager extends InstanceManager { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/package-info.java deleted file mode 100644 index 8be4dc051..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/effect/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.effect; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java index 04779dfb5..1832d8bdf 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java @@ -7,7 +7,7 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import com.jozufozu.flywheel.backend.instancing.One2OneStorage; +import com.jozufozu.flywheel.backend.instancing.storage.One2OneStorage; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java deleted file mode 100644 index feeb161a1..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.entity; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/package-info.java deleted file mode 100644 index 6ec4f9bda..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.indirect; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/package-info.java deleted file mode 100644 index 740e8a1a2..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing.instancing; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java deleted file mode 100644 index 6b642e1f6..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend.instancing; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractStorage.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/storage/AbstractStorage.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractStorage.java rename to src/main/java/com/jozufozu/flywheel/backend/instancing/storage/AbstractStorage.java index b1c666bbc..6dcb3df21 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractStorage.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/storage/AbstractStorage.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend.instancing.storage; import java.util.ArrayList; import java.util.List; @@ -6,6 +6,7 @@ import java.util.List; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.TickableInstance; import com.jozufozu.flywheel.api.instancer.InstancerManager; +import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.light.LightUpdater; public abstract class AbstractStorage implements Storage { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/One2OneStorage.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/storage/One2OneStorage.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/One2OneStorage.java rename to src/main/java/com/jozufozu/flywheel/backend/instancing/storage/One2OneStorage.java index a58860944..6a8dacd8e 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/One2OneStorage.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/storage/One2OneStorage.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend.instancing.storage; import java.util.HashMap; import java.util.Map; @@ -6,6 +6,7 @@ import java.util.Map; import org.jetbrains.annotations.Nullable; import com.jozufozu.flywheel.api.instancer.InstancerManager; +import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.light.LightUpdater; public abstract class One2OneStorage extends AbstractStorage { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/Storage.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/storage/Storage.java similarity index 78% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/Storage.java rename to src/main/java/com/jozufozu/flywheel/backend/instancing/storage/Storage.java index 7c28f395c..0f6bd278c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/Storage.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/storage/Storage.java @@ -1,9 +1,10 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend.instancing.storage; import java.util.List; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.TickableInstance; +import com.jozufozu.flywheel.backend.instancing.AbstractInstance; public interface Storage { int getObjectCount(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/package-info.java b/src/main/java/com/jozufozu/flywheel/backend/package-info.java deleted file mode 100644 index 6f01179a5..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.backend; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/ParallelTaskExecutor.java b/src/main/java/com/jozufozu/flywheel/backend/task/ParallelTaskExecutor.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/ParallelTaskExecutor.java rename to src/main/java/com/jozufozu/flywheel/backend/task/ParallelTaskExecutor.java index 95c231000..e8917fcad 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/ParallelTaskExecutor.java +++ b/src/main/java/com/jozufozu/flywheel/backend/task/ParallelTaskExecutor.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend.task; import java.util.ArrayList; import java.util.Deque; @@ -10,6 +10,7 @@ import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.task.TaskExecutor; import com.mojang.logging.LogUtils; import net.minecraft.util.Mth; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/SerialTaskExecutor.java b/src/main/java/com/jozufozu/flywheel/backend/task/SerialTaskExecutor.java similarity index 78% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/SerialTaskExecutor.java rename to src/main/java/com/jozufozu/flywheel/backend/task/SerialTaskExecutor.java index 7a97d74ea..dc2fd905c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/SerialTaskExecutor.java +++ b/src/main/java/com/jozufozu/flywheel/backend/task/SerialTaskExecutor.java @@ -1,4 +1,6 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend.task; + +import com.jozufozu.flywheel.api.task.TaskExecutor; public class SerialTaskExecutor implements TaskExecutor { public static final SerialTaskExecutor INSTANCE = new SerialTaskExecutor(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/WorkGroup.java b/src/main/java/com/jozufozu/flywheel/backend/task/WorkGroup.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/instancing/WorkGroup.java rename to src/main/java/com/jozufozu/flywheel/backend/task/WorkGroup.java index 3ea1692c8..904687557 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/WorkGroup.java +++ b/src/main/java/com/jozufozu/flywheel/backend/task/WorkGroup.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.instancing; +package com.jozufozu.flywheel.backend.task; import java.util.Iterator; import java.util.concurrent.Executor; diff --git a/src/main/java/com/jozufozu/flywheel/core/uniform/UniformBuffer.java b/src/main/java/com/jozufozu/flywheel/backend/uniform/UniformBuffer.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/core/uniform/UniformBuffer.java rename to src/main/java/com/jozufozu/flywheel/backend/uniform/UniformBuffer.java index 40c759e78..540c1e0f3 100644 --- a/src/main/java/com/jozufozu/flywheel/core/uniform/UniformBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/uniform/UniformBuffer.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.uniform; +package com.jozufozu.flywheel.backend.uniform; import java.util.Collection; import java.util.List; @@ -6,11 +6,11 @@ import java.util.List; import org.lwjgl.opengl.GL32; import com.google.common.collect.ImmutableList; +import com.jozufozu.flywheel.api.component.ComponentRegistry; import com.jozufozu.flywheel.api.uniform.ShaderUniforms; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.ComponentRegistry; import com.jozufozu.flywheel.gl.buffer.GlBuffer; import com.jozufozu.flywheel.gl.buffer.GlBufferType; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; import com.jozufozu.flywheel.util.FlwUtil; import com.jozufozu.flywheel.util.RenderMath; diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexFormatInfo.java b/src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexFormatInfo.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexFormatInfo.java rename to src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexFormatInfo.java index 9b95a94e0..f5c0f0345 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexFormatInfo.java +++ b/src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexFormatInfo.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.backend.vertex; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexListImpl.java b/src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexListImpl.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexListImpl.java rename to src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexListImpl.java index fd5bf780e..4bf8aa6da 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexListImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexListImpl.java @@ -1,8 +1,9 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.backend.vertex; import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; +import com.jozufozu.flywheel.lib.format.AbstractVertexList; import com.jozufozu.flywheel.util.RenderMath; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexListProviderImpl.java b/src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexListProviderImpl.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexListProviderImpl.java rename to src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexListProviderImpl.java index fd976aa6b..71f75c014 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/InferredVertexListProviderImpl.java +++ b/src/main/java/com/jozufozu/flywheel/backend/vertex/InferredVertexListProviderImpl.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.backend.vertex; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; import com.jozufozu.flywheel.api.vertex.VertexListProvider; diff --git a/src/main/java/com/jozufozu/flywheel/config/BackendTypeArgument.java b/src/main/java/com/jozufozu/flywheel/config/BackendTypeArgument.java index 90bc069f1..209a765d3 100644 --- a/src/main/java/com/jozufozu/flywheel/config/BackendTypeArgument.java +++ b/src/main/java/com/jozufozu/flywheel/config/BackendTypeArgument.java @@ -3,8 +3,8 @@ package com.jozufozu.flywheel.config; import java.util.Collection; import java.util.concurrent.CompletableFuture; -import com.jozufozu.flywheel.backend.BackendType; -import com.jozufozu.flywheel.core.BackendTypes; +import com.jozufozu.flywheel.api.backend.BackendType; +import com.jozufozu.flywheel.lib.backend.BackendTypes; import com.mojang.brigadier.StringReader; import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.context.CommandContext; diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java index 9b89fe2ce..477a3c619 100644 --- a/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java +++ b/src/main/java/com/jozufozu/flywheel/config/FlwCommands.java @@ -4,11 +4,11 @@ import java.util.function.BiConsumer; import org.jetbrains.annotations.NotNull; +import com.jozufozu.flywheel.api.backend.BackendType; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.backend.BackendType; -import com.jozufozu.flywheel.backend.SimpleBackendType; -import com.jozufozu.flywheel.core.BackendTypes; -import com.jozufozu.flywheel.core.uniform.FlwShaderUniforms; +import com.jozufozu.flywheel.lib.backend.BackendTypes; +import com.jozufozu.flywheel.lib.backend.SimpleBackendType; +import com.jozufozu.flywheel.lib.uniform.FlwShaderUniforms; import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.IntegerArgumentType; diff --git a/src/main/java/com/jozufozu/flywheel/config/FlwConfig.java b/src/main/java/com/jozufozu/flywheel/config/FlwConfig.java index 611b1fbec..047cd6d79 100644 --- a/src/main/java/com/jozufozu/flywheel/config/FlwConfig.java +++ b/src/main/java/com/jozufozu/flywheel/config/FlwConfig.java @@ -3,8 +3,8 @@ package com.jozufozu.flywheel.config; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; -import com.jozufozu.flywheel.backend.BackendType; -import com.jozufozu.flywheel.core.BackendTypes; +import com.jozufozu.flywheel.api.backend.BackendType; +import com.jozufozu.flywheel.lib.backend.BackendTypes; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; diff --git a/src/main/java/com/jozufozu/flywheel/config/package-info.java b/src/main/java/com/jozufozu/flywheel/config/package-info.java deleted file mode 100644 index 01b8f8ae7..000000000 --- a/src/main/java/com/jozufozu/flywheel/config/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.config; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/Components.java b/src/main/java/com/jozufozu/flywheel/core/Components.java deleted file mode 100644 index a4502e3a7..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/Components.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.jozufozu.flywheel.core; - -import com.jozufozu.flywheel.Flywheel; -import com.jozufozu.flywheel.core.context.SimpleContext; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.core.uniform.FlwShaderUniforms; -import com.jozufozu.flywheel.core.vertex.Formats; -import com.jozufozu.flywheel.util.ResourceUtil; - -import net.minecraft.resources.ResourceLocation; - -public class Components { - - - public static final FlwShaderUniforms UNIFORM_PROVIDER = ComponentRegistry.register(new FlwShaderUniforms()); - public static final SimpleContext WORLD = ComponentRegistry.register(new SimpleContext(Files.WORLD_VERTEX, Files.WORLD_FRAGMENT)); - public static final SimpleContext CRUMBLING = ComponentRegistry.register(new SimpleContext(Files.WORLD_VERTEX, Files.CRUMBLING_FRAGMENT)); - - public static void init() { - Formats.init(); - StructTypes.init(); - Materials.init(); - Pipelines.init(); - } - - public static class Files { - - public static final ResourceLocation UNIFORMS = Flywheel.rl("uniform/flywheel.glsl"); - public static final ResourceLocation BLOCK_LAYOUT = ResourceUtil.subPath(Names.BLOCK, ".vert"); - public static final ResourceLocation POS_TEX_NORMAL_LAYOUT = ResourceUtil.subPath(Names.POS_TEX_NORMAL, ".vert"); - public static final ResourceLocation TRANSFORMED = ResourceUtil.subPath(Names.TRANSFORMED, ".vert"); - public static final ResourceLocation ORIENTED = ResourceUtil.subPath(Names.ORIENTED, ".vert"); - public static final ResourceLocation DEFAULT_VERTEX = ResourceUtil.subPath(Names.DEFAULT, ".vert"); - public static final ResourceLocation SHADED_VERTEX = ResourceUtil.subPath(Names.SHADED, ".vert"); - public static final ResourceLocation DEFAULT_FRAGMENT = ResourceUtil.subPath(Names.DEFAULT, ".frag"); - public static final ResourceLocation CUTOUT_FRAGMENT = ResourceUtil.subPath(Names.CUTOUT, ".frag"); - public static final ResourceLocation WORLD_VERTEX = ResourceUtil.subPath(Names.WORLD, ".vert"); - public static final ResourceLocation WORLD_FRAGMENT = ResourceUtil.subPath(Names.WORLD, ".frag"); - public static final ResourceLocation CRUMBLING_VERTEX = ResourceUtil.subPath(Names.CRUMBLING, ".vert"); - public static final ResourceLocation CRUMBLING_FRAGMENT = ResourceUtil.subPath(Names.CRUMBLING, ".frag"); - } - - public static class Names { - public static final ResourceLocation BLOCK = Flywheel.rl("layout/block"); - public static final ResourceLocation POS_TEX_NORMAL = Flywheel.rl("layout/pos_tex_normal"); - - public static final ResourceLocation TRANSFORMED = Flywheel.rl("instance/transformed"); - public static final ResourceLocation ORIENTED = Flywheel.rl("instance/oriented"); - - public static final ResourceLocation DEFAULT = Flywheel.rl("material/default"); - public static final ResourceLocation CUTOUT = Flywheel.rl("material/cutout"); - public static final ResourceLocation SHADED = Flywheel.rl("material/shaded"); - public static final ResourceLocation WORLD = Flywheel.rl("context/world"); - public static final ResourceLocation CRUMBLING = Flywheel.rl("context/crumbling"); - public static final ResourceLocation DRAW_INDIRECT = Flywheel.rl("compute/draw_instances"); - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java deleted file mode 100644 index a08f27ab8..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.jozufozu.flywheel.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.client.renderer.texture.TextureAtlas; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.inventory.InventoryMenu; -import net.minecraftforge.client.event.TextureStitchEvent; - -public class StitchedSprite { - private static final Map> ALL = new HashMap<>(); - - protected final ResourceLocation atlasLocation; - protected final ResourceLocation location; - protected TextureAtlasSprite sprite; - - public StitchedSprite(ResourceLocation atlas, ResourceLocation location) { - atlasLocation = atlas; - this.location = location; - ALL.computeIfAbsent(atlasLocation, $ -> new ArrayList<>()).add(this); - } - - public StitchedSprite(ResourceLocation location) { - this(InventoryMenu.BLOCK_ATLAS, location); - } - - public static void onTextureStitchPre(TextureStitchEvent.Pre event) { - ResourceLocation atlasLocation = event.getAtlas().location(); - List sprites = ALL.get(atlasLocation); - if (sprites != null) { - for (StitchedSprite sprite : sprites) { - event.addSprite(sprite.getLocation()); - } - } - } - - public static void onTextureStitchPost(TextureStitchEvent.Post event) { - TextureAtlas atlas = event.getAtlas(); - ResourceLocation atlasLocation = atlas.location(); - List sprites = ALL.get(atlasLocation); - if (sprites != null) { - for (StitchedSprite sprite : sprites) { - sprite.loadSprite(atlas); - } - } - } - - protected void loadSprite(TextureAtlas atlas) { - sprite = atlas.getSprite(location); - } - - public ResourceLocation getAtlasLocation() { - return atlasLocation; - } - - public ResourceLocation getLocation() { - return location; - } - - public TextureAtlasSprite get() { - return sprite; - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java deleted file mode 100644 index df35fda0f..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.crumbling; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/hardcoded/package-info.java b/src/main/java/com/jozufozu/flywheel/core/hardcoded/package-info.java deleted file mode 100644 index f90a44c62..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/hardcoded/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.hardcoded; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/instancing/ConditionalInstance.java b/src/main/java/com/jozufozu/flywheel/core/instancing/ConditionalInstance.java deleted file mode 100644 index d915d63b8..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/instancing/ConditionalInstance.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.jozufozu.flywheel.core.instancing; - -import java.util.Optional; -import java.util.function.Consumer; - -import org.jetbrains.annotations.Nullable; - -import com.jozufozu.flywheel.api.instancer.InstancedPart; -import com.jozufozu.flywheel.api.instancer.Instancer; - -public class ConditionalInstance { - - final Instancer model; - ICondition condition; - - Consumer setupFunc; - - @Nullable - private D instance; - - public ConditionalInstance(Instancer model) { - this.model = model; - this.condition = () -> true; - } - - public ConditionalInstance withSetupFunc(Consumer setupFunc) { - this.setupFunc = setupFunc; - return this; - } - - public ConditionalInstance withCondition(ICondition condition) { - this.condition = condition; - return this; - } - - public ConditionalInstance update() { - boolean shouldShow = condition.shouldShow(); - if (shouldShow && instance == null) { - instance = model.createInstance(); - if (setupFunc != null) setupFunc.accept(instance); - } else if (!shouldShow && instance != null) { - instance.delete(); - instance = null; - } - - return this; - } - - public Optional get() { - return Optional.ofNullable(instance); - } - - public void delete() { - if (instance != null) instance.delete(); - } - - @FunctionalInterface - public interface ICondition { - boolean shouldShow(); - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/instancing/GroupInstance.java b/src/main/java/com/jozufozu/flywheel/core/instancing/GroupInstance.java deleted file mode 100644 index a48c5c3a9..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/instancing/GroupInstance.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.jozufozu.flywheel.core.instancing; - -import java.util.AbstractCollection; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import com.jozufozu.flywheel.api.instancer.InstancedPart; -import com.jozufozu.flywheel.api.instancer.Instancer; - -public class GroupInstance extends AbstractCollection { - - final Instancer model; - final List backing; - - public GroupInstance(Instancer model) { - this.model = model; - - this.backing = new ArrayList<>(); - } - - public GroupInstance(Instancer model, int size) { - this.model = model; - - this.backing = new ArrayList<>(size); - - for (int i = 0; i < size; i++) { - addInstance(); - } - } - - /** - * @param count - * @return True if the number of elements changed. - */ - public boolean resize(int count) { - int size = size(); - if (count == size) return false; - - if (count <= 0) { - clear(); - return size > 0; - } - - if (count > size) { - for (int i = size; i < count; i++) { - addInstance(); - } - } else { - List unnecessary = backing.subList(count, size); - unnecessary.forEach(InstancedPart::delete); - unnecessary.clear(); - } - - return true; - } - - public InstancedPart addInstance() { - D instance = model.createInstance(); - backing.add(instance); - - return instance; - } - - public D get(int index) { - return backing.get(index); - } - - @Override - public Iterator iterator() { - return backing.iterator(); - } - - @Override - public int size() { - return backing.size(); - } - - @Override - public void clear() { - backing.forEach(InstancedPart::delete); - backing.clear(); - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/instancing/SelectInstance.java b/src/main/java/com/jozufozu/flywheel/core/instancing/SelectInstance.java deleted file mode 100644 index d8fdf5cf4..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/instancing/SelectInstance.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.jozufozu.flywheel.core.instancing; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import org.jetbrains.annotations.Nullable; - -import com.jozufozu.flywheel.api.instancer.InstancedPart; -import com.jozufozu.flywheel.api.instancer.Instancer; - -public class SelectInstance { - - final List> models; - - ModelSelector selector; - - private int last = -1; - @Nullable - private D current; - - public SelectInstance(ModelSelector selector) { - this.models = new ArrayList<>(); - this.selector = selector; - } - - public SelectInstance addModel(Instancer model) { - models.add(model); - return this; - } - - public SelectInstance update() { - int i = selector.modelIndexToShow(); - - if (i < 0 || i >= models.size()) { - if (current != null) { - current.delete(); - current = null; - } - } else if (i != last) { - if (current != null) current.delete(); - - current = models.get(i) - .createInstance(); - } - - last = i; - return this; - } - - public Optional get() { - return Optional.ofNullable(current); - } - - public void delete() { - if (current != null) current.delete(); - } - - public interface ModelSelector { - int modelIndexToShow(); - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/package-info.java b/src/main/java/com/jozufozu/flywheel/core/layout/package-info.java deleted file mode 100644 index 3f91c99ea..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/layout/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.layout; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/package-info.java b/src/main/java/com/jozufozu/flywheel/core/model/package-info.java deleted file mode 100644 index c05e3867b..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/model/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.model; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/package-info.java b/src/main/java/com/jozufozu/flywheel/core/package-info.java deleted file mode 100644 index 7962f9fca..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/StructTypes.java b/src/main/java/com/jozufozu/flywheel/core/structs/StructTypes.java deleted file mode 100644 index 597a2a43c..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/structs/StructTypes.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.jozufozu.flywheel.core.structs; - -import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.core.ComponentRegistry; -import com.jozufozu.flywheel.core.structs.oriented.OrientedPart; -import com.jozufozu.flywheel.core.structs.oriented.OrientedType; -import com.jozufozu.flywheel.core.structs.transformed.TransformedPart; -import com.jozufozu.flywheel.core.structs.transformed.TransformedType; - -public class StructTypes { - public static final StructType TRANSFORMED = ComponentRegistry.register(new TransformedType()); - public static final StructType ORIENTED = ComponentRegistry.register(new OrientedType()); - - public static void init() { - // noop - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/package-info.java b/src/main/java/com/jozufozu/flywheel/core/structs/oriented/package-info.java deleted file mode 100644 index 202eba8c7..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.structs.oriented; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/package-info.java b/src/main/java/com/jozufozu/flywheel/core/structs/package-info.java deleted file mode 100644 index c207d09fc..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/structs/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.structs; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/package-info.java b/src/main/java/com/jozufozu/flywheel/core/structs/transformed/package-info.java deleted file mode 100644 index 2ca2a5ed4..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.structs.transformed; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/Formats.java b/src/main/java/com/jozufozu/flywheel/core/vertex/Formats.java deleted file mode 100644 index 8c2c31e03..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/Formats.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.jozufozu.flywheel.core.vertex; - -import com.jozufozu.flywheel.core.ComponentRegistry; - -public class Formats { - public static final BlockVertex BLOCK = ComponentRegistry.register(new BlockVertex()); - public static final PosTexNormalVertex POS_TEX_NORMAL = ComponentRegistry.register(new PosTexNormalVertex()); - - public static void init() { - // noop - } -} diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/package-info.java b/src/main/java/com/jozufozu/flywheel/core/vertex/package-info.java deleted file mode 100644 index 23a097290..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.vertex; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/package-info.java b/src/main/java/com/jozufozu/flywheel/core/virtual/package-info.java deleted file mode 100644 index c9b5451c0..000000000 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.core.virtual; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/event/package-info.java b/src/main/java/com/jozufozu/flywheel/event/package-info.java deleted file mode 100644 index 5c2bd7fe5..000000000 --- a/src/main/java/com/jozufozu/flywheel/event/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.event; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java b/src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java index 9d361f1a7..d132ab426 100644 --- a/src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java +++ b/src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java @@ -1,6 +1,6 @@ package com.jozufozu.flywheel.extension; -import com.jozufozu.flywheel.backend.instancing.batching.DrawBufferSet; +import com.jozufozu.flywheel.backend.engine.batching.DrawBufferSet; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/jozufozu/flywheel/gl/array/GlVertexArray.java b/src/main/java/com/jozufozu/flywheel/gl/array/GlVertexArray.java index 2c24524ea..2513c44e6 100644 --- a/src/main/java/com/jozufozu/flywheel/gl/array/GlVertexArray.java +++ b/src/main/java/com/jozufozu/flywheel/gl/array/GlVertexArray.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.gl.array; import org.lwjgl.opengl.GL20; import org.lwjgl.opengl.GL32; -import com.jozufozu.flywheel.core.layout.BufferLayout; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.gl.GlObject; import com.jozufozu.flywheel.gl.GlStateTracker; import com.jozufozu.flywheel.gl.buffer.GlBuffer; diff --git a/src/main/java/com/jozufozu/flywheel/gl/buffer/GlBuffer.java b/src/main/java/com/jozufozu/flywheel/gl/buffer/GlBuffer.java index ac92303eb..29580bfd8 100644 --- a/src/main/java/com/jozufozu/flywheel/gl/buffer/GlBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/gl/buffer/GlBuffer.java @@ -10,11 +10,11 @@ import static org.lwjgl.opengl.GL31.glCopyBufferSubData; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.backend.memory.FlwMemoryTracker; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; import com.jozufozu.flywheel.gl.GlObject; import com.jozufozu.flywheel.gl.error.GlError; import com.jozufozu.flywheel.gl.error.GlException; +import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; public class GlBuffer extends GlObject { diff --git a/src/main/java/com/jozufozu/flywheel/gl/buffer/package-info.java b/src/main/java/com/jozufozu/flywheel/gl/buffer/package-info.java deleted file mode 100644 index fb174795e..000000000 --- a/src/main/java/com/jozufozu/flywheel/gl/buffer/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.gl.buffer; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/gl/package-info.java b/src/main/java/com/jozufozu/flywheel/gl/package-info.java deleted file mode 100644 index 82ecdbdd6..000000000 --- a/src/main/java/com/jozufozu/flywheel/gl/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.gl; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/gl/shader/GlProgram.java b/src/main/java/com/jozufozu/flywheel/gl/shader/GlProgram.java index 7d1a660bb..58459e5ae 100644 --- a/src/main/java/com/jozufozu/flywheel/gl/shader/GlProgram.java +++ b/src/main/java/com/jozufozu/flywheel/gl/shader/GlProgram.java @@ -5,7 +5,7 @@ import static org.lwjgl.opengl.GL20.glGetUniformLocation; import static org.lwjgl.opengl.GL20.glUniform1i; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.core.uniform.UniformBuffer; +import com.jozufozu.flywheel.backend.uniform.UniformBuffer; import com.jozufozu.flywheel.gl.GlObject; import com.mojang.blaze3d.shaders.ProgramManager; diff --git a/src/main/java/com/jozufozu/flywheel/gl/shader/package-info.java b/src/main/java/com/jozufozu/flywheel/gl/shader/package-info.java deleted file mode 100644 index 78a29d6a7..000000000 --- a/src/main/java/com/jozufozu/flywheel/gl/shader/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.gl.shader; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/glsl/SourceFile.java b/src/main/java/com/jozufozu/flywheel/glsl/SourceFile.java index 2dc6ce5c2..1bed80c4c 100644 --- a/src/main/java/com/jozufozu/flywheel/glsl/SourceFile.java +++ b/src/main/java/com/jozufozu/flywheel/glsl/SourceFile.java @@ -9,7 +9,7 @@ import java.util.regex.Matcher; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.jozufozu.flywheel.core.SourceComponent; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.glsl.parse.Import; import com.jozufozu.flywheel.glsl.parse.ShaderField; import com.jozufozu.flywheel.glsl.parse.ShaderFunction; diff --git a/src/main/java/com/jozufozu/flywheel/glsl/generate/package-info.java b/src/main/java/com/jozufozu/flywheel/glsl/generate/package-info.java deleted file mode 100644 index f838a8574..000000000 --- a/src/main/java/com/jozufozu/flywheel/glsl/generate/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.glsl.generate; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/glsl/package-info.java b/src/main/java/com/jozufozu/flywheel/glsl/package-info.java deleted file mode 100644 index 8c5b4376a..000000000 --- a/src/main/java/com/jozufozu/flywheel/glsl/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.glsl; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/glsl/parse/package-info.java b/src/main/java/com/jozufozu/flywheel/glsl/parse/package-info.java deleted file mode 100644 index e37344d0d..000000000 --- a/src/main/java/com/jozufozu/flywheel/glsl/parse/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.glsl.parse; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/glsl/span/package-info.java b/src/main/java/com/jozufozu/flywheel/glsl/span/package-info.java deleted file mode 100644 index 34ce53a9a..000000000 --- a/src/main/java/com/jozufozu/flywheel/glsl/span/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.glsl.span; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/event/EntityWorldHandler.java b/src/main/java/com/jozufozu/flywheel/handler/EntityWorldHandler.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/event/EntityWorldHandler.java rename to src/main/java/com/jozufozu/flywheel/handler/EntityWorldHandler.java index a6848009c..c062705dd 100644 --- a/src/main/java/com/jozufozu/flywheel/event/EntityWorldHandler.java +++ b/src/main/java/com/jozufozu/flywheel/handler/EntityWorldHandler.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.event; +package com.jozufozu.flywheel.handler; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; diff --git a/src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java b/src/main/java/com/jozufozu/flywheel/handler/ForgeEvents.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java rename to src/main/java/com/jozufozu/flywheel/handler/ForgeEvents.java index 793f519ca..f7d096250 100644 --- a/src/main/java/com/jozufozu/flywheel/event/ForgeEvents.java +++ b/src/main/java/com/jozufozu/flywheel/handler/ForgeEvents.java @@ -1,11 +1,11 @@ -package com.jozufozu.flywheel.event; +package com.jozufozu.flywheel.handler; import java.util.ArrayList; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; -import com.jozufozu.flywheel.backend.memory.FlwMemoryTracker; +import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker; import com.jozufozu.flywheel.light.LightUpdater; import com.jozufozu.flywheel.util.StringUtil; import com.jozufozu.flywheel.util.WorldAttached; diff --git a/src/main/java/com/jozufozu/flywheel/core/BackendTypes.java b/src/main/java/com/jozufozu/flywheel/lib/backend/BackendTypes.java similarity index 81% rename from src/main/java/com/jozufozu/flywheel/core/BackendTypes.java rename to src/main/java/com/jozufozu/flywheel/lib/backend/BackendTypes.java index a071a95f3..91f5f8442 100644 --- a/src/main/java/com/jozufozu/flywheel/core/BackendTypes.java +++ b/src/main/java/com/jozufozu/flywheel/lib/backend/BackendTypes.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.lib.backend; import java.util.Collection; import java.util.HashMap; @@ -9,14 +9,15 @@ import java.util.stream.Collectors; import org.jetbrains.annotations.Nullable; -import com.jozufozu.flywheel.backend.BackendType; -import com.jozufozu.flywheel.backend.ShadersModHandler; -import com.jozufozu.flywheel.backend.SimpleBackendType; -import com.jozufozu.flywheel.backend.instancing.batching.BatchingEngine; -import com.jozufozu.flywheel.backend.instancing.indirect.IndirectEngine; -import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; -import com.jozufozu.flywheel.core.pipeline.SimplePipeline; +import com.jozufozu.flywheel.api.backend.BackendType; +import com.jozufozu.flywheel.api.pipeline.Pipeline; +import com.jozufozu.flywheel.backend.engine.batching.BatchingEngine; +import com.jozufozu.flywheel.backend.engine.indirect.IndirectEngine; +import com.jozufozu.flywheel.backend.engine.instancing.InstancingEngine; import com.jozufozu.flywheel.gl.versioned.GlCompat; +import com.jozufozu.flywheel.lib.context.Contexts; +import com.jozufozu.flywheel.lib.pipeline.Pipelines; +import com.jozufozu.flywheel.lib.util.ShadersModHandler; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.TextComponent; @@ -54,7 +55,7 @@ public class BackendTypes { .properName("GL33 Instanced Arrays") .shortName("instancing") .engineMessage(new TextComponent("Using Instancing Engine").withStyle(ChatFormatting.GREEN)) - .engineSupplier(() -> new InstancingEngine(Components.WORLD, 100 * 100)) + .engineSupplier(() -> new InstancingEngine(Contexts.WORLD, 100 * 100)) .fallback(() -> BackendTypes.BATCHING) .supported(() -> !ShadersModHandler.isShaderPackInUse() && GlCompat.getInstance() .instancedArraysSupported()) @@ -68,7 +69,7 @@ public class BackendTypes { .properName("GL46 Compute Culling") .shortName("indirect") .engineMessage(new TextComponent("Using Indirect Engine").withStyle(ChatFormatting.GREEN)) - .engineSupplier(() -> new IndirectEngine(Components.WORLD, 100 * 100)) + .engineSupplier(() -> new IndirectEngine(Contexts.WORLD, 100 * 100)) .fallback(() -> BackendTypes.INSTANCING) .supported(() -> !ShadersModHandler.isShaderPackInUse() && GlCompat.getInstance() .supportsIndirect()) @@ -99,7 +100,7 @@ public class BackendTypes { } - public static Collection availablePipelineShaders() { + public static Collection availablePipelineShaders() { return BACKEND_TYPES.values() .stream() .filter(BackendType::supported) diff --git a/src/main/java/com/jozufozu/flywheel/backend/SimpleBackendType.java b/src/main/java/com/jozufozu/flywheel/lib/backend/SimpleBackendType.java similarity index 86% rename from src/main/java/com/jozufozu/flywheel/backend/SimpleBackendType.java rename to src/main/java/com/jozufozu/flywheel/lib/backend/SimpleBackendType.java index 9a4b90056..a25bd51fc 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/SimpleBackendType.java +++ b/src/main/java/com/jozufozu/flywheel/lib/backend/SimpleBackendType.java @@ -1,13 +1,13 @@ -package com.jozufozu.flywheel.backend; +package com.jozufozu.flywheel.lib.backend; import java.util.function.BooleanSupplier; import java.util.function.Supplier; import org.jetbrains.annotations.Nullable; -import com.jozufozu.flywheel.backend.instancing.Engine; -import com.jozufozu.flywheel.core.BackendTypes; -import com.jozufozu.flywheel.core.pipeline.SimplePipeline; +import com.jozufozu.flywheel.api.backend.BackendType; +import com.jozufozu.flywheel.api.backend.Engine; +import com.jozufozu.flywheel.api.pipeline.Pipeline; import net.minecraft.network.chat.Component; @@ -20,9 +20,9 @@ public class SimpleBackendType implements BackendType { private final Supplier engineSupplier; private final Supplier fallback; private final BooleanSupplier isSupported; - private final SimplePipeline pipelineShader; + private final Pipeline pipelineShader; - public SimpleBackendType(String properName, String shortName, Component engineMessage, Supplier engineSupplier, Supplier fallback, BooleanSupplier isSupported, @Nullable SimplePipeline pipelineShader) { + public SimpleBackendType(String properName, String shortName, Component engineMessage, Supplier engineSupplier, Supplier fallback, BooleanSupplier isSupported, @Nullable Pipeline pipelineShader) { this.properName = properName; this.shortName = shortName; this.engineMessage = engineMessage; @@ -72,7 +72,7 @@ public class SimpleBackendType implements BackendType { } @Override - public @Nullable SimplePipeline pipelineShader() { + public @Nullable Pipeline pipelineShader() { return pipelineShader; } @@ -83,7 +83,7 @@ public class SimpleBackendType implements BackendType { private Supplier engineSupplier; private Supplier fallback; private BooleanSupplier isSupported; - private SimplePipeline pipelineShader; + private Pipeline pipelineShader; public Builder properName(String properName) { this.properName = properName; @@ -115,7 +115,7 @@ public class SimpleBackendType implements BackendType { return this; } - public Builder pipelineShader(SimplePipeline pipelineShader) { + public Builder pipelineShader(Pipeline pipelineShader) { this.pipelineShader = pipelineShader; return this; } diff --git a/src/main/java/com/jozufozu/flywheel/lib/context/Contexts.java b/src/main/java/com/jozufozu/flywheel/lib/context/Contexts.java new file mode 100644 index 000000000..de08ed077 --- /dev/null +++ b/src/main/java/com/jozufozu/flywheel/lib/context/Contexts.java @@ -0,0 +1,28 @@ +package com.jozufozu.flywheel.lib.context; + +import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.util.ResourceUtil; + +import net.minecraft.resources.ResourceLocation; + +public class Contexts { + public static final SimpleContext WORLD = ComponentRegistry.register(new SimpleContext(Files.WORLD_VERTEX, Files.WORLD_FRAGMENT)); + public static final SimpleContext CRUMBLING = ComponentRegistry.register(new SimpleContext(Files.WORLD_VERTEX, Files.CRUMBLING_FRAGMENT)); + + public static void init() { + // noop + } + + public static class Files { + public static final ResourceLocation WORLD_VERTEX = ResourceUtil.subPath(Names.WORLD, ".vert"); + public static final ResourceLocation WORLD_FRAGMENT = ResourceUtil.subPath(Names.WORLD, ".frag"); + public static final ResourceLocation CRUMBLING_VERTEX = ResourceUtil.subPath(Names.CRUMBLING, ".vert"); + public static final ResourceLocation CRUMBLING_FRAGMENT = ResourceUtil.subPath(Names.CRUMBLING, ".frag"); + } + + public static class Names { + public static final ResourceLocation WORLD = Flywheel.rl("context/world"); + public static final ResourceLocation CRUMBLING = Flywheel.rl("context/crumbling"); + } +} diff --git a/src/main/java/com/jozufozu/flywheel/core/context/SimpleContext.java b/src/main/java/com/jozufozu/flywheel/lib/context/SimpleContext.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/core/context/SimpleContext.java rename to src/main/java/com/jozufozu/flywheel/lib/context/SimpleContext.java index 7dbacedb5..31c8becc4 100644 --- a/src/main/java/com/jozufozu/flywheel/core/context/SimpleContext.java +++ b/src/main/java/com/jozufozu/flywheel/lib/context/SimpleContext.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.context; +package com.jozufozu.flywheel.lib.context; import com.jozufozu.flywheel.api.context.Context; import com.jozufozu.flywheel.gl.shader.GlProgram; diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/AbstractVertexList.java b/src/main/java/com/jozufozu/flywheel/lib/format/AbstractVertexList.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/core/vertex/AbstractVertexList.java rename to src/main/java/com/jozufozu/flywheel/lib/format/AbstractVertexList.java index 75f679a19..387ca3cfb 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/AbstractVertexList.java +++ b/src/main/java/com/jozufozu/flywheel/lib/format/AbstractVertexList.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.lib.format; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertex.java b/src/main/java/com/jozufozu/flywheel/lib/format/BlockVertex.java similarity index 74% rename from src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertex.java rename to src/main/java/com/jozufozu/flywheel/lib/format/BlockVertex.java index 9ccf3245c..1294ea839 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertex.java +++ b/src/main/java/com/jozufozu/flywheel/lib/format/BlockVertex.java @@ -1,9 +1,8 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.lib.format; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.layout.BufferLayout; -import com.jozufozu.flywheel.core.layout.CommonItems; +import com.jozufozu.flywheel.lib.layout.CommonItems; import net.minecraft.resources.ResourceLocation; @@ -24,7 +23,7 @@ public class BlockVertex implements VertexType { @Override public ResourceLocation layoutShader() { - return Components.Files.BLOCK_LAYOUT; + return Formats.Files.BLOCK_LAYOUT; } @Override diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertexList.java b/src/main/java/com/jozufozu/flywheel/lib/format/BlockVertexList.java similarity index 99% rename from src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertexList.java rename to src/main/java/com/jozufozu/flywheel/lib/format/BlockVertexList.java index 7df213657..903f4bff7 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/BlockVertexList.java +++ b/src/main/java/com/jozufozu/flywheel/lib/format/BlockVertexList.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.lib.format; import org.lwjgl.system.MemoryUtil; diff --git a/src/main/java/com/jozufozu/flywheel/lib/format/Formats.java b/src/main/java/com/jozufozu/flywheel/lib/format/Formats.java new file mode 100644 index 000000000..08b3667e0 --- /dev/null +++ b/src/main/java/com/jozufozu/flywheel/lib/format/Formats.java @@ -0,0 +1,26 @@ +package com.jozufozu.flywheel.lib.format; + +import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.util.ResourceUtil; + +import net.minecraft.resources.ResourceLocation; + +public class Formats { + public static final BlockVertex BLOCK = ComponentRegistry.register(new BlockVertex()); + public static final PosTexNormalVertex POS_TEX_NORMAL = ComponentRegistry.register(new PosTexNormalVertex()); + + public static void init() { + // noop + } + + public static class Files { + public static final ResourceLocation BLOCK_LAYOUT = ResourceUtil.subPath(Names.BLOCK, ".vert"); + public static final ResourceLocation POS_TEX_NORMAL_LAYOUT = ResourceUtil.subPath(Names.POS_TEX_NORMAL, ".vert"); + } + + public static class Names { + public static final ResourceLocation BLOCK = Flywheel.rl("layout/block"); + public static final ResourceLocation POS_TEX_NORMAL = Flywheel.rl("layout/pos_tex_normal"); + } +} diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertex.java b/src/main/java/com/jozufozu/flywheel/lib/format/PosTexNormalVertex.java similarity index 70% rename from src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertex.java rename to src/main/java/com/jozufozu/flywheel/lib/format/PosTexNormalVertex.java index 9df21e521..92f74b5ec 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertex.java +++ b/src/main/java/com/jozufozu/flywheel/lib/format/PosTexNormalVertex.java @@ -1,9 +1,8 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.lib.format; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.layout.BufferLayout; -import com.jozufozu.flywheel.core.layout.CommonItems; +import com.jozufozu.flywheel.lib.layout.CommonItems; import net.minecraft.resources.ResourceLocation; @@ -21,7 +20,7 @@ public class PosTexNormalVertex implements VertexType { @Override public ResourceLocation layoutShader() { - return Components.Files.POS_TEX_NORMAL_LAYOUT; + return Formats.Files.POS_TEX_NORMAL_LAYOUT; } @Override diff --git a/src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertexList.java b/src/main/java/com/jozufozu/flywheel/lib/format/PosTexNormalVertexList.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertexList.java rename to src/main/java/com/jozufozu/flywheel/lib/format/PosTexNormalVertexList.java index 051fac1b6..6e69bf9a9 100644 --- a/src/main/java/com/jozufozu/flywheel/core/vertex/PosTexNormalVertexList.java +++ b/src/main/java/com/jozufozu/flywheel/lib/format/PosTexNormalVertexList.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.vertex; +package com.jozufozu.flywheel.lib.format; import org.lwjgl.system.MemoryUtil; diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/CommonItems.java b/src/main/java/com/jozufozu/flywheel/lib/layout/CommonItems.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/core/layout/CommonItems.java rename to src/main/java/com/jozufozu/flywheel/lib/layout/CommonItems.java index abb6d8fe7..3f289300a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/layout/CommonItems.java +++ b/src/main/java/com/jozufozu/flywheel/lib/layout/CommonItems.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.layout; +package com.jozufozu.flywheel.lib.layout; import com.jozufozu.flywheel.gl.GlNumericType; import com.jozufozu.flywheel.gl.array.VertexAttributeF; diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/LayoutItem.java b/src/main/java/com/jozufozu/flywheel/lib/layout/LayoutItem.java similarity index 84% rename from src/main/java/com/jozufozu/flywheel/core/layout/LayoutItem.java rename to src/main/java/com/jozufozu/flywheel/lib/layout/LayoutItem.java index bab5fa51f..3ddb86df7 100644 --- a/src/main/java/com/jozufozu/flywheel/core/layout/LayoutItem.java +++ b/src/main/java/com/jozufozu/flywheel/lib/layout/LayoutItem.java @@ -1,5 +1,6 @@ -package com.jozufozu.flywheel.core.layout; +package com.jozufozu.flywheel.lib.layout; +import com.jozufozu.flywheel.api.layout.InputType; import com.jozufozu.flywheel.glsl.generate.GlslExpr; import com.jozufozu.flywheel.glsl.generate.GlslStruct; diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/MatInput.java b/src/main/java/com/jozufozu/flywheel/lib/layout/MatInput.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/core/layout/MatInput.java rename to src/main/java/com/jozufozu/flywheel/lib/layout/MatInput.java index e6a2f6d38..c9ead3911 100644 --- a/src/main/java/com/jozufozu/flywheel/core/layout/MatInput.java +++ b/src/main/java/com/jozufozu/flywheel/lib/layout/MatInput.java @@ -1,7 +1,8 @@ -package com.jozufozu.flywheel.core.layout; +package com.jozufozu.flywheel.lib.layout; import java.util.function.Consumer; +import com.jozufozu.flywheel.api.layout.InputType; import com.jozufozu.flywheel.gl.GlNumericType; import com.jozufozu.flywheel.gl.array.VertexAttribute; import com.jozufozu.flywheel.gl.array.VertexAttributeF; diff --git a/src/main/java/com/jozufozu/flywheel/core/layout/VecInput.java b/src/main/java/com/jozufozu/flywheel/lib/layout/VecInput.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/core/layout/VecInput.java rename to src/main/java/com/jozufozu/flywheel/lib/layout/VecInput.java index 3970267d3..b01cbb69e 100644 --- a/src/main/java/com/jozufozu/flywheel/core/layout/VecInput.java +++ b/src/main/java/com/jozufozu/flywheel/lib/layout/VecInput.java @@ -1,8 +1,9 @@ -package com.jozufozu.flywheel.core.layout; +package com.jozufozu.flywheel.lib.layout; import java.util.function.Consumer; import java.util.function.Function; +import com.jozufozu.flywheel.api.layout.InputType; import com.jozufozu.flywheel.gl.array.VertexAttribute; import com.jozufozu.flywheel.glsl.generate.GlslExpr; diff --git a/src/main/java/com/jozufozu/flywheel/core/Materials.java b/src/main/java/com/jozufozu/flywheel/lib/material/Materials.java similarity index 74% rename from src/main/java/com/jozufozu/flywheel/core/Materials.java rename to src/main/java/com/jozufozu/flywheel/lib/material/Materials.java index f9ad53c9e..1053a0014 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Materials.java +++ b/src/main/java/com/jozufozu/flywheel/lib/material/Materials.java @@ -1,11 +1,12 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.lib.material; +import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.api.material.Material; -import com.jozufozu.flywheel.backend.ShadersModHandler; -import com.jozufozu.flywheel.core.material.SimpleMaterial; -import com.jozufozu.flywheel.core.material.SimpleMaterial.GlStateShard; import com.jozufozu.flywheel.gl.GlTextureUnit; +import com.jozufozu.flywheel.lib.material.SimpleMaterial.GlStateShard; +import com.jozufozu.flywheel.lib.util.ShadersModHandler; import com.jozufozu.flywheel.util.DiffuseLightCalculator; +import com.jozufozu.flywheel.util.ResourceUtil; import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; @@ -34,98 +35,98 @@ public final class Materials { private static final ResourceLocation MINECART_LOCATION = new ResourceLocation("textures/entity/minecart.png"); public static final Material CHUNK_SOLID_SHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) - .fragmentShader(Components.Files.DEFAULT_FRAGMENT) + .vertexShader(Files.SHADED_VERTEX) + .fragmentShader(Files.DEFAULT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .batchingRenderType(RenderType.solid()) .vertexTransformer(SHADING_TRANSFORMER) .register(); public static final Material CHUNK_SOLID_UNSHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.DEFAULT_VERTEX) - .fragmentShader(Components.Files.DEFAULT_FRAGMENT) + .vertexShader(Files.DEFAULT_VERTEX) + .fragmentShader(Files.DEFAULT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .batchingRenderType(RenderType.solid()) .register(); public static final Material CHUNK_CUTOUT_MIPPED_SHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.SHADED_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .batchingRenderType(RenderType.cutoutMipped()) .vertexTransformer(SHADING_TRANSFORMER) .register(); public static final Material CHUNK_CUTOUT_MIPPED_UNSHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.DEFAULT_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.DEFAULT_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .batchingRenderType(RenderType.cutoutMipped()) .register(); public static final Material CHUNK_CUTOUT_SHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.SHADED_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, false)) .batchingRenderType(RenderType.cutout()) .vertexTransformer(SHADING_TRANSFORMER) .register(); public static final Material CHUNK_CUTOUT_UNSHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.DEFAULT_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.DEFAULT_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, false)) .batchingRenderType(RenderType.cutout()) .register(); public static final Material CHUNK_TRANSLUCENT_SHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) - .fragmentShader(Components.Files.DEFAULT_FRAGMENT) + .vertexShader(Files.SHADED_VERTEX) + .fragmentShader(Files.DEFAULT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .addShard(Shards.TRANSLUCENT_TRANSPARENCY) .batchingRenderType(RenderType.translucent()) .vertexTransformer(SHADING_TRANSFORMER) .register(); public static final Material CHUNK_TRANSLUCENT_UNSHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.DEFAULT_VERTEX) - .fragmentShader(Components.Files.DEFAULT_FRAGMENT) + .vertexShader(Files.DEFAULT_VERTEX) + .fragmentShader(Files.DEFAULT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .addShard(Shards.TRANSLUCENT_TRANSPARENCY) .batchingRenderType(RenderType.translucent()) .register(); public static final Material CHUNK_TRIPWIRE_SHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.SHADED_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .addShard(Shards.TRANSLUCENT_TRANSPARENCY) .batchingRenderType(RenderType.tripwire()) .vertexTransformer(SHADING_TRANSFORMER) .register(); public static final Material CHUNK_TRIPWIRE_UNSHADED = SimpleMaterial.builder() - .vertexShader(Components.Files.DEFAULT_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.DEFAULT_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, true)) .addShard(Shards.TRANSLUCENT_TRANSPARENCY) .batchingRenderType(RenderType.tripwire()) .register(); public static final Material CHEST = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) + .vertexShader(Files.SHADED_VERTEX) .addShard(Shards.diffuseTex(Sheets.CHEST_SHEET, false, false)) .batchingRenderType(Sheets.chestSheet()) .register(); public static final Material SHULKER = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) - .fragmentShader(Components.Files.CUTOUT_FRAGMENT) + .vertexShader(Files.SHADED_VERTEX) + .fragmentShader(Files.CUTOUT_FRAGMENT) .addShard(Shards.diffuseTex(Sheets.SHULKER_SHEET, false, false)) .addShard(Shards.DISABLE_CULL) .batchingRenderType(Sheets.shulkerBoxSheet()) .register(); public static final Material BELL = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) + .vertexShader(Files.SHADED_VERTEX) .addShard(Shards.diffuseTex(InventoryMenu.BLOCK_ATLAS, false, false)) .batchingRenderType(Sheets.solidBlockSheet()) .register(); public static final Material MINECART = SimpleMaterial.builder() - .vertexShader(Components.Files.SHADED_VERTEX) + .vertexShader(Files.SHADED_VERTEX) .addShard(Shards.diffuseTex(MINECART_LOCATION, false, false)) .batchingRenderType(RenderType.entitySolid(MINECART_LOCATION)) .register(); @@ -171,4 +172,17 @@ public final class Materials { ); } } + + public static class Files { + public static final ResourceLocation DEFAULT_VERTEX = ResourceUtil.subPath(Names.DEFAULT, ".vert"); + public static final ResourceLocation SHADED_VERTEX = ResourceUtil.subPath(Names.SHADED, ".vert"); + public static final ResourceLocation DEFAULT_FRAGMENT = ResourceUtil.subPath(Names.DEFAULT, ".frag"); + public static final ResourceLocation CUTOUT_FRAGMENT = ResourceUtil.subPath(Names.CUTOUT, ".frag"); + } + + public static class Names { + public static final ResourceLocation DEFAULT = Flywheel.rl("material/default"); + public static final ResourceLocation CUTOUT = Flywheel.rl("material/cutout"); + public static final ResourceLocation SHADED = Flywheel.rl("material/shaded"); + } } diff --git a/src/main/java/com/jozufozu/flywheel/core/material/SimpleMaterial.java b/src/main/java/com/jozufozu/flywheel/lib/material/SimpleMaterial.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/core/material/SimpleMaterial.java rename to src/main/java/com/jozufozu/flywheel/lib/material/SimpleMaterial.java index a1b98c8cb..6b3cffbe6 100644 --- a/src/main/java/com/jozufozu/flywheel/core/material/SimpleMaterial.java +++ b/src/main/java/com/jozufozu/flywheel/lib/material/SimpleMaterial.java @@ -1,8 +1,7 @@ -package com.jozufozu.flywheel.core.material; +package com.jozufozu.flywheel.lib.material; +import com.jozufozu.flywheel.api.component.ComponentRegistry; import com.jozufozu.flywheel.api.material.Material; -import com.jozufozu.flywheel.core.ComponentRegistry; -import com.jozufozu.flywheel.core.Components; import net.minecraft.client.renderer.RenderStateShard; import net.minecraft.client.renderer.RenderType; @@ -60,8 +59,8 @@ public class SimpleMaterial implements Material { } public static class Builder { - protected ResourceLocation vertexShader = Components.Files.DEFAULT_VERTEX; - protected ResourceLocation fragmentShader = Components.Files.DEFAULT_FRAGMENT; + protected ResourceLocation vertexShader = Materials.Files.DEFAULT_VERTEX; + protected ResourceLocation fragmentShader = Materials.Files.DEFAULT_FRAGMENT; protected Runnable setup = () -> {}; protected Runnable clear = () -> {}; protected RenderType batchingRenderType = RenderType.solid(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/memory/DebugMemoryBlockImpl.java b/src/main/java/com/jozufozu/flywheel/lib/memory/DebugMemoryBlockImpl.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/memory/DebugMemoryBlockImpl.java rename to src/main/java/com/jozufozu/flywheel/lib/memory/DebugMemoryBlockImpl.java index 6025e2084..e207a7b08 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/memory/DebugMemoryBlockImpl.java +++ b/src/main/java/com/jozufozu/flywheel/lib/memory/DebugMemoryBlockImpl.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.memory; +package com.jozufozu.flywheel.lib.memory; import java.lang.ref.Cleaner; diff --git a/src/main/java/com/jozufozu/flywheel/backend/memory/FlwMemoryTracker.java b/src/main/java/com/jozufozu/flywheel/lib/memory/FlwMemoryTracker.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/backend/memory/FlwMemoryTracker.java rename to src/main/java/com/jozufozu/flywheel/lib/memory/FlwMemoryTracker.java index 132e9db17..c66e852a9 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/memory/FlwMemoryTracker.java +++ b/src/main/java/com/jozufozu/flywheel/lib/memory/FlwMemoryTracker.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.memory; +package com.jozufozu.flywheel.lib.memory; import java.lang.ref.Cleaner; import java.nio.ByteBuffer; diff --git a/src/main/java/com/jozufozu/flywheel/backend/memory/MemoryBlock.java b/src/main/java/com/jozufozu/flywheel/lib/memory/MemoryBlock.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/backend/memory/MemoryBlock.java rename to src/main/java/com/jozufozu/flywheel/lib/memory/MemoryBlock.java index eb8b8f75e..bb89df2d1 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/memory/MemoryBlock.java +++ b/src/main/java/com/jozufozu/flywheel/lib/memory/MemoryBlock.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.memory; +package com.jozufozu.flywheel.lib.memory; import java.nio.ByteBuffer; diff --git a/src/main/java/com/jozufozu/flywheel/backend/memory/MemoryBlockImpl.java b/src/main/java/com/jozufozu/flywheel/lib/memory/MemoryBlockImpl.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/backend/memory/MemoryBlockImpl.java rename to src/main/java/com/jozufozu/flywheel/lib/memory/MemoryBlockImpl.java index d0773efd2..0aaaed46b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/memory/MemoryBlockImpl.java +++ b/src/main/java/com/jozufozu/flywheel/lib/memory/MemoryBlockImpl.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.memory; +package com.jozufozu.flywheel.lib.memory; import java.nio.ByteBuffer; diff --git a/src/main/java/com/jozufozu/flywheel/backend/memory/TrackedMemoryBlockImpl.java b/src/main/java/com/jozufozu/flywheel/lib/memory/TrackedMemoryBlockImpl.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/backend/memory/TrackedMemoryBlockImpl.java rename to src/main/java/com/jozufozu/flywheel/lib/memory/TrackedMemoryBlockImpl.java index 94cc6666e..71c650c32 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/memory/TrackedMemoryBlockImpl.java +++ b/src/main/java/com/jozufozu/flywheel/lib/memory/TrackedMemoryBlockImpl.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend.memory; +package com.jozufozu.flywheel.lib.memory; import java.lang.ref.Cleaner; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java b/src/main/java/com/jozufozu/flywheel/lib/model/ModelUtil.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java rename to src/main/java/com/jozufozu/flywheel/lib/model/ModelUtil.java index bb2deb571..5c900b275 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/ModelUtil.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/ModelUtil.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.lib.model; import java.lang.reflect.Field; import java.nio.ByteBuffer; @@ -15,9 +15,9 @@ import com.jozufozu.flywheel.api.vertex.ReusableVertexList; import com.jozufozu.flywheel.api.vertex.VertexList; import com.jozufozu.flywheel.api.vertex.VertexListProvider; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.vertex.Formats; +import com.jozufozu.flywheel.lib.format.Formats; +import com.jozufozu.flywheel.lib.material.Materials; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; import com.mojang.blaze3d.vertex.BufferBuilder.DrawState; import com.mojang.blaze3d.vertex.VertexFormat; import com.mojang.datafixers.util.Pair; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/Models.java b/src/main/java/com/jozufozu/flywheel/lib/model/Models.java similarity index 82% rename from src/main/java/com/jozufozu/flywheel/core/model/Models.java rename to src/main/java/com/jozufozu/flywheel/lib/model/Models.java index f76444358..8caf445e8 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/Models.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/Models.java @@ -1,15 +1,15 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.lib.model; import java.util.Collection; import java.util.HashMap; import java.util.Map; -import com.jozufozu.flywheel.core.PartialModel; -import com.jozufozu.flywheel.core.model.buffering.BakedModelBuilder; -import com.jozufozu.flywheel.core.model.buffering.BlockModelBuilder; -import com.jozufozu.flywheel.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.api.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.api.model.Model; +import com.jozufozu.flywheel.lib.model.buffering.BakedModelBuilder; +import com.jozufozu.flywheel.lib.model.buffering.BlockModelBuilder; +import com.jozufozu.flywheel.lib.transform.TransformStack; import com.jozufozu.flywheel.util.Pair; -import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.core.Direction; diff --git a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java b/src/main/java/com/jozufozu/flywheel/lib/model/PartialModel.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/core/PartialModel.java rename to src/main/java/com/jozufozu/flywheel/lib/model/PartialModel.java index 47c6d2900..da858198d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/PartialModel.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/PartialModel.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.lib.model; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/SimpleLazyModel.java b/src/main/java/com/jozufozu/flywheel/lib/model/SimpleLazyModel.java similarity index 88% rename from src/main/java/com/jozufozu/flywheel/core/model/SimpleLazyModel.java rename to src/main/java/com/jozufozu/flywheel/lib/model/SimpleLazyModel.java index a35519876..36b66ef9d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/SimpleLazyModel.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/SimpleLazyModel.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.lib.model; import java.util.Map; @@ -6,6 +6,8 @@ import org.jetbrains.annotations.NotNull; import com.google.common.collect.ImmutableMap; import com.jozufozu.flywheel.api.material.Material; +import com.jozufozu.flywheel.api.model.Mesh; +import com.jozufozu.flywheel.api.model.Model; import com.jozufozu.flywheel.util.Lazy; import com.jozufozu.flywheel.util.NonNullSupplier; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/SimpleMesh.java b/src/main/java/com/jozufozu/flywheel/lib/model/SimpleMesh.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/core/model/SimpleMesh.java rename to src/main/java/com/jozufozu/flywheel/lib/model/SimpleMesh.java index cd901b6ad..7d4724d63 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/SimpleMesh.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/SimpleMesh.java @@ -1,12 +1,13 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.lib.model; import org.joml.Vector4f; import org.joml.Vector4fc; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.MutableVertexList; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; public class SimpleMesh implements Mesh { private final VertexType vertexType; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/TessellatedModel.java b/src/main/java/com/jozufozu/flywheel/lib/model/TessellatedModel.java similarity index 83% rename from src/main/java/com/jozufozu/flywheel/core/model/TessellatedModel.java rename to src/main/java/com/jozufozu/flywheel/lib/model/TessellatedModel.java index d0d4a221b..ec7fe9541 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/TessellatedModel.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/TessellatedModel.java @@ -1,9 +1,11 @@ -package com.jozufozu.flywheel.core.model; +package com.jozufozu.flywheel.lib.model; import java.util.Map; import com.google.common.collect.ImmutableMap; import com.jozufozu.flywheel.api.material.Material; +import com.jozufozu.flywheel.api.model.Mesh; +import com.jozufozu.flywheel.api.model.Model; public class TessellatedModel implements Model { private final ImmutableMap meshes; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/BakedModelBuilder.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/BakedModelBuilder.java similarity index 84% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/BakedModelBuilder.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/BakedModelBuilder.java index b86ec43f7..48b99319a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/BakedModelBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/BakedModelBuilder.java @@ -1,21 +1,21 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import java.util.function.BiFunction; import com.google.common.collect.ImmutableMap; import com.jozufozu.flywheel.api.material.Material; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.ModelUtil; -import com.jozufozu.flywheel.core.model.SimpleMesh; -import com.jozufozu.flywheel.core.model.TessellatedModel; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.BufferFactory; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ResultConsumer; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatedBufferFactory; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatedResultConsumer; -import com.jozufozu.flywheel.core.virtual.VirtualEmptyBlockGetter; -import com.jozufozu.flywheel.core.virtual.VirtualEmptyModelData; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.model.ModelUtil; +import com.jozufozu.flywheel.lib.model.SimpleMesh; +import com.jozufozu.flywheel.lib.model.TessellatedModel; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.BufferFactory; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ResultConsumer; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatedBufferFactory; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatedResultConsumer; +import com.jozufozu.flywheel.lib.virtualworld.VirtualEmptyBlockGetter; +import com.jozufozu.flywheel.lib.virtualworld.VirtualEmptyModelData; import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.PoseStack; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/BlockModelBuilder.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/BlockModelBuilder.java similarity index 83% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/BlockModelBuilder.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/BlockModelBuilder.java index b69549c6c..dd4a54dc1 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/BlockModelBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/BlockModelBuilder.java @@ -1,21 +1,21 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import java.util.function.BiFunction; import com.google.common.collect.ImmutableMap; import com.jozufozu.flywheel.api.material.Material; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.ModelUtil; -import com.jozufozu.flywheel.core.model.SimpleMesh; -import com.jozufozu.flywheel.core.model.TessellatedModel; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.BufferFactory; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ResultConsumer; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatedBufferFactory; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatedResultConsumer; -import com.jozufozu.flywheel.core.virtual.VirtualEmptyBlockGetter; -import com.jozufozu.flywheel.core.virtual.VirtualEmptyModelData; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.model.ModelUtil; +import com.jozufozu.flywheel.lib.model.SimpleMesh; +import com.jozufozu.flywheel.lib.model.TessellatedModel; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.BufferFactory; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ResultConsumer; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatedBufferFactory; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatedResultConsumer; +import com.jozufozu.flywheel.lib.virtualworld.VirtualEmptyBlockGetter; +import com.jozufozu.flywheel.lib.virtualworld.VirtualEmptyModelData; import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.PoseStack; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/LazyDelegatingVertexConsumer.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/LazyDelegatingVertexConsumer.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/LazyDelegatingVertexConsumer.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/LazyDelegatingVertexConsumer.java index 10be13717..9406af498 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/LazyDelegatingVertexConsumer.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/LazyDelegatingVertexConsumer.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/ModelBufferingObjects.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/ModelBufferingObjects.java similarity index 71% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/ModelBufferingObjects.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/ModelBufferingObjects.java index 9b89f1409..d91574699 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/ModelBufferingObjects.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/ModelBufferingObjects.java @@ -1,9 +1,9 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import java.util.Random; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.BufferWrapper; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatingBufferWrapper; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.BufferWrapper; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatingBufferWrapper; import com.mojang.blaze3d.vertex.PoseStack; public class ModelBufferingObjects { diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/ModelBufferingUtil.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/ModelBufferingUtil.java similarity index 99% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/ModelBufferingUtil.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/ModelBufferingUtil.java index 8b2c96888..65ec74586 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/ModelBufferingUtil.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/ModelBufferingUtil.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import java.util.Collection; import java.util.Map; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/MultiBlockModelBuilder.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/MultiBlockModelBuilder.java similarity index 85% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/MultiBlockModelBuilder.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/MultiBlockModelBuilder.java index dd0342e5f..6f0581624 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/MultiBlockModelBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/MultiBlockModelBuilder.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import java.util.Collection; import java.util.Collections; @@ -7,17 +7,17 @@ import java.util.function.BiFunction; import com.google.common.collect.ImmutableMap; import com.jozufozu.flywheel.api.material.Material; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.VertexType; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.ModelUtil; -import com.jozufozu.flywheel.core.model.SimpleMesh; -import com.jozufozu.flywheel.core.model.TessellatedModel; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.BufferFactory; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ResultConsumer; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatedBufferFactory; -import com.jozufozu.flywheel.core.model.buffering.ModelBufferingUtil.ShadeSeparatedResultConsumer; -import com.jozufozu.flywheel.core.virtual.VirtualEmptyBlockGetter; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.model.ModelUtil; +import com.jozufozu.flywheel.lib.model.SimpleMesh; +import com.jozufozu.flywheel.lib.model.TessellatedModel; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.BufferFactory; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ResultConsumer; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatedBufferFactory; +import com.jozufozu.flywheel.lib.model.buffering.ModelBufferingUtil.ShadeSeparatedResultConsumer; +import com.jozufozu.flywheel.lib.virtualworld.VirtualEmptyBlockGetter; import com.mojang.blaze3d.vertex.BufferBuilder; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.PoseStack; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/buffering/ShadeSeparatingVertexConsumer.java b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/ShadeSeparatingVertexConsumer.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/core/model/buffering/ShadeSeparatingVertexConsumer.java rename to src/main/java/com/jozufozu/flywheel/lib/model/buffering/ShadeSeparatingVertexConsumer.java index be358b0d6..ac32a168e 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/buffering/ShadeSeparatingVertexConsumer.java +++ b/src/main/java/com/jozufozu/flywheel/lib/model/buffering/ShadeSeparatingVertexConsumer.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.model.buffering; +package com.jozufozu.flywheel.lib.model.buffering; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/src/main/java/com/jozufozu/flywheel/core/hardcoded/ModelPart.java b/src/main/java/com/jozufozu/flywheel/lib/modelpart/ModelPart.java similarity index 85% rename from src/main/java/com/jozufozu/flywheel/core/hardcoded/ModelPart.java rename to src/main/java/com/jozufozu/flywheel/lib/modelpart/ModelPart.java index d633b074a..dfadcc10a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/hardcoded/ModelPart.java +++ b/src/main/java/com/jozufozu/flywheel/lib/modelpart/ModelPart.java @@ -1,17 +1,17 @@ -package com.jozufozu.flywheel.core.hardcoded; +package com.jozufozu.flywheel.lib.modelpart; import java.util.List; import org.joml.Vector4f; import org.joml.Vector4fc; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.api.vertex.MutableVertexList; import com.jozufozu.flywheel.api.vertex.ReusableVertexList; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.ModelUtil; -import com.jozufozu.flywheel.core.vertex.Formats; -import com.jozufozu.flywheel.core.vertex.PosTexNormalVertex; +import com.jozufozu.flywheel.lib.format.Formats; +import com.jozufozu.flywheel.lib.format.PosTexNormalVertex; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.model.ModelUtil; public class ModelPart implements Mesh { private final int vertexCount; diff --git a/src/main/java/com/jozufozu/flywheel/core/hardcoded/PartBuilder.java b/src/main/java/com/jozufozu/flywheel/lib/modelpart/PartBuilder.java similarity index 99% rename from src/main/java/com/jozufozu/flywheel/core/hardcoded/PartBuilder.java rename to src/main/java/com/jozufozu/flywheel/lib/modelpart/PartBuilder.java index 945607a47..f3b4d6200 100644 --- a/src/main/java/com/jozufozu/flywheel/core/hardcoded/PartBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/lib/modelpart/PartBuilder.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.hardcoded; +package com.jozufozu.flywheel.lib.modelpart; import java.util.ArrayList; import java.util.EnumSet; diff --git a/src/main/java/com/jozufozu/flywheel/core/hardcoded/VertexWriter.java b/src/main/java/com/jozufozu/flywheel/lib/modelpart/VertexWriter.java similarity index 73% rename from src/main/java/com/jozufozu/flywheel/core/hardcoded/VertexWriter.java rename to src/main/java/com/jozufozu/flywheel/lib/modelpart/VertexWriter.java index 7e031c58b..09efa6bcc 100644 --- a/src/main/java/com/jozufozu/flywheel/core/hardcoded/VertexWriter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/modelpart/VertexWriter.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.hardcoded; +package com.jozufozu.flywheel.lib.modelpart; public interface VertexWriter { void putVertex(float x, float y, float z, float u, float v, float nX, float nY, float nZ); diff --git a/src/main/java/com/jozufozu/flywheel/core/hardcoded/VertexWriterImpl.java b/src/main/java/com/jozufozu/flywheel/lib/modelpart/VertexWriterImpl.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/core/hardcoded/VertexWriterImpl.java rename to src/main/java/com/jozufozu/flywheel/lib/modelpart/VertexWriterImpl.java index 3b8b617cd..53fb8ee96 100644 --- a/src/main/java/com/jozufozu/flywheel/core/hardcoded/VertexWriterImpl.java +++ b/src/main/java/com/jozufozu/flywheel/lib/modelpart/VertexWriterImpl.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.hardcoded; +package com.jozufozu.flywheel.lib.modelpart; import org.lwjgl.system.MemoryUtil; diff --git a/src/main/java/com/jozufozu/flywheel/core/Pipelines.java b/src/main/java/com/jozufozu/flywheel/lib/pipeline/Pipelines.java similarity index 82% rename from src/main/java/com/jozufozu/flywheel/core/Pipelines.java rename to src/main/java/com/jozufozu/flywheel/lib/pipeline/Pipelines.java index 7794dd0b1..f21a568cb 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Pipelines.java +++ b/src/main/java/com/jozufozu/flywheel/lib/pipeline/Pipelines.java @@ -1,9 +1,8 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.lib.pipeline; import com.jozufozu.flywheel.Flywheel; -import com.jozufozu.flywheel.backend.instancing.indirect.IndirectComponent; -import com.jozufozu.flywheel.backend.instancing.instancing.InstancedArraysComponent; -import com.jozufozu.flywheel.core.pipeline.SimplePipeline; +import com.jozufozu.flywheel.backend.engine.indirect.IndirectComponent; +import com.jozufozu.flywheel.backend.engine.instancing.InstancedArraysComponent; import com.jozufozu.flywheel.gl.GLSLVersion; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/core/pipeline/SimplePipeline.java b/src/main/java/com/jozufozu/flywheel/lib/pipeline/SimplePipeline.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/core/pipeline/SimplePipeline.java rename to src/main/java/com/jozufozu/flywheel/lib/pipeline/SimplePipeline.java index ba1aaac3c..df4b19b44 100644 --- a/src/main/java/com/jozufozu/flywheel/core/pipeline/SimplePipeline.java +++ b/src/main/java/com/jozufozu/flywheel/lib/pipeline/SimplePipeline.java @@ -1,8 +1,8 @@ -package com.jozufozu.flywheel.core.pipeline; +package com.jozufozu.flywheel.lib.pipeline; import com.jozufozu.flywheel.api.pipeline.Pipeline; +import com.jozufozu.flywheel.api.pipeline.SourceComponent; import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.core.SourceComponent; import com.jozufozu.flywheel.gl.GLSLVersion; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/ColoredLitPart.java b/src/main/java/com/jozufozu/flywheel/lib/struct/ColoredLitPart.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/core/structs/ColoredLitPart.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/ColoredLitPart.java index 050b27d49..c384760b2 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/ColoredLitPart.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/ColoredLitPart.java @@ -1,5 +1,6 @@ -package com.jozufozu.flywheel.core.structs; +package com.jozufozu.flywheel.lib.struct; +import com.jozufozu.flywheel.api.instancer.FlatLit; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.struct.StructType; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/ColoredLitWriter.java b/src/main/java/com/jozufozu/flywheel/lib/struct/ColoredLitWriter.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/core/structs/ColoredLitWriter.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/ColoredLitWriter.java index 0e33ac94d..d1a9fef2d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/ColoredLitWriter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/ColoredLitWriter.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.structs; +package com.jozufozu.flywheel.lib.struct; import org.lwjgl.system.MemoryUtil; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedPart.java b/src/main/java/com/jozufozu/flywheel/lib/struct/OrientedPart.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedPart.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/OrientedPart.java index 969b2efc7..c6559f92f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedPart.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/OrientedPart.java @@ -1,7 +1,5 @@ -package com.jozufozu.flywheel.core.structs.oriented; +package com.jozufozu.flywheel.lib.struct; -import com.jozufozu.flywheel.core.structs.ColoredLitPart; -import com.jozufozu.flywheel.core.structs.StructTypes; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedType.java b/src/main/java/com/jozufozu/flywheel/lib/struct/OrientedType.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedType.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/OrientedType.java index a0270ade6..1010220d6 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedType.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/OrientedType.java @@ -1,10 +1,9 @@ -package com.jozufozu.flywheel.core.structs.oriented; +package com.jozufozu.flywheel.lib.struct; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.struct.StructWriter; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.layout.BufferLayout; -import com.jozufozu.flywheel.core.layout.CommonItems; +import com.jozufozu.flywheel.lib.layout.CommonItems; import com.jozufozu.flywheel.util.RenderMath; import com.mojang.math.Matrix3f; import com.mojang.math.Matrix4f; @@ -41,7 +40,7 @@ public class OrientedType implements StructType { @Override public ResourceLocation instanceShader() { - return Components.Files.ORIENTED; + return StructTypes.Files.ORIENTED; } @Override diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedWriter.java b/src/main/java/com/jozufozu/flywheel/lib/struct/OrientedWriter.java similarity index 86% rename from src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedWriter.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/OrientedWriter.java index 983e63718..a16ea7a0e 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/oriented/OrientedWriter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/OrientedWriter.java @@ -1,9 +1,7 @@ -package com.jozufozu.flywheel.core.structs.oriented; +package com.jozufozu.flywheel.lib.struct; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.core.structs.ColoredLitWriter; - public class OrientedWriter extends ColoredLitWriter { public static final OrientedWriter INSTANCE = new OrientedWriter(); diff --git a/src/main/java/com/jozufozu/flywheel/lib/struct/StructTypes.java b/src/main/java/com/jozufozu/flywheel/lib/struct/StructTypes.java new file mode 100644 index 000000000..ad607616d --- /dev/null +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/StructTypes.java @@ -0,0 +1,27 @@ +package com.jozufozu.flywheel.lib.struct; + +import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.util.ResourceUtil; + +import net.minecraft.resources.ResourceLocation; + +public class StructTypes { + public static final StructType TRANSFORMED = ComponentRegistry.register(new TransformedType()); + public static final StructType ORIENTED = ComponentRegistry.register(new OrientedType()); + + public static void init() { + // noop + } + + public static class Files { + public static final ResourceLocation TRANSFORMED = ResourceUtil.subPath(Names.TRANSFORMED, ".vert"); + public static final ResourceLocation ORIENTED = ResourceUtil.subPath(Names.ORIENTED, ".vert"); + } + + public static class Names { + public static final ResourceLocation TRANSFORMED = Flywheel.rl("instance/transformed"); + public static final ResourceLocation ORIENTED = Flywheel.rl("instance/oriented"); + } +} diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedPart.java b/src/main/java/com/jozufozu/flywheel/lib/struct/TransformedPart.java similarity index 91% rename from src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedPart.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/TransformedPart.java index 215bfd913..195ad2da9 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedPart.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/TransformedPart.java @@ -1,8 +1,6 @@ -package com.jozufozu.flywheel.core.structs.transformed; +package com.jozufozu.flywheel.lib.struct; -import com.jozufozu.flywheel.core.structs.ColoredLitPart; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.util.transform.Transform; +import com.jozufozu.flywheel.lib.transform.Transform; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix3f; import com.mojang.math.Matrix4f; diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedType.java b/src/main/java/com/jozufozu/flywheel/lib/struct/TransformedType.java similarity index 88% rename from src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedType.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/TransformedType.java index 8413fedaf..6b59b3482 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedType.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/TransformedType.java @@ -1,10 +1,9 @@ -package com.jozufozu.flywheel.core.structs.transformed; +package com.jozufozu.flywheel.lib.struct; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.api.struct.StructWriter; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.layout.BufferLayout; -import com.jozufozu.flywheel.core.layout.CommonItems; +import com.jozufozu.flywheel.lib.layout.CommonItems; import com.jozufozu.flywheel.util.RenderMath; import com.mojang.math.Vector3f; import com.mojang.math.Vector4f; @@ -37,7 +36,7 @@ public class TransformedType implements StructType { @Override public ResourceLocation instanceShader() { - return Components.Files.TRANSFORMED; + return StructTypes.Files.TRANSFORMED; } @Override diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedWriter.java b/src/main/java/com/jozufozu/flywheel/lib/struct/TransformedWriter.java similarity index 77% rename from src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedWriter.java rename to src/main/java/com/jozufozu/flywheel/lib/struct/TransformedWriter.java index 8565e77c9..bb69dcb6c 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedWriter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/struct/TransformedWriter.java @@ -1,6 +1,5 @@ -package com.jozufozu.flywheel.core.structs.transformed; +package com.jozufozu.flywheel.lib.struct; -import com.jozufozu.flywheel.core.structs.ColoredLitWriter; import com.jozufozu.flywheel.util.MatrixUtil; public class TransformedWriter extends ColoredLitWriter { diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/Rotate.java b/src/main/java/com/jozufozu/flywheel/lib/transform/Rotate.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/util/transform/Rotate.java rename to src/main/java/com/jozufozu/flywheel/lib/transform/Rotate.java index 68814740c..2f7c4cc89 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/Rotate.java +++ b/src/main/java/com/jozufozu/flywheel/lib/transform/Rotate.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.transform; +package com.jozufozu.flywheel.lib.transform; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/Scale.java b/src/main/java/com/jozufozu/flywheel/lib/transform/Scale.java similarity index 78% rename from src/main/java/com/jozufozu/flywheel/util/transform/Scale.java rename to src/main/java/com/jozufozu/flywheel/lib/transform/Scale.java index 8fd7e7ab7..4eafa1b73 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/Scale.java +++ b/src/main/java/com/jozufozu/flywheel/lib/transform/Scale.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.transform; +package com.jozufozu.flywheel.lib.transform; public interface Scale { Self scale(float factorX, float factorY, float factorZ); diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/Transform.java b/src/main/java/com/jozufozu/flywheel/lib/transform/Transform.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/util/transform/Transform.java rename to src/main/java/com/jozufozu/flywheel/lib/transform/Transform.java index f2ebe795f..4d1aa8b82 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/Transform.java +++ b/src/main/java/com/jozufozu/flywheel/lib/transform/Transform.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.transform; +package com.jozufozu.flywheel.lib.transform; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix3f; diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java b/src/main/java/com/jozufozu/flywheel/lib/transform/TransformStack.java similarity index 84% rename from src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java rename to src/main/java/com/jozufozu/flywheel/lib/transform/TransformStack.java index 084ad928b..a66981c71 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/TransformStack.java +++ b/src/main/java/com/jozufozu/flywheel/lib/transform/TransformStack.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.transform; +package com.jozufozu.flywheel.lib.transform; import com.mojang.blaze3d.vertex.PoseStack; diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/Translate.java b/src/main/java/com/jozufozu/flywheel/lib/transform/Translate.java similarity index 97% rename from src/main/java/com/jozufozu/flywheel/util/transform/Translate.java rename to src/main/java/com/jozufozu/flywheel/lib/transform/Translate.java index df6b91abd..dbc5ffccc 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/Translate.java +++ b/src/main/java/com/jozufozu/flywheel/lib/transform/Translate.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.transform; +package com.jozufozu.flywheel.lib.transform; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/core/uniform/FlwShaderUniforms.java b/src/main/java/com/jozufozu/flywheel/lib/uniform/FlwShaderUniforms.java similarity index 88% rename from src/main/java/com/jozufozu/flywheel/core/uniform/FlwShaderUniforms.java rename to src/main/java/com/jozufozu/flywheel/lib/uniform/FlwShaderUniforms.java index 0890650d4..aac852689 100644 --- a/src/main/java/com/jozufozu/flywheel/core/uniform/FlwShaderUniforms.java +++ b/src/main/java/com/jozufozu/flywheel/lib/uniform/FlwShaderUniforms.java @@ -1,14 +1,15 @@ -package com.jozufozu.flywheel.core.uniform; +package com.jozufozu.flywheel.lib.uniform; import java.util.function.Consumer; import org.lwjgl.system.MemoryUtil; +import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.component.ComponentRegistry; +import com.jozufozu.flywheel.api.event.BeginFrameEvent; +import com.jozufozu.flywheel.api.event.RenderContext; import com.jozufozu.flywheel.api.uniform.ShaderUniforms; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; -import com.jozufozu.flywheel.core.Components; -import com.jozufozu.flywheel.core.RenderContext; -import com.jozufozu.flywheel.event.BeginFrameEvent; import com.jozufozu.flywheel.util.FlwUtil; import com.jozufozu.flywheel.util.MatrixUtil; import com.mojang.blaze3d.systems.RenderSystem; @@ -19,7 +20,9 @@ import net.minecraft.world.phys.Vec3; import net.minecraftforge.common.MinecraftForge; public class FlwShaderUniforms implements ShaderUniforms { + public static final FlwShaderUniforms INSTANCE = ComponentRegistry.register(new FlwShaderUniforms()); + public static final ResourceLocation FILE = Flywheel.rl("uniform/flywheel.glsl"); public static final int SIZE = 224; public static boolean FRUSTUM_PAUSED = false; @@ -33,7 +36,7 @@ public class FlwShaderUniforms implements ShaderUniforms { @Override public ResourceLocation uniformShader() { - return Components.Files.UNIFORMS; + return FILE; } @Override diff --git a/src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java b/src/main/java/com/jozufozu/flywheel/lib/util/FullscreenQuad.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java rename to src/main/java/com/jozufozu/flywheel/lib/util/FullscreenQuad.java index 8d58b7a30..a5ab3caa5 100644 --- a/src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java +++ b/src/main/java/com/jozufozu/flywheel/lib/util/FullscreenQuad.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.lib.util; import static org.lwjgl.opengl.GL11.GL_TRIANGLES; import static org.lwjgl.opengl.GL11.glDrawArrays; @@ -6,13 +6,13 @@ import static org.lwjgl.opengl.GL11.glDrawArrays; import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.Flywheel; -import com.jozufozu.flywheel.core.layout.BufferLayout; -import com.jozufozu.flywheel.core.layout.CommonItems; +import com.jozufozu.flywheel.api.layout.BufferLayout; import com.jozufozu.flywheel.gl.GlStateTracker; import com.jozufozu.flywheel.gl.array.GlVertexArray; import com.jozufozu.flywheel.gl.buffer.GlBuffer; import com.jozufozu.flywheel.gl.buffer.GlBufferType; import com.jozufozu.flywheel.gl.buffer.MappedBuffer; +import com.jozufozu.flywheel.lib.layout.CommonItems; import com.jozufozu.flywheel.util.Lazy; public class FullscreenQuad { diff --git a/src/main/java/com/jozufozu/flywheel/core/QuadConverter.java b/src/main/java/com/jozufozu/flywheel/lib/util/QuadConverter.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/core/QuadConverter.java rename to src/main/java/com/jozufozu/flywheel/lib/util/QuadConverter.java index ce79162c3..50683e23f 100644 --- a/src/main/java/com/jozufozu/flywheel/core/QuadConverter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/util/QuadConverter.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core; +package com.jozufozu.flywheel.lib.util; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -6,8 +6,8 @@ import org.lwjgl.opengl.GL32; import org.lwjgl.opengl.GL32C; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.backend.instancing.instancing.ElementBuffer; -import com.jozufozu.flywheel.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.api.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.backend.engine.instancing.ElementBuffer; import com.jozufozu.flywheel.gl.GlNumericType; import com.jozufozu.flywheel.gl.buffer.GlBufferType; import com.jozufozu.flywheel.gl.buffer.GlBufferUsage; diff --git a/src/main/java/com/jozufozu/flywheel/backend/RenderWork.java b/src/main/java/com/jozufozu/flywheel/lib/util/RenderWork.java similarity index 92% rename from src/main/java/com/jozufozu/flywheel/backend/RenderWork.java rename to src/main/java/com/jozufozu/flywheel/lib/util/RenderWork.java index afa364056..c179bc85a 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/RenderWork.java +++ b/src/main/java/com/jozufozu/flywheel/lib/util/RenderWork.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend; +package com.jozufozu.flywheel.lib.util; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; diff --git a/src/main/java/com/jozufozu/flywheel/backend/ShadersModHandler.java b/src/main/java/com/jozufozu/flywheel/lib/util/ShadersModHandler.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/backend/ShadersModHandler.java rename to src/main/java/com/jozufozu/flywheel/lib/util/ShadersModHandler.java index d96eef8a0..9aaf0f46c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/ShadersModHandler.java +++ b/src/main/java/com/jozufozu/flywheel/lib/util/ShadersModHandler.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.backend; +package com.jozufozu.flywheel.lib.util; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -6,6 +6,8 @@ import java.util.function.BooleanSupplier; import javax.annotation.Nullable; +import com.jozufozu.flywheel.backend.Backend; + import net.irisshaders.iris.api.v0.IrisApi; import net.minecraft.client.Camera; import net.minecraft.client.renderer.culling.Frustum; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunk.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunk.java similarity index 99% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunk.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunk.java index a920bbd90..382bd863e 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunk.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunk.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunkSection.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunkSection.java similarity index 95% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunkSection.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunkSection.java index a3d4f1952..d8d095087 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunkSection.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunkSection.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import net.minecraft.core.Registry; import net.minecraft.world.level.block.state.BlockState; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunkSource.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunkSource.java similarity index 96% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunkSource.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunkSource.java index 7fa73d38d..ef83ad93d 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualChunkSource.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualChunkSource.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import java.util.HashMap; import java.util.function.BooleanSupplier; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualEmptyBlockGetter.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualEmptyBlockGetter.java similarity index 98% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualEmptyBlockGetter.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualEmptyBlockGetter.java index ebfbe9389..34f43497b 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualEmptyBlockGetter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualEmptyBlockGetter.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualEmptyModelData.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualEmptyModelData.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualEmptyModelData.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualEmptyModelData.java index 4a8195857..8b768ccf0 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualEmptyModelData.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualEmptyModelData.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.ModelProperty; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualLevelEntityGetter.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualLevelEntityGetter.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualLevelEntityGetter.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualLevelEntityGetter.java index 2edd3fdf3..41a4728e4 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualLevelEntityGetter.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualLevelEntityGetter.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import java.util.Collections; import java.util.UUID; diff --git a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualRenderWorld.java b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualRenderWorld.java similarity index 99% rename from src/main/java/com/jozufozu/flywheel/core/virtual/VirtualRenderWorld.java rename to src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualRenderWorld.java index e11b0e118..6c2bb071b 100644 --- a/src/main/java/com/jozufozu/flywheel/core/virtual/VirtualRenderWorld.java +++ b/src/main/java/com/jozufozu/flywheel/lib/virtualworld/VirtualRenderWorld.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.core.virtual; +package com.jozufozu.flywheel.lib.virtualworld; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java b/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java index 5a4998210..e30daa013 100644 --- a/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java +++ b/src/main/java/com/jozufozu/flywheel/light/LightUpdater.java @@ -6,8 +6,8 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.stream.Stream; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.backend.instancing.ParallelTaskExecutor; -import com.jozufozu.flywheel.backend.instancing.WorkGroup; +import com.jozufozu.flywheel.backend.task.ParallelTaskExecutor; +import com.jozufozu.flywheel.backend.task.WorkGroup; import com.jozufozu.flywheel.util.FlwUtil; import com.jozufozu.flywheel.util.WorldAttached; import com.jozufozu.flywheel.util.box.GridAlignedBB; diff --git a/src/main/java/com/jozufozu/flywheel/light/LightVolume.java b/src/main/java/com/jozufozu/flywheel/light/LightVolume.java index ef1dc4f88..018a152d8 100644 --- a/src/main/java/com/jozufozu/flywheel/light/LightVolume.java +++ b/src/main/java/com/jozufozu/flywheel/light/LightVolume.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.light; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.backend.memory.MemoryBlock; +import com.jozufozu.flywheel.lib.memory.MemoryBlock; import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.jozufozu.flywheel.util.box.ImmutableBox; diff --git a/src/main/java/com/jozufozu/flywheel/light/package-info.java b/src/main/java/com/jozufozu/flywheel/light/package-info.java deleted file mode 100644 index da21c0a32..000000000 --- a/src/main/java/com/jozufozu/flywheel/light/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ - -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.light; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/FogUpdateMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/FogUpdateMixin.java index 69a30e22a..1eea4af61 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/FogUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/FogUpdateMixin.java @@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.jozufozu.flywheel.core.uniform.FlwShaderUniforms; +import com.jozufozu.flywheel.lib.uniform.FlwShaderUniforms; import net.minecraft.client.renderer.FogRenderer; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java index 42c36b249..ee4ec1be8 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/LevelRendererMixin.java @@ -10,12 +10,12 @@ import org.spongepowered.asm.mixin.injection.At.Shift; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.BeginFrameEvent; +import com.jozufozu.flywheel.api.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.api.event.RenderContext; +import com.jozufozu.flywheel.api.event.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStageEvent; import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.core.RenderContext; -import com.jozufozu.flywheel.event.BeginFrameEvent; -import com.jozufozu.flywheel.event.ReloadRenderersEvent; -import com.jozufozu.flywheel.event.RenderStageEvent; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix4f; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java index da170f6f8..458188388 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java @@ -4,7 +4,7 @@ import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; -import com.jozufozu.flywheel.backend.instancing.batching.DrawBufferSet; +import com.jozufozu.flywheel.backend.engine.batching.DrawBufferSet; import com.jozufozu.flywheel.extension.RenderTypeExtension; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java index 4c6ae7a8d..319f2cca4 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/light/NetworkLightUpdateMixin.java @@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.jozufozu.flywheel.backend.RenderWork; +import com.jozufozu.flywheel.lib.util.RenderWork; import com.jozufozu.flywheel.light.LightUpdater; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java index 78e295d9d..e3e807723 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.mixin.matrix; import org.spongepowered.asm.mixin.Mixin; -import com.jozufozu.flywheel.util.transform.TransformStack; +import com.jozufozu.flywheel.lib.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Quaternion; diff --git a/src/main/java/com/jozufozu/flywheel/util/StringUtil.java b/src/main/java/com/jozufozu/flywheel/util/StringUtil.java index 1d316b47c..fdc2fa8a3 100644 --- a/src/main/java/com/jozufozu/flywheel/util/StringUtil.java +++ b/src/main/java/com/jozufozu/flywheel/util/StringUtil.java @@ -18,7 +18,7 @@ import javax.annotation.Nonnull; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.backend.memory.FlwMemoryTracker; +import com.jozufozu.flywheel.lib.memory.FlwMemoryTracker; public class StringUtil { diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java index 7929aa659..178d1378f 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java @@ -5,16 +5,16 @@ import java.util.List; import org.jetbrains.annotations.NotNull; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.InstancerManager; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; -import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.hardcoded.ModelPart; -import com.jozufozu.flywheel.core.model.SimpleLazyModel; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.core.structs.oriented.OrientedPart; +import com.jozufozu.flywheel.lib.material.Materials; +import com.jozufozu.flywheel.lib.model.SimpleLazyModel; +import com.jozufozu.flywheel.lib.modelpart.ModelPart; +import com.jozufozu.flywheel.lib.struct.OrientedPart; +import com.jozufozu.flywheel.lib.struct.StructTypes; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java index 843bbd2b3..9488f6354 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java @@ -7,17 +7,17 @@ import java.util.function.BiFunction; import org.jetbrains.annotations.NotNull; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.InstancerManager; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; -import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.hardcoded.ModelPart; -import com.jozufozu.flywheel.core.model.SimpleLazyModel; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.core.structs.oriented.OrientedPart; -import com.jozufozu.flywheel.core.structs.transformed.TransformedPart; +import com.jozufozu.flywheel.lib.material.Materials; +import com.jozufozu.flywheel.lib.model.SimpleLazyModel; +import com.jozufozu.flywheel.lib.modelpart.ModelPart; +import com.jozufozu.flywheel.lib.struct.OrientedPart; +import com.jozufozu.flywheel.lib.struct.StructTypes; +import com.jozufozu.flywheel.lib.struct.TransformedPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java index 37ee11243..7c5561ef8 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java @@ -2,20 +2,20 @@ package com.jozufozu.flywheel.vanilla; import org.jetbrains.annotations.NotNull; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.TickableInstance; import com.jozufozu.flywheel.api.instancer.InstancerManager; +import com.jozufozu.flywheel.api.model.Mesh; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; -import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.hardcoded.ModelPart; -import com.jozufozu.flywheel.core.model.Mesh; -import com.jozufozu.flywheel.core.model.Models; -import com.jozufozu.flywheel.core.model.SimpleLazyModel; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.core.structs.transformed.TransformedPart; +import com.jozufozu.flywheel.lib.material.Materials; +import com.jozufozu.flywheel.lib.model.Models; +import com.jozufozu.flywheel.lib.model.SimpleLazyModel; +import com.jozufozu.flywheel.lib.modelpart.ModelPart; +import com.jozufozu.flywheel.lib.struct.StructTypes; +import com.jozufozu.flywheel.lib.struct.TransformedPart; +import com.jozufozu.flywheel.lib.transform.TransformStack; import com.jozufozu.flywheel.util.AnimationTickHolder; -import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java index 4c764d167..3a423e3fb 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java @@ -4,18 +4,18 @@ import java.util.Collections; import java.util.List; import java.util.function.Function; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instancer.InstancedPart; import com.jozufozu.flywheel.api.instancer.InstancerManager; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; -import com.jozufozu.flywheel.core.Materials; -import com.jozufozu.flywheel.core.hardcoded.ModelPart; -import com.jozufozu.flywheel.core.model.SimpleLazyModel; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.core.structs.transformed.TransformedPart; +import com.jozufozu.flywheel.lib.material.Materials; +import com.jozufozu.flywheel.lib.model.SimpleLazyModel; +import com.jozufozu.flywheel.lib.modelpart.ModelPart; +import com.jozufozu.flywheel.lib.struct.StructTypes; +import com.jozufozu.flywheel.lib.struct.TransformedPart; +import com.jozufozu.flywheel.lib.transform.TransformStack; import com.jozufozu.flywheel.util.AnimationTickHolder; -import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/effect/ExampleEffect.java b/src/main/java/com/jozufozu/flywheel/vanilla/effect/ExampleEffect.java index d90edc46d..6fbca76e8 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/effect/ExampleEffect.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/effect/ExampleEffect.java @@ -8,17 +8,17 @@ import java.util.List; import org.joml.FrustumIntersection; import org.joml.Vector3f; -import com.jozufozu.flywheel.api.RenderStage; +import com.jozufozu.flywheel.api.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.api.event.RenderStage; import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.TickableInstance; import com.jozufozu.flywheel.api.instancer.InstancerManager; import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher; import com.jozufozu.flywheel.backend.instancing.effect.Effect; -import com.jozufozu.flywheel.core.model.Models; -import com.jozufozu.flywheel.core.structs.StructTypes; -import com.jozufozu.flywheel.core.structs.transformed.TransformedPart; -import com.jozufozu.flywheel.event.ReloadRenderersEvent; +import com.jozufozu.flywheel.lib.model.Models; +import com.jozufozu.flywheel.lib.struct.StructTypes; +import com.jozufozu.flywheel.lib.struct.TransformedPart; import com.jozufozu.flywheel.util.AnimationTickHolder; import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.jozufozu.flywheel.util.box.ImmutableBox; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/effect/package-info.java b/src/main/java/com/jozufozu/flywheel/vanilla/effect/package-info.java deleted file mode 100644 index 06269f440..000000000 --- a/src/main/java/com/jozufozu/flywheel/vanilla/effect/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.vanilla.effect; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/package-info.java b/src/main/java/com/jozufozu/flywheel/vanilla/package-info.java deleted file mode 100644 index 420204158..000000000 --- a/src/main/java/com/jozufozu/flywheel/vanilla/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package com.jozufozu.flywheel.vanilla; - -import javax.annotation.ParametersAreNonnullByDefault; - -import net.minecraft.MethodsReturnNonnullByDefault;