Enable Quick Mode for 1.8.x

This commit is contained in:
Jonas Herzig
2022-03-06 11:46:01 +01:00
parent 74049dad77
commit 1fa027f362
4 changed files with 16 additions and 14 deletions

View File

@@ -338,7 +338,7 @@ dependencies {
shadow 'com.github.ReplayMod.JavaBlend:2.79.0:a0696f8' shadow 'com.github.ReplayMod.JavaBlend:2.79.0:a0696f8'
shadow "com.github.ReplayMod:ReplayStudio:9c5dec8", shadeExclusions shadow "com.github.ReplayMod:ReplayStudio:6d081f6", shadeExclusions
implementation(FABRIC ? dependencies.project(path: jGui.path, configuration: "namedElements") : jGui) { implementation(FABRIC ? dependencies.project(path: jGui.path, configuration: "namedElements") : jGui) {
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those

View File

@@ -465,7 +465,7 @@ If you have a Replay in a dark setting (for example at nighttime, or in a cave)
This works as a replacement for the **Night Vision Potion Effect**, without the side effect of a weird sky color. This works as a replacement for the **Night Vision Potion Effect**, without the side effect of a weird sky color.
## Quick Mode [quickmode] (Minecraft 1.9 and up) ## Quick Mode [quickmode]
![](img/quickmode-icon.jpg) ![](img/quickmode-icon.jpg)
In **Quick Mode**, this clock symbol is displayed in the lower right corner of the screen. In **Quick Mode**, this clock symbol is displayed in the lower right corner of the screen.
@@ -473,8 +473,6 @@ When you first enable **Quick Mode** in a replay, an internal reference of certa
As a side effect, certain features like particles and second skin layers will not be rendered in the preview. As a side effect, certain features like particles and second skin layers will not be rendered in the preview.
By default, **Quick Mode** is toggled with `Q`. By default, **Quick Mode** is toggled with `Q`.
**Quick Mode** is available in ReplayMod for Minecraft 1.9.4 and up.
## Player Overview [overview] ## Player Overview [overview]
![](img/player-overview.jpg) ![](img/player-overview.jpg)
The **Player Overview** Screen The **Player Overview** Screen

View File

@@ -1,4 +1,4 @@
//#if MC>=10904 //#if MC>=10800
package com.replaymod.replay; package com.replaymod.replay;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
@@ -78,7 +78,11 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
wrappedBuf.writerIndex(size); wrappedBuf.writerIndex(size);
PacketByteBuf packetByteBuf = new PacketByteBuf(wrappedBuf); PacketByteBuf packetByteBuf = new PacketByteBuf(wrappedBuf);
//#if MC>=10809
Packet<?> mcPacket; Packet<?> mcPacket;
//#else
//$$ Packet mcPacket;
//#endif
//#if MC>=11700 //#if MC>=11700
//$$ mcPacket = NetworkState.PLAY.getPacketHandler(NetworkSide.CLIENTBOUND, packet.getId(), packetByteBuf); //$$ mcPacket = NetworkState.PLAY.getPacketHandler(NetworkSide.CLIENTBOUND, packet.getId(), packetByteBuf);
//#elseif MC>=11500 //#elseif MC>=11500

View File

@@ -69,7 +69,7 @@ import net.minecraft.entity.LivingEntity;
//$$ import io.netty.channel.ChannelOutboundHandlerAdapter; //$$ import io.netty.channel.ChannelOutboundHandlerAdapter;
//#endif //#endif
//#if MC<10904 //#if MC<10800
//$$ import de.johni0702.minecraft.gui.element.GuiLabel; //$$ import de.johni0702.minecraft.gui.element.GuiLabel;
//$$ import de.johni0702.minecraft.gui.popup.GuiInfoPopup; //$$ import de.johni0702.minecraft.gui.popup.GuiInfoPopup;
//$$ import de.johni0702.minecraft.gui.utils.Colors; //$$ import de.johni0702.minecraft.gui.utils.Colors;
@@ -119,11 +119,11 @@ public class ReplayHandler {
* Decodes and sends packets into channel. * Decodes and sends packets into channel.
*/ */
private final FullReplaySender fullReplaySender; private final FullReplaySender fullReplaySender;
//#if MC>=10904 //#if MC>=10800
private final QuickReplaySender quickReplaySender; private final QuickReplaySender quickReplaySender;
private boolean quickMode = false; private boolean quickMode = false;
//#else //#else
//$$ private static final String QUICK_MODE_MIN_MC = "1.9.4"; //$$ private static final String QUICK_MODE_MIN_MC = "1.8";
//#endif //#endif
/** /**
@@ -160,7 +160,7 @@ public class ReplayHandler {
markers = replayFile.getMarkers().or(Collections.emptySet()); markers = replayFile.getMarkers().or(Collections.emptySet());
fullReplaySender = new FullReplaySender(this, replayFile, false); fullReplaySender = new FullReplaySender(this, replayFile, false);
//#if MC>=10904 //#if MC>=10800
quickReplaySender = new QuickReplaySender(ReplayModReplay.instance, replayFile); quickReplaySender = new QuickReplaySender(ReplayModReplay.instance, replayFile);
//#endif //#endif
@@ -206,7 +206,7 @@ public class ReplayHandler {
ReplayClosingCallback.EVENT.invoker().replayClosing(this); ReplayClosingCallback.EVENT.invoker().replayClosing(this);
fullReplaySender.terminateReplay(); fullReplaySender.terminateReplay();
//#if MC>=10904 //#if MC>=10800
if (quickMode) { if (quickMode) {
quickReplaySender.unregister(); quickReplaySender.unregister();
} }
@@ -308,7 +308,7 @@ public class ReplayHandler {
//$$ channel = new EmbeddedChannel(dummyHandler); //$$ channel = new EmbeddedChannel(dummyHandler);
//$$ channel.pipeline().remove(dummyHandler); //$$ channel.pipeline().remove(dummyHandler);
//#endif //#endif
//#if MC>=10904 //#if MC>=10800
channel.pipeline().addLast("ReplayModReplay_quickReplaySender", quickReplaySender); channel.pipeline().addLast("ReplayModReplay_quickReplaySender", quickReplaySender);
//#endif //#endif
channel.pipeline().addLast("ReplayModReplay_replaySender", fullReplaySender); channel.pipeline().addLast("ReplayModReplay_replaySender", fullReplaySender);
@@ -329,7 +329,7 @@ public class ReplayHandler {
} }
public ReplaySender getReplaySender() { public ReplaySender getReplaySender() {
//#if MC>=10904 //#if MC>=10800
return quickMode ? quickReplaySender : fullReplaySender; return quickMode ? quickReplaySender : fullReplaySender;
//#else //#else
//$$ return fullReplaySender; //$$ return fullReplaySender;
@@ -340,7 +340,7 @@ public class ReplayHandler {
return overlay; return overlay;
} }
//#if MC>=10904 //#if MC>=10800
public void ensureQuickModeInitialized(Runnable andThen) { public void ensureQuickModeInitialized(Runnable andThen) {
if (Utils.ifMinimalModeDoPopup(overlay, () -> {})) return; if (Utils.ifMinimalModeDoPopup(overlay, () -> {})) return;
ListenableFuture<Void> future = quickReplaySender.getInitializationPromise(); ListenableFuture<Void> future = quickReplaySender.getInitializationPromise();
@@ -538,7 +538,7 @@ public class ReplayHandler {
return; // path playback, rendering, etc. -> no jumping allowed return; // path playback, rendering, etc. -> no jumping allowed
} }
//#if MC>=10904 //#if MC>=10800
if (getReplaySender() == quickReplaySender) { if (getReplaySender() == quickReplaySender) {
// Always round to full tick // Always round to full tick
targetTime = targetTime + targetTime % 50; targetTime = targetTime + targetTime % 50;