This commit is contained in:
Moulberry committed 2024-08-31 13:28:18 +08:00
1 parent 60f19e7662
commit fcf1b4168f
26 files changed
+489 -65

No files matched your search

@@ -8,6 +8,7 @@ import com.moulberry.flashback.editor.ui.ReplayUI;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.HitResult;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -50,6 +51,15 @@ public class MixinGui {
}
}
@Inject(method = "renderVignette", at = @At("HEAD"), cancellable = true)
public void renderVignette(GuiGraphics guiGraphics, Entity entity, CallbackInfo ci) {
// The vignette ruins the transparency when trying to export with alpha
// The vignette is also probably unwanted in general when trying to record, so lets just get rid of it
if (Flashback.isInReplay()) {
ci.cancel();
}
}
@Inject(method = "canRenderCrosshairForSpectator", at = @At("HEAD"), cancellable = true)
public void canRenderCrosshairForSpectator(HitResult hitResult, CallbackInfoReturnable<Boolean> cir) {
if (Flashback.isExporting()) {
@@ -0,0 +1,22 @@
package com.moulberry.flashback.mixin.visuals;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.moulberry.flashback.Flashback;
import net.minecraft.client.renderer.RenderStateShard;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(RenderStateShard.class)
public class MixinRenderStateShard {
@WrapOperation(method = "setupGlintTexturing", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;getMillis()J"))
private static long setupGlintTexturing(Operation<Long> original) {
if (Flashback.isExporting()) {
double currentTick = Flashback.EXPORT_JOB.getCurrentTickDouble();
return (long)(currentTick / 20 * 1000);
}
return original.call();
}
}