Update to 20w22a (minimal mode only)
This commit is contained in:
@@ -591,14 +591,27 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
packet.getSeed(),
|
||||
//#endif
|
||||
false,
|
||||
//#if MC>=11600
|
||||
//$$ packet.method_29443(),
|
||||
//$$ (net.minecraft.world.dimension.DimensionTracker.Modifiable) packet.getDimension(),
|
||||
//$$ packet.method_29444(),
|
||||
//$$ packet.getDimensionId(),
|
||||
//#else
|
||||
packet.getDimension(),
|
||||
//#endif
|
||||
0, // max players (has no getter -> never actually used)
|
||||
//#if MC<11600
|
||||
packet.getGeneratorType(),
|
||||
//#endif
|
||||
packet.getChunkLoadDistance(),
|
||||
packet.hasReducedDebugInfo()
|
||||
//#if MC>=11500
|
||||
, packet.showsDeathScreen()
|
||||
//#endif
|
||||
//#if MC>=11600
|
||||
//$$ , packet.isDebugWorld()
|
||||
//$$ , packet.isFlatWorld()
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
@@ -638,12 +651,22 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
PlayerRespawnS2CPacket respawn = (PlayerRespawnS2CPacket) p;
|
||||
//#if MC>=11400
|
||||
p = new PlayerRespawnS2CPacket(
|
||||
//#if MC>=11600
|
||||
//$$ respawn.method_29445(),
|
||||
//#endif
|
||||
respawn.getDimension(),
|
||||
//#if MC>=11500
|
||||
respawn.getSha256Seed(),
|
||||
//#endif
|
||||
//#if MC>=11600
|
||||
//$$ GameMode.SPECTATOR,
|
||||
//$$ respawn.isDebugWorld(),
|
||||
//$$ respawn.isFlatWorld(),
|
||||
//$$ respawn.isWritingErrorSkippable()
|
||||
//#else
|
||||
respawn.getGeneratorType(),
|
||||
GameMode.SPECTATOR
|
||||
//#endif
|
||||
);
|
||||
//#else
|
||||
//#if MC>=10809
|
||||
|
||||
@@ -45,11 +45,20 @@ public class InputReplayTimer extends WrappedTimer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginRenderTick(
|
||||
public
|
||||
//#if MC>=11600
|
||||
//$$ int
|
||||
//#else
|
||||
void
|
||||
//#endif
|
||||
beginRenderTick(
|
||||
//#if MC>=11400
|
||||
long sysClock
|
||||
//#endif
|
||||
) {
|
||||
//#if MC>=11600
|
||||
//$$ int ticksThisFrame =
|
||||
//#endif
|
||||
super.beginRenderTick(
|
||||
//#if MC>=11400
|
||||
sysClock
|
||||
@@ -114,6 +123,9 @@ public class InputReplayTimer extends WrappedTimer {
|
||||
//$$ }
|
||||
//#endif
|
||||
}
|
||||
//#if MC>=11600
|
||||
//$$ return ticksThisFrame;
|
||||
//#endif
|
||||
}
|
||||
|
||||
public static void handleScroll(int wheel) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
import net.minecraft.world.level.LevelGeneratorType;
|
||||
|
||||
//#if FABRIC>=1
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
||||
@@ -40,6 +39,11 @@ import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.world.World;
|
||||
//#else
|
||||
import net.minecraft.world.level.LevelGeneratorType;
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
//#else
|
||||
@@ -190,6 +194,15 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
||||
public void restart() {
|
||||
replay.reset();
|
||||
ctx.fireChannelRead(new PlayerRespawnS2CPacket(
|
||||
//#if MC>=11600
|
||||
//$$ DimensionType.OVERWORLD_REGISTRY_KEY,
|
||||
//$$ World.field_25179,
|
||||
//$$ 0,
|
||||
//$$ GameMode.SPECTATOR,
|
||||
//$$ false,
|
||||
//$$ false,
|
||||
//$$ false
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
DimensionType.OVERWORLD,
|
||||
//#else
|
||||
@@ -203,6 +216,7 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
||||
//#endif
|
||||
LevelGeneratorType.DEFAULT,
|
||||
GameMode.SPECTATOR
|
||||
//#endif
|
||||
));
|
||||
ctx.fireChannelRead(new PlayerPositionLookS2CPacket(0, 0, 0, 0, 0, Collections.emptySet(), 0));
|
||||
}
|
||||
|
||||
@@ -19,15 +19,17 @@ import com.replaymod.replay.gui.overlay.GuiReplayOverlay;
|
||||
import com.replaymod.replaystudio.data.Marker;
|
||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
|
||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import de.johni0702.minecraft.gui.element.GuiLabel;
|
||||
import de.johni0702.minecraft.gui.element.advanced.GuiProgressBar;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.embedded.EmbeddedChannel;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.network.ClientLoginNetworkHandler;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -36,6 +38,10 @@ import net.minecraft.network.ClientConnection;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
//#if MC>=11500
|
||||
//$$ import net.minecraft.client.util.math.MatrixStack;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -180,7 +186,7 @@ public class ReplayHandler {
|
||||
//#else
|
||||
//$$ // We need to re-set the GUI screen because having one with `allowsUserInput = true` active during world
|
||||
//$$ // load (i.e. before player is set) will crash MC...
|
||||
//$$ mc.displayGuiScreen(new GuiScreen() {});
|
||||
//$$ mc.displayGuiScreen(new net.minecraft.client.gui.GuiScreen() {});
|
||||
//$$ mc.loadWorld(null);
|
||||
//#endif
|
||||
|
||||
@@ -592,22 +598,10 @@ public class ReplayHandler {
|
||||
replaySender.jumpToTime(targetTime);
|
||||
} else { // We either have to restart the replay or send a significant amount of packets
|
||||
// Render our please-wait-screen
|
||||
Screen guiScreen = new Screen(
|
||||
//#if MC>=11400
|
||||
null
|
||||
//#endif
|
||||
) {
|
||||
@Override
|
||||
//#if MC>=11400
|
||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
||||
//#else
|
||||
//$$ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
//#endif
|
||||
renderDirtBackground(0);
|
||||
drawCenteredString(this.minecraft.textRenderer, I18n.translate("replaymod.gui.pleasewait"),
|
||||
width / 2, height / 2, 0xffffffff);
|
||||
}
|
||||
};
|
||||
GuiScreen guiScreen = new GuiScreen();
|
||||
guiScreen.setBackground(AbstractGuiScreen.Background.DIRT);
|
||||
guiScreen.addElements(new HorizontalLayout.Data(0.5),
|
||||
new GuiLabel().setI18nText("replaymod.gui.pleasewait"));
|
||||
|
||||
// Make sure that the replaysender changes into sync mode
|
||||
replaySender.setSyncModeAndWait();
|
||||
@@ -648,12 +642,17 @@ public class ReplayHandler {
|
||||
//$$ ScaledResolution
|
||||
//#endif
|
||||
resolution = newScaledResolution(mc);
|
||||
guiScreen.init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
|
||||
//#if MC>=11400
|
||||
guiScreen.render(0, 0, 0);
|
||||
guiScreen.toMinecraft().init(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
|
||||
//#if MC>=11600
|
||||
//$$ guiScreen.toMinecraft().render(new MatrixStack(), 0, 0, 0);
|
||||
//#else
|
||||
//$$ guiScreen.drawScreen(0, 0, 0);
|
||||
//#if MC>=11400
|
||||
guiScreen.toMinecraft().render(0, 0, 0);
|
||||
//#else
|
||||
//$$ guiScreen.toMinecraft().drawScreen(0, 0, 0);
|
||||
//#endif
|
||||
//#endif
|
||||
guiScreen.toMinecraft().removed();
|
||||
|
||||
mc.getFramebuffer().endWrite();
|
||||
popMatrix();
|
||||
|
||||
@@ -153,6 +153,10 @@ public class CameraEntity
|
||||
//#if MC>=11200
|
||||
, recipeBook
|
||||
//#endif
|
||||
//#if MC>=11600
|
||||
//$$ , false
|
||||
//$$ , false
|
||||
//#endif
|
||||
);
|
||||
eventHandler.register();
|
||||
if (ReplayModReplay.instance.getReplayHandler().getSpectatedUUID() == null) {
|
||||
|
||||
@@ -10,6 +10,11 @@ import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.text.Text;
|
||||
//$$ import net.minecraft.text.TranslatableText;
|
||||
//#endif
|
||||
|
||||
//#if FABRIC>=1
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
|
||||
//#else
|
||||
@@ -56,6 +61,13 @@ public class GuiHandler extends EventRegistrations {
|
||||
// Pause replay when menu is opened
|
||||
mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
|
||||
//$$ final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
|
||||
//$$ final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
|
||||
//$$ final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
|
||||
//$$ final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
final String BUTTON_OPTIONS = I18n.translate("menu.options");
|
||||
final String BUTTON_EXIT_SERVER = I18n.translate("menu.disconnect");
|
||||
@@ -71,6 +83,7 @@ public class GuiHandler extends EventRegistrations {
|
||||
//$$ final int BUTTON_STATS = 6;
|
||||
//$$ final int BUTTON_OPEN_TO_LAN = 7;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
|
||||
//#if MC<11400
|
||||
@@ -85,7 +98,11 @@ public class GuiHandler extends EventRegistrations {
|
||||
//#endif
|
||||
boolean remove = false;
|
||||
//#if MC>=11400
|
||||
//#if MC>=11600
|
||||
//$$ Text id = b.getMessage();
|
||||
//#else
|
||||
String id = b.getMessage();
|
||||
//#endif
|
||||
if (id == null) {
|
||||
// likely a button of some third-part mod
|
||||
// e.g. https://github.com/Pokechu22/WorldDownloader/blob/b1b279f948beec2d7dac7524eea8f584a866d8eb/share_14/src/main/java/wdl/WDLHooks.java#L491
|
||||
@@ -104,7 +121,7 @@ public class GuiHandler extends EventRegistrations {
|
||||
b.y,
|
||||
width(b),
|
||||
height(b),
|
||||
I18n.translate("replaymod.gui.exit"),
|
||||
"replaymod.gui.exit",
|
||||
this::onButton
|
||||
));
|
||||
} else if (id.equals(BUTTON_ADVANCEMENTS)) {
|
||||
@@ -216,7 +233,7 @@ public class GuiHandler extends EventRegistrations {
|
||||
guiScreen.height / 4 + 10 + 4 * 24,
|
||||
200,
|
||||
20,
|
||||
I18n.translate("replaymod.gui.replayviewer"),
|
||||
"replaymod.gui.replayviewer",
|
||||
this::onButton
|
||||
);
|
||||
//#if FABRIC<=0
|
||||
@@ -283,7 +300,11 @@ public class GuiHandler extends EventRegistrations {
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
buttonText
|
||||
//#if MC>=11600
|
||||
//$$ new TranslatableText(buttonText)
|
||||
//#else
|
||||
I18n.translate(buttonText)
|
||||
//#endif
|
||||
//#if MC>=11400
|
||||
, self -> onClick.accept((InjectedButton) self)
|
||||
//#endif
|
||||
|
||||
@@ -3,13 +3,18 @@ package com.replaymod.replay.mixin;
|
||||
//#if MC>=10904
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
|
||||
//#if MC>=11600
|
||||
//$$ import net.minecraft.client.world.ClientWorld;
|
||||
//#else
|
||||
import net.minecraft.world.World;
|
||||
//#endif
|
||||
|
||||
import java.util.Queue;
|
||||
|
||||
@Mixin(ParticleManager.class)
|
||||
@@ -30,7 +35,13 @@ public abstract class MixinParticleManager {
|
||||
* @param ci Callback info
|
||||
*/
|
||||
@Inject(method = "setWorld", at = @At("HEAD"))
|
||||
public void replayModReplay_clearParticleQueue(World world, CallbackInfo ci) {
|
||||
public void replayModReplay_clearParticleQueue(
|
||||
//#if MC>=11600
|
||||
//$$ ClientWorld world,
|
||||
//#else
|
||||
World world,
|
||||
//#endif
|
||||
CallbackInfo ci) {
|
||||
//#if MC>=11400
|
||||
this.newParticles.clear();
|
||||
//#else
|
||||
|
||||
@@ -60,6 +60,10 @@ public abstract class MixinPlayerControllerMP {
|
||||
//#endif
|
||||
StatHandler statisticsManager,
|
||||
ClientRecipeBook recipeBookClient,
|
||||
//#if MC>=11600
|
||||
//$$ boolean lastIsHoldingSneakKey,
|
||||
//$$ boolean lastSprinting,
|
||||
//#endif
|
||||
CallbackInfoReturnable<ClientPlayerEntity> ci
|
||||
) {
|
||||
if (ReplayModReplay.instance.getReplayHandler() != null) {
|
||||
|
||||
Reference in New Issue
Block a user