mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-02 06:28:48 +00:00
0.5.0
This commit is contained in:
1 parent
9c62ea4191
commit
d589647c36
49 files changed
+958
-271
No files matched your search
@@ -115,7 +115,8 @@ public abstract class MixinLevelRenderer {
|
||||
if (Flashback.isExporting() && Flashback.EXPORT_JOB.getSettings().transparent()) {
|
||||
RenderSystem.clearColor(0.0f, 0.0f, 0.0f, 0.0F);
|
||||
} else {
|
||||
RenderSystem.clearColor(0.0f, 1.0f, 0.0f, 0.0F);
|
||||
float[] skyColour = editorState.replayVisuals.skyColour;
|
||||
RenderSystem.clearColor(skyColour[0], skyColour[1], skyColour[2], 0.0F);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,10 +47,11 @@ public class MixinAudioLibrary {
|
||||
public long init_createContext(long deviceHandle, IntBuffer attrList, Operation<Long> original) {
|
||||
if (this.usingLoopbackDevice) {
|
||||
try (MemoryStack memoryStack = MemoryStack.stackPush()) {
|
||||
int channels = Flashback.EXPORT_JOB.getSettings().stereoAudio() ? SOFTLoopback.ALC_STEREO_SOFT : SOFTLoopback.ALC_MONO_SOFT;
|
||||
IntBuffer intBuffer = memoryStack.callocInt(7)
|
||||
.put(SOFTLoopback.ALC_FORMAT_TYPE_SOFT).put(SOFTLoopback.ALC_FLOAT_SOFT)
|
||||
.put(SOFTLoopback.ALC_FORMAT_CHANNELS_SOFT).put(SOFTLoopback.ALC_MONO_SOFT)
|
||||
.put(ALC10.ALC_FREQUENCY).put(44100)
|
||||
.put(SOFTLoopback.ALC_FORMAT_CHANNELS_SOFT).put(channels)
|
||||
.put(ALC10.ALC_FREQUENCY).put(48000)
|
||||
.put(0).flip();
|
||||
return ALC10.alcCreateContext(this.currentDevice, intBuffer);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.moulberry.flashback.mixin.audio;
|
||||
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import com.moulberry.flashback.playback.ReplayServer;
|
||||
import net.minecraft.client.resources.sounds.SoundInstance;
|
||||
import net.minecraft.client.sounds.SoundEngine;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(SoundEngine.class)
|
||||
@@ -26,4 +29,12 @@ public class MixinSoundEngine {
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "play", at = @At("HEAD"), cancellable = true)
|
||||
public void play(SoundInstance soundInstance, CallbackInfo ci) {
|
||||
ReplayServer replayServer = Flashback.getReplayServer();
|
||||
if (replayServer != null && Flashback.EXPORT_JOB == null && replayServer.replayPaused) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,9 +5,11 @@ import de.johni0702.minecraft.bobby.FakeChunkManager;
|
||||
import net.minecraft.client.multiplayer.ClientPacketListener;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@IfModLoaded("bobby")
|
||||
@Pseudo
|
||||
@Mixin(value = FakeChunkManager.class, remap = false)
|
||||
public interface FakeChunkManagerAccessor {
|
||||
|
||||
|
||||
@@ -8,9 +8,11 @@ import de.johni0702.minecraft.bobby.Bobby;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.server.IntegratedServer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
@IfModLoaded("bobby")
|
||||
@Pseudo
|
||||
@Mixin(value = Bobby.class)
|
||||
public class MixinBobby {
|
||||
|
||||
|
||||
+2
@@ -10,6 +10,7 @@ import net.minecraft.client.multiplayer.ClientPacketListener;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@@ -17,6 +18,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@IfModLoaded("bobby")
|
||||
@Pseudo
|
||||
@Mixin(value = FakeChunkManager.class, remap = false)
|
||||
public class MixinBobbyFakeChunkManager {
|
||||
|
||||
|
||||
+2
@@ -4,11 +4,13 @@ import com.moulberry.flashback.Flashback;
|
||||
import com.moulberry.mixinconstraints.annotations.IfModLoaded;
|
||||
import net.irisshaders.iris.uniforms.SystemTimeUniforms;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@IfModLoaded("iris")
|
||||
@Pseudo
|
||||
@Mixin(value = SystemTimeUniforms.Timer.class, remap = false)
|
||||
public class MixinIrisSystemTimeUniforms {
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.moulberry.flashback.mixin.compat.replaymod;
|
||||
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import com.moulberry.mixinconstraints.annotations.IfModLoaded;
|
||||
import com.replaymod.recording.ReplayModRecording;
|
||||
import net.minecraft.network.Connection;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@IfModLoaded("replaymod")
|
||||
@Pseudo
|
||||
@Mixin(value = ReplayModRecording.class, remap = false)
|
||||
public class MixinReplayModRecording {
|
||||
|
||||
@Inject(method = "initiateRecording", at = @At("HEAD"), cancellable = true)
|
||||
public void initiateRecording(Connection networkManager, CallbackInfo ci) {
|
||||
if (Flashback.isInReplay()) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -9,9 +9,11 @@ import de.maxhenkel.voicechat.voice.client.speaker.ALSpeakerBase;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
@IfModLoaded("voicechat")
|
||||
@Pseudo
|
||||
@Mixin(ALSpeakerBase.class)
|
||||
public class MixinVoiceChatALSpeakerBase {
|
||||
|
||||
|
||||
+2
@@ -5,11 +5,13 @@ import com.moulberry.mixinconstraints.annotations.IfModLoaded;
|
||||
import de.maxhenkel.voicechat.voice.client.ClientVoicechat;
|
||||
import de.maxhenkel.voicechat.voice.client.ClientVoicechatConnection;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@IfModLoaded("voicechat")
|
||||
@Pseudo
|
||||
@Mixin(value = ClientVoicechat.class, remap = false)
|
||||
public class MixinVoiceChatClientVoicechat {
|
||||
|
||||
|
||||
+2
@@ -6,12 +6,14 @@ import de.maxhenkel.voicechat.voice.client.RenderEvents;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@IfModLoaded("voicechat")
|
||||
@Pseudo
|
||||
@Mixin(value = RenderEvents.class, remap = false)
|
||||
public class MixinVoiceChatRenderEvents {
|
||||
|
||||
|
||||
+2
@@ -6,11 +6,13 @@ import de.maxhenkel.voicechat.voice.client.SoundManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.openal.EXTThreadLocalContext;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@IfModLoaded("voicechat")
|
||||
@Pseudo
|
||||
@Mixin(value = SoundManager.class, remap = false)
|
||||
public class MixinVoiceChatSoundManager {
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.moulberry.flashback.mixin.movement;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import com.moulberry.flashback.configuration.FlashbackConfig;
|
||||
import com.moulberry.flashback.state.EditorState;
|
||||
import com.moulberry.flashback.state.EditorStateManager;
|
||||
import net.minecraft.client.MouseHandler;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
||||
@Mixin(MouseHandler.class)
|
||||
public class MixinMouseHandler {
|
||||
|
||||
@WrapOperation(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;turn(DD)V"))
|
||||
public void turnPlayer_turn(LocalPlayer instance, double x, double y, Operation<Void> original) {
|
||||
if (Flashback.isInReplay()) {
|
||||
FlashbackConfig config = Flashback.getConfig();
|
||||
if (config.flightLockYaw) {
|
||||
x = 0.0f;
|
||||
}
|
||||
if (config.flightLockPitch) {
|
||||
y = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
original.call(instance, x, y);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.moulberry.flashback.mixin.movement;
|
||||
|
||||
import com.moulberry.flashback.EnhancedFlight;
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import com.moulberry.flashback.configuration.FlashbackConfig;
|
||||
import com.moulberry.flashback.state.EditorState;
|
||||
import com.moulberry.flashback.state.EditorStateManager;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(value = Player.class, priority = 1100)
|
||||
public abstract class MixinPlayerEntity extends LivingEntity {
|
||||
|
||||
protected MixinPlayerEntity() {
|
||||
super(null, null);
|
||||
}
|
||||
|
||||
@Shadow public abstract void travel(Vec3 movementInput);
|
||||
|
||||
@Shadow
|
||||
protected abstract float getFlyingSpeed();
|
||||
|
||||
@Inject(method="getFlyingSpeed", at=@At("HEAD"), cancellable = true)
|
||||
public void getFlyingSpeed(CallbackInfoReturnable<Float> cir) {
|
||||
if ((Object)this instanceof LocalPlayer player && Flashback.isInReplay()) {
|
||||
FlashbackConfig config = Flashback.getConfig();
|
||||
|
||||
boolean doAirplaneFlight = config.flightCameraDirection || config.flightMomentum < 0.98;
|
||||
if (doAirplaneFlight && player.getAbilities().flying && !player.isPassenger() && !player.isFallFlying()) {
|
||||
cir.setReturnValue(EnhancedFlight.getFlightSpeed(player, config));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method="travel", at=@At(value = "HEAD"), cancellable = true)
|
||||
public void travel(Vec3 movementInput, CallbackInfo ci) {
|
||||
if ((Object)this instanceof LocalPlayer player && Flashback.isInReplay()) {
|
||||
FlashbackConfig config = Flashback.getConfig();
|
||||
|
||||
boolean doAirplaneFlight = config.flightCameraDirection || config.flightMomentum < 0.98 ||
|
||||
config.flightLockX || config.flightLockY || config.flightLockZ;
|
||||
if (doAirplaneFlight && player.getAbilities().flying && !player.isPassenger() && !player.isFallFlying()) {
|
||||
EnhancedFlight.doFlight(player, config, movementInput, this.getFlyingSpeed(), super::travel);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,14 +44,14 @@ public class MixinClientLevel {
|
||||
@Inject(method = "playSeededSound(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/core/Holder;Lnet/minecraft/sounds/SoundSource;FFJ)V", at = @At("RETURN"))
|
||||
public void playSeededSoundEntity(@Nullable Player player, Entity entity, Holder<SoundEvent> holder, SoundSource soundSource, float volume, float pitch, long seed, CallbackInfo ci) {
|
||||
if (player != null && player == this.minecraft.player && Flashback.RECORDER != null && !Flashback.RECORDER.isPaused()) {
|
||||
Flashback.RECORDER.writePacketAsync(new ClientboundSoundEntityPacket(holder, soundSource, entity, volume, pitch, seed), ConnectionProtocol.PLAY);
|
||||
Flashback.RECORDER.writeEntitySound(holder, soundSource, entity, volume, pitch, seed);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "playSeededSound(Lnet/minecraft/world/entity/player/Player;DDDLnet/minecraft/core/Holder;Lnet/minecraft/sounds/SoundSource;FFJ)V", at = @At("RETURN"))
|
||||
public void playSeededSoundNormal(@Nullable Player player, double x, double y, double z, Holder<SoundEvent> holder, SoundSource soundSource, float volume, float pitch, long seed, CallbackInfo ci) {
|
||||
if (player != null && player == this.minecraft.player && Flashback.RECORDER != null && !Flashback.RECORDER.isPaused()) {
|
||||
Flashback.RECORDER.writePacketAsync(new ClientboundSoundPacket(holder, soundSource, x, y, z, volume, pitch, seed), ConnectionProtocol.PLAY);
|
||||
Flashback.RECORDER.writeSound(holder, soundSource, x, y, z, volume, pitch, seed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user