Skip to content

Commit

Permalink
styling
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Apr 20, 2024
1 parent fe51bc9 commit 127eb67
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/main/java/net/krlite/flash/mixin/GameRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,26 @@ public abstract class GameRendererMixin {
@Unique
private DrawContext context;

@ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/toast/ToastManager;draw(Lnet/minecraft/client/gui/DrawContext;)V"))
@ModifyArg(
method = "render",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/toast/ToastManager;draw(Lnet/minecraft/client/gui/DrawContext;)V"
)
)
private DrawContext getMatrixStack(DrawContext context) {
this.context = context;
return context;
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;pop()V", shift = At.Shift.AFTER))
@Inject(
method = "render",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/util/math/MatrixStack;pop()V",
shift = At.Shift.AFTER
)
)
private void renderScreenshotFlash(float tickDelta, long startTime, boolean tick, CallbackInfo ci) {
if (
MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().currentScreen == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@

@Mixin(ScreenshotRecorder.class)
public abstract class ScreenshotRecorderMixin {
@Inject(method = "saveScreenshotInner", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/ScreenshotRecorder;takeScreenshot(Lnet/minecraft/client/gl/Framebuffer;)Lnet/minecraft/client/texture/NativeImage;"))
@Inject(
method = "saveScreenshotInner",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/util/ScreenshotRecorder;takeScreenshot(Lnet/minecraft/client/gl/Framebuffer;)Lnet/minecraft/client/texture/NativeImage;"
)
)
private static void saveScreenshotInner(File gameDirectory, String fileName, Framebuffer framebuffer, Consumer<Text> messageReceiver, CallbackInfo ci) {
Flash.Sounds.playCameraShutter();
Flash.screenshot(framebuffer);
Expand Down

0 comments on commit 127eb67

Please sign in to comment.