Port to MC 1.19.4

This commit is contained in:
Jonas Herzig
2023-03-26 18:58:49 +02:00
parent ae5f893014
commit 78bd060249
13 changed files with 78 additions and 80 deletions

View File

@@ -33,6 +33,7 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import net.minecraft.client.network.ClientLoginNetworkHandler;
import net.minecraft.client.util.Window;
import net.minecraft.network.NetworkState;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
@@ -41,6 +42,10 @@ import net.minecraft.network.ClientConnection;
import java.io.IOException;
import java.util.*;
//#if MC>=11904
//$$ import net.minecraft.network.PacketBundler;
//#endif
//#if MC>=11700
//$$ import net.minecraft.client.render.DiffuseLighting;
//$$ import net.minecraft.util.math.Matrix4f;
@@ -317,9 +322,16 @@ public class ReplayHandler {
channel.pipeline().addLast("ReplayModReplay_quickReplaySender", quickReplaySender);
//#endif
channel.pipeline().addLast("ReplayModReplay_replaySender", fullReplaySender);
//#if MC>=11904
//$$ channel.pipeline().addLast("bundler", new PacketBundler(NetworkSide.CLIENTBOUND));
//#endif
channel.pipeline().addLast("packet_handler", networkManager);
channel.pipeline().fireChannelActive();
// MC usually transitions from handshake to login via the packets it sends.
// We don't send any packets (there is no server to receive them), so we need to switch manually.
networkManager.setState(NetworkState.LOGIN);
//#if MC>=11400
((MinecraftAccessor) mc).setConnection(networkManager);
//#endif
@@ -626,7 +638,9 @@ public class ReplayHandler {
, true
//#endif
);
//#if MC<11904
GlStateManager.enableTexture();
//#endif
mc.getFramebuffer().beginWrite(true);
Window window = mc.getWindow();
//#if MC>=11500