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

@@ -252,6 +252,7 @@ dependencies {
11901: '1.19.1', 11901: '1.19.1',
11902: '1.19.2', 11902: '1.19.2',
11903: '1.19.3-rc3', 11903: '1.19.3-rc3',
11904: '1.19.4',
][mcVersion] ][mcVersion]
mappings 'net.fabricmc:yarn:' + [ mappings 'net.fabricmc:yarn:' + [
11404: '1.14.4+build.16', 11404: '1.14.4+build.16',
@@ -268,6 +269,7 @@ dependencies {
11901: '1.19.1+build.5:v2', 11901: '1.19.1+build.5:v2',
11902: '1.19.2+build.28:v2', 11902: '1.19.2+build.28:v2',
11903: '1.19.3-rc3+build.1:v2', 11903: '1.19.3-rc3+build.1:v2',
11904: '1.19.4+build.1:v2',
][mcVersion] ][mcVersion]
modImplementation 'net.fabricmc:fabric-loader:0.14.11' modImplementation 'net.fabricmc:fabric-loader:0.14.11'
def fabricApiVersion = [ def fabricApiVersion = [
@@ -285,6 +287,7 @@ dependencies {
11901: '0.58.5+1.19.1', 11901: '0.58.5+1.19.1',
11902: '0.68.0+1.19.2', 11902: '0.68.0+1.19.2',
11903: '0.68.1+1.19.3', 11903: '0.68.1+1.19.3',
11904: '0.76.0+1.19.4',
][mcVersion] ][mcVersion]
def fabricApiModules = [ def fabricApiModules = [
"api-base", "api-base",
@@ -357,7 +360,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:21ef505", shadeExclusions shadow "com.github.ReplayMod:ReplayStudio:b5cc75a", shadeExclusions
// FIXME this should be pulled in by ReplayStudio, and IntelliJ sees it, but javac for some reason does not // FIXME this should be pulled in by ReplayStudio, and IntelliJ sees it, but javac for some reason does not
implementation 'com.github.viaversion:opennbt:0a02214' // 2.0-SNAPSHOT (ViaVersion Edition) implementation 'com.github.viaversion:opennbt:0a02214' // 2.0-SNAPSHOT (ViaVersion Edition)
@@ -368,7 +371,9 @@ dependencies {
shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66' shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66'
if (FABRIC) { if (FABRIC) {
if (mcVersion >= 11903) { if (mcVersion >= 11904) {
modImplementation 'com.terraformersmc:modmenu:6.1.0-rc.4'
} else if (mcVersion >= 11903) {
modImplementation 'com.terraformersmc:modmenu:5.0.0-alpha.4' modImplementation 'com.terraformersmc:modmenu:5.0.0-alpha.4'
} else if (mcVersion >= 11901) { } else if (mcVersion >= 11901) {
modImplementation 'com.terraformersmc:modmenu:4.0.5' modImplementation 'com.terraformersmc:modmenu:4.0.5'

2
jGui

Submodule jGui updated: 7a80b50c2e...34d9d6bb15

View File

@@ -193,6 +193,7 @@ val doRelease by tasks.registering {
defaultTasks("bundleJar") defaultTasks("bundleJar")
preprocess { preprocess {
val mc11904 = createNode("1.19.4", 11904, "yarn")
val mc11903 = createNode("1.19.3", 11903, "yarn") val mc11903 = createNode("1.19.3", 11903, "yarn")
val mc11902 = createNode("1.19.2", 11902, "yarn") val mc11902 = createNode("1.19.2", 11902, "yarn")
val mc11901 = createNode("1.19.1", 11901, "yarn") val mc11901 = createNode("1.19.1", 11901, "yarn")
@@ -217,6 +218,7 @@ preprocess {
val mc10800 = createNode("1.8", 10800, "srg") val mc10800 = createNode("1.8", 10800, "srg")
val mc10710 = createNode("1.7.10", 10710, "srg") val mc10710 = createNode("1.7.10", 10710, "srg")
mc11904.link(mc11903)
mc11903.link(mc11902, file("versions/mapping-fabric-1.19.3-1.19.2.txt")) mc11903.link(mc11902, file("versions/mapping-fabric-1.19.3-1.19.2.txt"))
mc11902.link(mc11901) mc11902.link(mc11901)
mc11901.link(mc11900) mc11901.link(mc11900)

View File

@@ -37,6 +37,7 @@ val jGuiVersions = listOf(
"1.19.1", "1.19.1",
"1.19.2", "1.19.2",
"1.19.3", "1.19.3",
"1.19.4",
) )
val replayModVersions = listOf( val replayModVersions = listOf(
// "1.7.10", // "1.7.10",
@@ -62,6 +63,7 @@ val replayModVersions = listOf(
"1.19.1", "1.19.1",
"1.19.2", "1.19.2",
"1.19.3", "1.19.3",
"1.19.4",
) )
rootProject.buildFileName = "root.gradle.kts" rootProject.buildFileName = "root.gradle.kts"

View File

@@ -2,6 +2,7 @@ package com.replaymod.core;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.SharedConstants;
import static com.replaymod.core.ReplayMod.MOD_ID; import static com.replaymod.core.ReplayMod.MOD_ID;
@@ -20,7 +21,7 @@ public class ReplayModBackend implements ClientModInitializer {
} }
public String getMinecraftVersion() { public String getMinecraftVersion() {
return mod.getMinecraft().getGame().getVersion().getName(); return SharedConstants.getGameVersion().getName();
} }
public boolean isModLoaded(String id) { public boolean isModLoaded(String id) {

View File

@@ -6,7 +6,6 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.world.ClientWorld; import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvent;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@@ -21,87 +20,26 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//$$ import net.minecraft.util.registry.RegistryEntry; //$$ import net.minecraft.util.registry.RegistryEntry;
//#endif //#endif
//#if MC>=11600
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.MutableWorldProperties;
import java.util.function.Supplier;
//#else
//$$ import net.minecraft.world.level.LevelProperties;
//#endif
//#if MC>=11400
import net.minecraft.world.chunk.ChunkManager;
//#if MC<11600
//$$ import net.minecraft.world.dimension.Dimension;
//#endif
import net.minecraft.world.dimension.DimensionType;
import java.util.function.BiFunction;
//#else
//$$ import net.minecraft.world.storage.ISaveHandler;
//#if MC>=11400
//$$ import net.minecraft.world.dimension.Dimension;
//$$ import net.minecraft.world.storage.WorldSavedDataStorage;
//#else
//$$ import net.minecraft.world.WorldProvider;
//#endif
//#endif
@Mixin(ClientWorld.class) @Mixin(ClientWorld.class)
public abstract class MixinWorldClient extends World implements RecordingEventHandler.RecordingEventSender { public abstract class MixinWorldClient extends World implements RecordingEventHandler.RecordingEventSender {
@Shadow @Shadow
private MinecraftClient client; private MinecraftClient client;
//#if MC>=11600 @SuppressWarnings("ConstantConditions")
protected MixinWorldClient(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey, protected MixinWorldClient() {
//#if MC<11602 //#if MC>=11904
//$$ RegistryKey<DimensionType> registryKey2, //$$ super(null, null, null, null, null, false, false, 0, 0);
//#endif //#elseif MC>=11900
//#if MC>=11802 //$$ super(null, null, null, null, false, false, 0, 0);
//$$ RegistryEntry<DimensionType> dimensionType, //#elseif MC>=11602
//#else super(null, null, null, null, false, false, 0);
DimensionType dimensionType, //#elseif MC>=11600
//#endif //$$ super(null, null, null, null, null, false, false, 0);
Supplier<Profiler> profiler, boolean bl, boolean bl2, long l //#else
//#if MC>=11900 //$$ super(null, null, null, null, false);
//$$ , int maxChainedNeighborUpdates //#endif
//#endif
) {
super(mutableWorldProperties, registryKey,
//#if MC<11602
//$$ registryKey2,
//#endif
dimensionType, profiler, bl, bl2, l
//#if MC>=11900
//$$ , maxChainedNeighborUpdates
//#endif
);
} }
//#else
//#if MC>=11400
//$$ protected MixinWorldClient(LevelProperties levelProperties_1, DimensionType dimensionType_1, BiFunction<World, Dimension, ChunkManager> biFunction_1, Profiler profiler_1, boolean boolean_1) {
//$$ super(levelProperties_1, dimensionType_1, biFunction_1, profiler_1, boolean_1);
//$$ }
//#else
//$$ protected MixinWorldClient(ISaveHandler saveHandlerIn,
//#if MC>=11400
//$$ WorldSavedDataStorage mapStorage,
//#endif
//$$ WorldInfo info,
//#if MC>=11400
//$$ Dimension providerIn,
//#else
//$$ WorldProvider providerIn,
//#endif
//$$ Profiler profilerIn, boolean client) {
//$$ super(saveHandlerIn,
//#if MC>=11400
//$$ mapStorage,
//#endif
//$$ info, providerIn, profilerIn, client);
//$$ }
//#endif
//#endif
private RecordingEventHandler replayModRecording_getRecordingEventHandler() { private RecordingEventHandler replayModRecording_getRecordingEventHandler() {
return ((RecordingEventHandler.RecordingEventSender) this.client.worldRenderer).getRecordingEventHandler(); return ((RecordingEventHandler.RecordingEventSender) this.client.worldRenderer).getRecordingEventHandler();

View File

@@ -69,6 +69,11 @@ import static com.replaymod.core.versions.MCVer.*;
import static com.replaymod.replaystudio.util.Utils.writeInt; import static com.replaymod.replaystudio.util.Utils.writeInt;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
//#if MC>=11904
//$$ import net.minecraft.network.PacketBundleHandler;
//$$ import java.util.ArrayList;
//#endif
@ChannelHandler.Sharable // so we can re-order it @ChannelHandler.Sharable // so we can re-order it
public class PacketListener extends ChannelInboundHandlerAdapter { public class PacketListener extends ChannelInboundHandlerAdapter {
@@ -341,7 +346,25 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
} else if (msg instanceof net.minecraft.network.Packet) { } else if (msg instanceof net.minecraft.network.Packet) {
// for integrated server connections MC is passing the packet objects directly, so we need to encode them // for integrated server connections MC is passing the packet objects directly, so we need to encode them
// ourselves to be able to store them // ourselves to be able to store them
//#if MC>=11904
//$$ PacketBundleHandler bundleHandler = ctx.channel().attr(PacketBundleHandler.KEY).get().getBundler(NetworkSide.CLIENTBOUND);
//$$ List<Packet> packets = new ArrayList<>(1);
//$$ bundleHandler.forEachPacket((net.minecraft.network.packet.Packet<?>) msg, unbundledPacket -> {
//$$ try {
//$$ packets.add(encodeMcPacket(connectionState, unbundledPacket));
//$$ } catch (Exception e) {
//$$ throw new RuntimeException(e);
//$$ }
//$$ });
//$$ if (packets.size() > 1) {
//$$ packets.forEach(this::save);
//$$ super.channelRead(ctx, msg);
//$$ return;
//$$ }
//$$ packet = packets.isEmpty() ? null : packets.get(0);
//#else
packet = encodeMcPacket(connectionState, (net.minecraft.network.Packet) msg); packet = encodeMcPacket(connectionState, (net.minecraft.network.Packet) msg);
//#endif
} }
if (packet != null) { if (packet != null) {

View File

@@ -88,7 +88,9 @@ public abstract class OpenGlFrameCapturer<F extends Frame, D extends CaptureData
, false , false
//#endif //#endif
); );
//#if MC<11904
GlStateManager.enableTexture(); GlStateManager.enableTexture();
//#endif
worldRenderer.renderWorld(partialTicks, captureData); worldRenderer.renderWorld(partialTicks, captureData);

View File

@@ -477,7 +477,9 @@ public class VideoRenderer implements RenderInfo {
, false , false
//#endif //#endif
); );
//#if MC<11904
GlStateManager.enableTexture(); GlStateManager.enableTexture();
//#endif
guiWindow.beginWrite(); guiWindow.beginWrite();
//#if MC>=11500 //#if MC>=11500

View File

@@ -57,6 +57,10 @@ import net.minecraft.util.math.Vec3d;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
//#if MC>=11904
//$$ import net.minecraft.network.packet.s2c.play.PositionFlag;
//#endif
//#if MC>=11903 //#if MC>=11903
//$$ import net.minecraft.network.packet.s2c.play.ProfilelessChatMessageS2CPacket; //$$ import net.minecraft.network.packet.s2c.play.ProfilelessChatMessageS2CPacket;
//#endif //#endif
@@ -804,7 +808,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
if(replayHandler.shouldSuppressCameraMovements()) return null; if(replayHandler.shouldSuppressCameraMovements()) return null;
//#if MC>=10800 //#if MC>=10800
//#if MC>=11400 //#if MC>=11904
//$$ for (PositionFlag relative : ppl.getFlags()) {
//$$ if (relative == PositionFlag.X || relative == PositionFlag.Y || relative == PositionFlag.Z) {
//#elseif MC>=11400
for (PlayerPositionLookS2CPacket.Flag relative : ppl.getFlags()) { for (PlayerPositionLookS2CPacket.Flag relative : ppl.getFlags()) {
if (relative == PlayerPositionLookS2CPacket.Flag.X if (relative == PlayerPositionLookS2CPacket.Flag.X
|| relative == PlayerPositionLookS2CPacket.Flag.Y || relative == PlayerPositionLookS2CPacket.Flag.Y

View File

@@ -69,7 +69,9 @@ public class NoGuiScreenshot {
//#endif //#endif
); );
mc.getFramebuffer().beginWrite(true); mc.getFramebuffer().beginWrite(true);
//#if MC<11904
GlStateManager.enableTexture(); GlStateManager.enableTexture();
//#endif
float tickDelta = mc.getTickDelta(); float tickDelta = mc.getTickDelta();
//#if MC>=11500 //#if MC>=11500

View File

@@ -33,6 +33,7 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen; import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import net.minecraft.client.network.ClientLoginNetworkHandler; import net.minecraft.client.network.ClientLoginNetworkHandler;
import net.minecraft.client.util.Window; import net.minecraft.client.util.Window;
import net.minecraft.network.NetworkState;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@@ -41,6 +42,10 @@ import net.minecraft.network.ClientConnection;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
//#if MC>=11904
//$$ import net.minecraft.network.PacketBundler;
//#endif
//#if MC>=11700 //#if MC>=11700
//$$ import net.minecraft.client.render.DiffuseLighting; //$$ import net.minecraft.client.render.DiffuseLighting;
//$$ import net.minecraft.util.math.Matrix4f; //$$ import net.minecraft.util.math.Matrix4f;
@@ -317,9 +322,16 @@ public class ReplayHandler {
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);
//#if MC>=11904
//$$ channel.pipeline().addLast("bundler", new PacketBundler(NetworkSide.CLIENTBOUND));
//#endif
channel.pipeline().addLast("packet_handler", networkManager); channel.pipeline().addLast("packet_handler", networkManager);
channel.pipeline().fireChannelActive(); 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 //#if MC>=11400
((MinecraftAccessor) mc).setConnection(networkManager); ((MinecraftAccessor) mc).setConnection(networkManager);
//#endif //#endif
@@ -626,7 +638,9 @@ public class ReplayHandler {
, true , true
//#endif //#endif
); );
//#if MC<11904
GlStateManager.enableTexture(); GlStateManager.enableTexture();
//#endif
mc.getFramebuffer().beginWrite(true); mc.getFramebuffer().beginWrite(true);
Window window = mc.getWindow(); Window window = mc.getWindow();
//#if MC>=11500 //#if MC>=11500

0
versions/1.19.4/.gitkeep Normal file
View File