2727import com .llamalad7 .mixinextras .injector .ModifyReturnValue ;
2828import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
2929import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
30+ import com .mojang .blaze3d .buffers .GpuBufferSlice ;
3031import net .minecraft .client .render .Camera ;
3132import net .minecraft .client .render .GameRenderer ;
3233import net .minecraft .client .render .RenderTickCounter ;
3334import net .minecraft .client .render .WorldRenderer ;
3435import net .minecraft .client .util .ObjectAllocator ;
3536import net .minecraft .item .ItemStack ;
3637import org .joml .Matrix4f ;
38+ import org .joml .Vector4f ;
3739import org .spongepowered .asm .mixin .Mixin ;
3840import org .spongepowered .asm .mixin .injection .At ;
3941import org .spongepowered .asm .mixin .injection .Inject ;
@@ -48,24 +50,12 @@ private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo info) {
4850 }
4951 }
5052
51- /**
52- * Begins our 3d render after the game has rendered the world
53- * <pre>{@code
54- * float m = Math.max(h, (float)(Integer)this.client.options.getFov().getValue());
55- * Matrix4f matrix4f2 = this.getBasicProjectionMatrix(m);
56- * RenderSystem.setProjectionMatrix(matrix4f, ProjectionType.PERSPECTIVE);
57- * Quaternionf quaternionf = camera.getRotation().conjugate(new Quaternionf());
58- * Matrix4f matrix4f3 = (new Matrix4f()).rotation(quaternionf);
59- * this.client.worldRenderer.setupFrustum(camera.getPos(), matrix4f3, matrix4f2);
60- * this.client.worldRenderer.render(this.pool, renderTickCounter, bl, camera, this, matrix4f3, matrix4f);
61- * }</pre>
62- */
63- // @WrapOperation(method = "renderWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;render(Lnet/minecraft/client/util/ObjectAllocator;Lnet/minecraft/client/render/RenderTickCounter;ZLnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/GameRenderer;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;)V"))
64- // void onRenderWorld(WorldRenderer instance, ObjectAllocator allocator, RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, Matrix4f positionMatrix, Matrix4f projectionMatrix, Operation<Void> original) {
65- // original.call(instance, allocator, tickCounter, renderBlockOutline, camera, gameRenderer, positionMatrix, projectionMatrix);
66- //
67- // RenderMain.render3D(positionMatrix, projectionMatrix);
68- // }
53+ @ WrapOperation (method = "renderWorld" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/render/WorldRenderer;render(Lnet/minecraft/client/util/ObjectAllocator;Lnet/minecraft/client/render/RenderTickCounter;ZLnet/minecraft/client/render/Camera;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lorg/joml/Vector4f;Z)V" ))
54+ void onRenderWorld (WorldRenderer instance , ObjectAllocator allocator , RenderTickCounter tickCounter , boolean renderBlockOutline , Camera camera , Matrix4f positionMatrix , Matrix4f basicProjectionMatrix , Matrix4f projectionMatrix , GpuBufferSlice fogBuffer , Vector4f fogColor , boolean renderSky , Operation <Void > original ) {
55+ original .call (instance , allocator , tickCounter , renderBlockOutline , camera , positionMatrix , basicProjectionMatrix , projectionMatrix , fogBuffer , fogColor , renderSky );
56+
57+ RenderMain .render3D (positionMatrix , projectionMatrix );
58+ }
6959
7060 @ ModifyExpressionValue (method = "renderWorld" , at = @ At (value = "INVOKE" , target = "Ljava/lang/Math;max(FF)F" , ordinal = 0 ))
7161 private float modifyMax (float original ) {
0 commit comments