Update to 1.21

This commit is contained in:
Jonas Herzig
2024-06-23 19:39:11 +02:00
parent 1433fccaf1
commit a4e0abec7f
32 changed files with 228 additions and 32 deletions

View File

@@ -5,6 +5,7 @@ import com.replaymod.core.mixin.MinecraftAccessor;
import com.replaymod.core.mixin.TimerAccessor;
import com.replaymod.core.versions.MCVer;
import com.replaymod.pathing.player.AbstractTimelinePlayer;
import com.replaymod.pathing.player.ReplayTimer;
import com.replaymod.pathing.properties.TimestampProperty;
import com.replaymod.render.CameraPathExporter;
import com.replaymod.render.EXRWriter;
@@ -37,7 +38,6 @@ import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.crash.CrashException;
import net.minecraft.sound.SoundCategory;
import net.minecraft.client.render.RenderTickCounter;
import org.lwjgl.glfw.GLFW;
//#if MC>=12000
@@ -87,11 +87,12 @@ import static com.google.common.collect.Iterables.getLast;
import static com.replaymod.core.utils.Utils.DEFAULT_MS_PER_TICK;
import static com.replaymod.core.versions.MCVer.*;
import static com.replaymod.render.ReplayModRender.LOGGER;
import static de.johni0702.minecraft.gui.versions.MCVer.identifier;
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
public class VideoRenderer implements RenderInfo {
private static final Identifier SOUND_RENDER_SUCCESS = new Identifier("replaymod", "render_success");
private static final Identifier SOUND_RENDER_SUCCESS = identifier("replaymod", "render_success");
private final MinecraftClient mc = MCVer.getMinecraft();
private final RenderSettings settings;
private final ReplayHandler replayHandler;
@@ -191,7 +192,7 @@ public class VideoRenderer implements RenderInfo {
// Because this might take some time to prepare we'll render the GUI at least once to not confuse the user
drawGui();
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
ReplayTimer timer = (ReplayTimer) ((MinecraftAccessor) mc).getTimer();
// Play up to one second before starting to render
// This is necessary in order to ensure that all entities have at least two position packets
@@ -268,7 +269,7 @@ public class VideoRenderer implements RenderInfo {
}
// Updating the timer will cause the timeline player to update the game state
RenderTickCounter timer = ((MinecraftAccessor) mc).getTimer();
ReplayTimer timer = (ReplayTimer) ((MinecraftAccessor) mc).getTimer();
//#if MC>=11600
int elapsedTicks =
//#endif
@@ -276,6 +277,9 @@ public class VideoRenderer implements RenderInfo {
//#if MC>=11400
MCVer.milliTime()
//#endif
//#if MC>=12100
//$$ , true
//#endif
);
//#if MC<11600
//$$ int elapsedTicks = timer.ticksThisFrame;