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 79b1c78b7..ed26e1f7b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java @@ -14,7 +14,7 @@ import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; import com.jozufozu.flywheel.core.Components; import com.jozufozu.flywheel.core.RenderContext; import com.jozufozu.flywheel.event.BeginFrameEvent; -import com.jozufozu.flywheel.util.extension.ClientLevelExtension; +import com.jozufozu.flywheel.extension.ClientLevelExtension; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchDrawingTracker.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchDrawingTracker.java index ef7cea552..b2de5a307 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchDrawingTracker.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchDrawingTracker.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.backend.instancing.batching; import java.util.HashSet; import java.util.Set; -import com.jozufozu.flywheel.util.extension.RenderTypeExtension; +import com.jozufozu.flywheel.extension.RenderTypeExtension; import com.mojang.blaze3d.vertex.BufferBuilder; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/jozufozu/flywheel/core/RenderContext.java b/src/main/java/com/jozufozu/flywheel/core/RenderContext.java index 0f4db1f6f..4664a052a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/RenderContext.java +++ b/src/main/java/com/jozufozu/flywheel/core/RenderContext.java @@ -2,7 +2,7 @@ package com.jozufozu.flywheel.core; import org.jetbrains.annotations.NotNull; -import com.jozufozu.flywheel.util.extension.Matrix4fExtension; +import com.jozufozu.flywheel.extension.Matrix4fExtension; import com.jozufozu.flywheel.util.joml.FrustumIntersection; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix4f; @@ -11,7 +11,6 @@ import net.minecraft.client.Camera; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.renderer.RenderBuffers; -import net.minecraft.world.phys.Vec3; public record RenderContext(LevelRenderer renderer, ClientLevel level, PoseStack stack, Matrix4f viewProjection, Matrix4f projection, RenderBuffers buffers, Camera camera, FrustumIntersection culler) { diff --git a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedStorageWriter.java b/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedStorageWriter.java index 23894b7ad..a9f370442 100644 --- a/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedStorageWriter.java +++ b/src/main/java/com/jozufozu/flywheel/core/structs/transformed/TransformedStorageWriter.java @@ -3,7 +3,7 @@ package com.jozufozu.flywheel.core.structs.transformed; import org.lwjgl.system.MemoryUtil; import com.jozufozu.flywheel.api.struct.StorageBufferWriter; -import com.jozufozu.flywheel.util.extension.MatrixExtension; +import com.jozufozu.flywheel.extension.MatrixWrite; public class TransformedStorageWriter implements StorageBufferWriter { @@ -14,8 +14,8 @@ public class TransformedStorageWriter implements StorageBufferWriter { public static final TransformedWriter INSTANCE = new TransformedWriter(); @@ -11,7 +11,7 @@ public class TransformedWriter extends ColoredLitWriter { super.write(ptr, d); ptr += 6; - ((MatrixExtension) (Object) d.model).flywheel$writeUnsafe(ptr); - ((MatrixExtension) (Object) d.normal).flywheel$writeUnsafe(ptr + 4 * 16); + ((MatrixWrite) (Object) d.model).flywheel$writeUnsafe(ptr); + ((MatrixWrite) (Object) d.normal).flywheel$writeUnsafe(ptr + 4 * 16); } } diff --git a/src/main/java/com/jozufozu/flywheel/core/uniform/ViewProvider.java b/src/main/java/com/jozufozu/flywheel/core/uniform/ViewProvider.java index 3c8448744..89175710e 100644 --- a/src/main/java/com/jozufozu/flywheel/core/uniform/ViewProvider.java +++ b/src/main/java/com/jozufozu/flywheel/core/uniform/ViewProvider.java @@ -8,7 +8,7 @@ import com.jozufozu.flywheel.core.Components; import com.jozufozu.flywheel.core.RenderContext; import com.jozufozu.flywheel.core.source.FileResolution; import com.jozufozu.flywheel.event.BeginFrameEvent; -import com.jozufozu.flywheel.util.extension.MatrixExtension; +import com.jozufozu.flywheel.extension.MatrixWrite; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.core.Vec3i; @@ -52,7 +52,7 @@ public class ViewProvider extends UniformProvider { var vp = context.viewProjection().copy(); vp.multiplyWithTranslation(-camX, -camY, -camZ); - MatrixExtension.writeUnsafe(vp, ptr); + MatrixWrite.writeUnsafe(vp, ptr); MemoryUtil.memPutFloat(ptr + 64, camX); MemoryUtil.memPutFloat(ptr + 68, camY); MemoryUtil.memPutFloat(ptr + 72, camZ); diff --git a/src/main/java/com/jozufozu/flywheel/util/extension/ClientLevelExtension.java b/src/main/java/com/jozufozu/flywheel/extension/ClientLevelExtension.java similarity index 94% rename from src/main/java/com/jozufozu/flywheel/util/extension/ClientLevelExtension.java rename to src/main/java/com/jozufozu/flywheel/extension/ClientLevelExtension.java index d6e6e8bd5..79baf9647 100644 --- a/src/main/java/com/jozufozu/flywheel/util/extension/ClientLevelExtension.java +++ b/src/main/java/com/jozufozu/flywheel/extension/ClientLevelExtension.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.extension; +package com.jozufozu.flywheel.extension; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.world.entity.Entity; diff --git a/src/main/java/com/jozufozu/flywheel/util/extension/Matrix3fExtension.java b/src/main/java/com/jozufozu/flywheel/extension/Matrix3fExtension.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/util/extension/Matrix3fExtension.java rename to src/main/java/com/jozufozu/flywheel/extension/Matrix3fExtension.java index a587ec537..ef8ce3cc6 100644 --- a/src/main/java/com/jozufozu/flywheel/util/extension/Matrix3fExtension.java +++ b/src/main/java/com/jozufozu/flywheel/extension/Matrix3fExtension.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.extension; +package com.jozufozu.flywheel.extension; import com.jozufozu.flywheel.util.joml.Matrix3f; diff --git a/src/main/java/com/jozufozu/flywheel/util/extension/Matrix4fExtension.java b/src/main/java/com/jozufozu/flywheel/extension/Matrix4fExtension.java similarity index 89% rename from src/main/java/com/jozufozu/flywheel/util/extension/Matrix4fExtension.java rename to src/main/java/com/jozufozu/flywheel/extension/Matrix4fExtension.java index 7651cf622..ea77ca703 100644 --- a/src/main/java/com/jozufozu/flywheel/util/extension/Matrix4fExtension.java +++ b/src/main/java/com/jozufozu/flywheel/extension/Matrix4fExtension.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.extension; +package com.jozufozu.flywheel.extension; import com.jozufozu.flywheel.util.joml.Matrix4f; diff --git a/src/main/java/com/jozufozu/flywheel/util/extension/MatrixExtension.java b/src/main/java/com/jozufozu/flywheel/extension/MatrixWrite.java similarity index 68% rename from src/main/java/com/jozufozu/flywheel/util/extension/MatrixExtension.java rename to src/main/java/com/jozufozu/flywheel/extension/MatrixWrite.java index d1e7253af..15dead550 100644 --- a/src/main/java/com/jozufozu/flywheel/util/extension/MatrixExtension.java +++ b/src/main/java/com/jozufozu/flywheel/extension/MatrixWrite.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.extension; +package com.jozufozu.flywheel.extension; import java.nio.ByteBuffer; @@ -9,7 +9,7 @@ import com.mojang.math.Matrix4f; * @see com.jozufozu.flywheel.mixin.matrix.Matrix3fMixin * @see com.jozufozu.flywheel.mixin.matrix.Matrix4fMixin */ -public interface MatrixExtension { +public interface MatrixWrite { /** * Write the contents of this object into sequential memory starting at the given address. @@ -19,14 +19,14 @@ public interface MatrixExtension { void flywheel$write(ByteBuffer buf); static void write(Matrix4f matrix, ByteBuffer buf) { - ((MatrixExtension) (Object) matrix).flywheel$write(buf); + ((MatrixWrite) (Object) matrix).flywheel$write(buf); } static void writeUnsafe(Matrix4f matrix, long ptr) { - ((MatrixExtension) (Object) matrix).flywheel$writeUnsafe(ptr); + ((MatrixWrite) (Object) matrix).flywheel$writeUnsafe(ptr); } static void writeUnsafe(Matrix3f matrix, long ptr) { - ((MatrixExtension) (Object) matrix).flywheel$writeUnsafe(ptr); + ((MatrixWrite) (Object) matrix).flywheel$writeUnsafe(ptr); } } diff --git a/src/main/java/com/jozufozu/flywheel/util/extension/RenderTypeExtension.java b/src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java similarity index 93% rename from src/main/java/com/jozufozu/flywheel/util/extension/RenderTypeExtension.java rename to src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java index 6398bb479..dbf31df06 100644 --- a/src/main/java/com/jozufozu/flywheel/util/extension/RenderTypeExtension.java +++ b/src/main/java/com/jozufozu/flywheel/extension/RenderTypeExtension.java @@ -1,4 +1,4 @@ -package com.jozufozu.flywheel.util.extension; +package com.jozufozu.flywheel.extension; import com.jozufozu.flywheel.backend.instancing.batching.DrawBuffer; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/ClientLevelMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/ClientLevelMixin.java index 38ccdda7e..e9208428f 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/ClientLevelMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/ClientLevelMixin.java @@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.google.common.collect.Lists; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import com.jozufozu.flywheel.util.extension.ClientLevelExtension; +import com.jozufozu.flywheel.extension.ClientLevelExtension; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.world.entity.Entity; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java index 454a11be8..622c9e1b8 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderTypeMixin.java @@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.jozufozu.flywheel.backend.instancing.batching.DrawBuffer; -import com.jozufozu.flywheel.util.extension.RenderTypeExtension; +import com.jozufozu.flywheel.extension.RenderTypeExtension; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix3fMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix3fMixin.java index 98fbe36ac..3447d2978 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix3fMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix3fMixin.java @@ -6,22 +6,31 @@ import org.lwjgl.system.MemoryUtil; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import com.jozufozu.flywheel.util.extension.Matrix3fExtension; -import com.jozufozu.flywheel.util.extension.MatrixExtension; +import com.jozufozu.flywheel.extension.Matrix3fExtension; +import com.jozufozu.flywheel.extension.MatrixWrite; import com.mojang.math.Matrix3f; @Mixin(Matrix3f.class) -public abstract class Matrix3fMixin implements MatrixExtension, Matrix3fExtension { +public abstract class Matrix3fMixin implements MatrixWrite, Matrix3fExtension { - @Shadow protected float m00; - @Shadow protected float m01; - @Shadow protected float m02; - @Shadow protected float m10; - @Shadow protected float m11; - @Shadow protected float m12; - @Shadow protected float m20; - @Shadow protected float m21; - @Shadow protected float m22; + @Shadow + protected float m00; + @Shadow + protected float m01; + @Shadow + protected float m02; + @Shadow + protected float m10; + @Shadow + protected float m11; + @Shadow + protected float m12; + @Shadow + protected float m20; + @Shadow + protected float m21; + @Shadow + protected float m22; @Override public void flywheel$writeUnsafe(long ptr) { diff --git a/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix4fMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix4fMixin.java index f556f7ce2..008677335 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix4fMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/matrix/Matrix4fMixin.java @@ -6,22 +6,31 @@ import org.lwjgl.system.MemoryUtil; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import com.jozufozu.flywheel.util.extension.Matrix4fExtension; -import com.jozufozu.flywheel.util.extension.MatrixExtension; +import com.jozufozu.flywheel.extension.Matrix4fExtension; +import com.jozufozu.flywheel.extension.MatrixWrite; import com.mojang.math.Matrix4f; @Mixin(Matrix4f.class) -public abstract class Matrix4fMixin implements MatrixExtension, Matrix4fExtension { +public abstract class Matrix4fMixin implements MatrixWrite, Matrix4fExtension { - @Shadow protected float m00; - @Shadow protected float m01; - @Shadow protected float m02; - @Shadow protected float m03; - @Shadow protected float m10; - @Shadow protected float m11; - @Shadow protected float m12; - @Shadow protected float m13; - @Shadow protected float m20; + @Shadow + protected float m00; + @Shadow + protected float m01; + @Shadow + protected float m02; + @Shadow + protected float m03; + @Shadow + protected float m10; + @Shadow + protected float m11; + @Shadow + protected float m12; + @Shadow + protected float m13; + @Shadow + protected float m20; @Shadow protected float m21; @Shadow protected float m22; @Shadow protected float m23;