Release 2.4.5

This commit is contained in:
Jonas Herzig
2020-09-27 18:24:31 +02:00
22 changed files with 145 additions and 54 deletions

View File

@@ -178,7 +178,7 @@ val doRelease by tasks.registering {
defaultTasks("shadowJar")
preprocess {
"1.16.2"(11602, "yarn") {
"1.16.3"(11603, "yarn") {
"1.16.1"(11601, "yarn") {
"1.15.2"(11502, "yarn") {
"1.14.4"(11404, "yarn", file("versions/mapping-fabric-1.15.2-1.14.4.txt")) {

2
jGui

Submodule jGui updated: e9387ad003...6602aac42a

View File

@@ -29,7 +29,7 @@ val jGuiVersions = listOf(
"1.14.4",
"1.15.2",
"1.16.1",
"1.16.2"
"1.16.3"
)
val replayModVersions = listOf(
"1.7.10",
@@ -46,7 +46,7 @@ val replayModVersions = listOf(
"1.14.4",
"1.15.2",
"1.16.1",
"1.16.2"
"1.16.3"
)
include(":jGui")

View File

@@ -66,6 +66,7 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.UUID;
import java.util.function.Consumer;
@@ -350,6 +351,10 @@ public class Utils {
super(container);
setBackgroundColor(Colors.DARK_TRANSPARENT);
ProtocolVersion latestVersion = ProtocolVersion.getProtocols()
.stream()
.max(Comparator.comparing(ProtocolVersion::getId))
.orElseThrow(RuntimeException::new);
getInfo().addElements(new VerticalLayout.Data(0.5),
new GuiLabel()
.setColor(Colors.BLACK)
@@ -357,10 +362,7 @@ public class Utils {
new GuiLabel()
.setColor(Colors.BLACK)
.setI18nText("replaymod.gui.minimalmode.supportedversion",
ProtocolVersion.v1_7_6.getName()
+ " - "
+ Iterables.getLast(ProtocolVersion.getProtocols()).getName()
));
"1.7.10 - " + latestVersion.getName()));
open();
}

View File

@@ -120,6 +120,9 @@ public class MarkerProcessor {
squashFilter.init(studio, null);
Path inputPath = path.resolveSibling("raw").resolve(path.getFileName());
for (int i = 1; Files.exists(inputPath); i++) {
inputPath = inputPath.resolveSibling(replayName + "." + i + ".mcpr");
}
Files.createDirectories(inputPath.getParent());
Files.move(path, inputPath);

View File

@@ -85,6 +85,7 @@ public class GuiCreateScreenshot extends GuiRenderSettings implements Loadable {
protected File generateOutputFile(RenderSettings.EncodingPreset encodingPreset) {
DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
File screenshotFolder = new File(getMinecraft().runDirectory, "screenshots");
screenshotFolder.mkdirs();
String baseName = DATE_FORMAT.format(new Date());
for (int i = 1; ; i++) {
File screenshotFile = new File(screenshotFolder, baseName + (i == 1 ? "" : "_" + i) + ".png");
@@ -94,6 +95,11 @@ public class GuiCreateScreenshot extends GuiRenderSettings implements Loadable {
}
}
@Override
public void load(RenderSettings settings) {
super.load(settings.withEncodingPreset(RenderSettings.EncodingPreset.PNG));
}
@Override
protected Path getSettingsPath() {
return getMinecraft().runDirectory.toPath().resolve("config/replaymod-screenshotsettings.json");

View File

@@ -206,6 +206,30 @@ public class RenderSettings {
this.highPerformance = highPerformance;
}
public RenderSettings withEncodingPreset(EncodingPreset encodingPreset) {
return new RenderSettings(
renderMethod,
encodingPreset,
videoWidth,
videoHeight,
framesPerSecond,
bitRate,
outputFile,
renderNameTags,
stabilizeYaw,
stabilizePitch,
stabilizeRoll,
chromaKeyingColor,
sphericalFovX,
sphericalFovY,
injectSphericalMetadata,
antiAliasing,
exportCommand,
exportArguments,
highPerformance
);
}
/**
* @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
*/

View File

@@ -141,6 +141,5 @@ public abstract class OpenGlFrameCapturer<F extends Frame, D extends CaptureData
@Override
public void close() throws IOException {
worldRenderer.close();
}
}

View File

@@ -38,7 +38,7 @@ import net.minecraft.client.render.WorldRenderer;
//#endif
//#if MC>=10904
import net.minecraft.world.RayTraceContext;
import net.minecraft.world.RaycastContext;
//#else
//$$ import net.minecraft.util.MovingObjectPosition;
//#endif

View File

@@ -2,6 +2,7 @@ package com.replaymod.render.rendering;
import com.replaymod.core.mixin.MinecraftAccessor;
import com.replaymod.core.versions.MCVer;
import com.replaymod.render.capturer.WorldRenderer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashException;
@@ -23,6 +24,7 @@ import static com.replaymod.core.versions.MCVer.getWindow;
public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
private final WorldRenderer worldRenderer;
private final FrameCapturer<R> capturer;
private final FrameProcessor<R, P> processor;
private int consumerNextFrame;
@@ -31,7 +33,8 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
private volatile boolean abort;
public Pipeline(FrameCapturer<R> capturer, FrameProcessor<R, P> processor, FrameConsumer<P> consumer) {
public Pipeline(WorldRenderer worldRenderer, FrameCapturer<R> capturer, FrameProcessor<R, P> processor, FrameConsumer<P> consumer) {
this.worldRenderer = worldRenderer;
this.capturer = capturer;
this.processor = processor;
this.consumer = consumer;
@@ -81,6 +84,7 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
}
try {
worldRenderer.close();
capturer.close();
processor.close();
consumer.close();

View File

@@ -10,6 +10,7 @@ import com.replaymod.render.capturer.SimpleOpenGlFrameCapturer;
import com.replaymod.render.capturer.SimplePboOpenGlFrameCapturer;
import com.replaymod.render.capturer.StereoscopicOpenGlFrameCapturer;
import com.replaymod.render.capturer.StereoscopicPboOpenGlFrameCapturer;
import com.replaymod.render.capturer.WorldRenderer;
import com.replaymod.render.frame.CubicOpenGlFrame;
import com.replaymod.render.frame.ODSOpenGlFrame;
import com.replaymod.render.frame.OpenGlFrame;
@@ -45,66 +46,72 @@ public class Pipelines {
public static Pipeline<OpenGlFrame, RGBFrame> newDefaultPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
RenderSettings settings = renderInfo.getRenderSettings();
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
FrameCapturer<OpenGlFrame> capturer;
if (PixelBufferObject.SUPPORTED) {
capturer = new SimplePboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
capturer = new SimplePboOpenGlFrameCapturer(worldRenderer, renderInfo);
} else {
capturer = new SimpleOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
capturer = new SimpleOpenGlFrameCapturer(worldRenderer, renderInfo);
}
return new Pipeline<>(capturer, new OpenGlToRGBProcessor(), consumer);
return new Pipeline<>(worldRenderer, capturer, new OpenGlToRGBProcessor(), consumer);
}
public static Pipeline<StereoscopicOpenGlFrame, RGBFrame> newStereoscopicPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
RenderSettings settings = renderInfo.getRenderSettings();
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
FrameCapturer<StereoscopicOpenGlFrame> capturer;
if (PixelBufferObject.SUPPORTED) {
capturer = new StereoscopicPboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
capturer = new StereoscopicPboOpenGlFrameCapturer(worldRenderer, renderInfo);
} else {
capturer = new StereoscopicOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
capturer = new StereoscopicOpenGlFrameCapturer(worldRenderer, renderInfo);
}
return new Pipeline<>(capturer, new StereoscopicToRGBProcessor(), consumer);
return new Pipeline<>(worldRenderer, capturer, new StereoscopicToRGBProcessor(), consumer);
}
public static Pipeline<CubicOpenGlFrame, RGBFrame> newCubicPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
RenderSettings settings = renderInfo.getRenderSettings();
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
FrameCapturer<CubicOpenGlFrame> capturer;
if (PixelBufferObject.SUPPORTED) {
capturer = new CubicPboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, settings.getVideoWidth() / 4);
capturer = new CubicPboOpenGlFrameCapturer(worldRenderer, renderInfo, settings.getVideoWidth() / 4);
} else {
capturer = new CubicOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, settings.getVideoWidth() / 4);
capturer = new CubicOpenGlFrameCapturer(worldRenderer, renderInfo, settings.getVideoWidth() / 4);
}
return new Pipeline<>(capturer, new CubicToRGBProcessor(), consumer);
return new Pipeline<>(worldRenderer, capturer, new CubicToRGBProcessor(), consumer);
}
public static Pipeline<CubicOpenGlFrame, RGBFrame> newEquirectangularPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
RenderSettings settings = renderInfo.getRenderSettings();
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
EquirectangularToRGBProcessor processor = new EquirectangularToRGBProcessor(settings.getVideoWidth(),
settings.getVideoHeight(), settings.getSphericalFovX());
FrameCapturer<CubicOpenGlFrame> capturer;
if (PixelBufferObject.SUPPORTED) {
capturer = new CubicPboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, processor.getFrameSize());
capturer = new CubicPboOpenGlFrameCapturer(worldRenderer, renderInfo, processor.getFrameSize());
} else {
capturer = new CubicOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, processor.getFrameSize());
capturer = new CubicOpenGlFrameCapturer(worldRenderer, renderInfo, processor.getFrameSize());
}
return new Pipeline<>(capturer, processor, consumer);
return new Pipeline<>(worldRenderer, capturer, processor, consumer);
}
public static Pipeline<ODSOpenGlFrame, RGBFrame> newODSPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
RenderSettings settings = renderInfo.getRenderSettings();
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
ODSToRGBProcessor processor = new ODSToRGBProcessor(settings.getVideoWidth(),
settings.getVideoHeight(), settings.getSphericalFovX());
FrameCapturer<ODSOpenGlFrame> capturer =
new ODSFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, processor.getFrameSize());
return new Pipeline<>(capturer, processor, consumer);
new ODSFrameCapturer(worldRenderer, renderInfo, processor.getFrameSize());
return new Pipeline<>(worldRenderer, capturer, processor, consumer);
}
public static Pipeline<RGBFrame, RGBFrame> newBlendPipeline(RenderInfo renderInfo) {
RenderSettings settings = renderInfo.getRenderSettings();
FrameCapturer<RGBFrame> capturer = new BlendFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
FrameCapturer<RGBFrame> capturer = new BlendFrameCapturer(worldRenderer, renderInfo);
FrameConsumer<RGBFrame> consumer = new FrameConsumer<RGBFrame>() {
@Override
public void consume(RGBFrame frame) {
@@ -114,6 +121,6 @@ public class Pipelines {
public void close() {
}
};
return new Pipeline<>(capturer, new DummyProcessor<>(), consumer);
return new Pipeline<>(worldRenderer, capturer, new DummyProcessor<>(), consumer);
}
}

View File

@@ -624,13 +624,15 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//#endif
false,
//#if MC>=11600
packet.method_29443(),
//#if MC>=11602
//#if MC>=11603
packet.getDimensionIds(),
(net.minecraft.util.registry.DynamicRegistryManager.Impl) packet.getRegistryManager(),
packet.getDimensionType(),
//#else
//$$ packet.method_29443(),
//$$ (net.minecraft.util.registry.RegistryTracker.Modifiable) packet.getDimension(),
//$$ packet.method_29444(),
//#endif
packet.method_29444(),
packet.getDimensionId(),
//#else
//$$ packet.getDimension(),
@@ -639,7 +641,7 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//#if MC<11600
//$$ packet.getGeneratorType(),
//#endif
packet.getChunkLoadDistance(),
packet.getViewDistance(),
packet.hasReducedDebugInfo()
//#if MC>=11500
, packet.showsDeathScreen()
@@ -727,10 +729,12 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
final PlayerPositionLookS2CPacket ppl = (PlayerPositionLookS2CPacket) p;
if(!hasWorldLoaded) hasWorldLoaded = true;
if (mc.currentScreen instanceof DownloadingTerrainScreen) {
// Close the world loading screen manually in case we swallow the packet
mc.openScreen(null);
}
ReplayMod.instance.runLater(() -> {
if (mc.currentScreen instanceof DownloadingTerrainScreen) {
// Close the world loading screen manually in case we swallow the packet
mc.openScreen(null);
}
});
if(replayHandler.shouldSuppressCameraMovements()) return null;

View File

@@ -519,10 +519,6 @@ public class ReplayHandler {
return spectating;
}
public void setTargetPosition(Location pos) {
targetCameraPosition = pos;
}
public void moveCameraToTargetPosition() {
CameraEntity cam = getCameraEntity();
if (cam != null && targetCameraPosition != null) {
@@ -592,7 +588,7 @@ public class ReplayHandler {
}
}
long diff = targetTime - replaySender.getDesiredTimestamp();
long diff = targetTime - (replaySender.isHurrying() ? replaySender.getDesiredTimestamp() : replaySender.currentTimeStamp());
if (diff != 0) {
if (diff > 0 && diff < 5000) { // Small difference and no time travel
replaySender.jumpToTime(targetTime);

View File

@@ -74,11 +74,13 @@ import net.minecraft.util.Hand;
//#if MC>=10800
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.entity.PlayerModelPart;
//#else
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
//$$ import net.minecraft.util.Session;
//#endif
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.UUID;
import java.util.function.Function;
@@ -98,6 +100,8 @@ public class CameraEntity
//$$ extends EntityClientPlayerMP
//#endif
{
private static final UUID CAMERA_UUID = UUID.nameUUIDFromBytes("ReplayModCamera".getBytes(StandardCharsets.UTF_8));
/**
* Roll of this camera in degrees.
*/
@@ -154,6 +158,11 @@ public class CameraEntity
, false
//#endif
);
//#if MC>=10900
setUuid(CAMERA_UUID);
//#else
//$$ entityUniqueID = CAMERA_UUID;
//#endif
eventHandler.register();
if (ReplayModReplay.instance.getReplayHandler().getSpectatedUUID() == null) {
cameraController = ReplayModReplay.instance.createCameraController(this);
@@ -423,6 +432,15 @@ public class CameraEntity
}
return super.getModel();
}
@Override
public boolean isPartVisible(PlayerModelPart modelPart) {
Entity view = getRenderViewEntity(this.client);
if (view != this && view instanceof PlayerEntity) {
return ((PlayerEntity) view).isPartVisible(modelPart);
}
return super.isPartVisible(modelPart);
}
//#endif
@Override
@@ -481,8 +499,8 @@ public class CameraEntity
//#if MC>=11400
@Override
public HitResult rayTrace(double maxDistance, float tickDelta, boolean fluids) {
HitResult result = super.rayTrace(maxDistance, tickDelta, fluids);
public HitResult raycast(double maxDistance, float tickDelta, boolean fluids) {
HitResult result = super.raycast(maxDistance, tickDelta, fluids);
// Make sure we can never look at blocks (-> no outline)
if (result instanceof BlockHitResult) {

View File

@@ -4,6 +4,7 @@ import com.replaymod.core.ReplayMod;
import com.replaymod.core.versions.MCVer.Keyboard;
import com.replaymod.replay.ReplayHandler;
import com.replaymod.replay.ReplayModReplay;
import com.replaymod.replay.camera.CameraEntity;
import com.replaymod.replaystudio.data.Marker;
import com.replaymod.replaystudio.util.Location;
import de.johni0702.minecraft.gui.GuiRenderer;
@@ -168,11 +169,14 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
} else if (button == 1) { // Right click
selectedMarker = null;
if (replayHandler != null) {
replayHandler.setTargetPosition(new Location(
marker.getX(), marker.getY(), marker.getZ(),
marker.getPitch(), marker.getYaw()
));
replayHandler.doJump(marker.getTime(), false);
CameraEntity cameraEntity = replayHandler.getCameraEntity();
if (cameraEntity != null) {
cameraEntity.setCameraPosRot(new Location(
marker.getX(), marker.getY(), marker.getZ(),
marker.getYaw(), marker.getPitch()
));
}
replayHandler.doJump(marker.getTime(), true);
} else {
setCursorPosition(marker.getTime());
}

View File

@@ -0,0 +1,20 @@
//#if MC>=11600
package com.replaymod.replay.mixin;
import net.minecraft.client.gui.screen.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
@Mixin(TitleScreen.class)
public abstract class Mixin_MoveRealmsButton {
@ModifyArg(
method = "init",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;init(Lnet/minecraft/client/MinecraftClient;II)V"),
index = 2
)
private int adjustRealmsButton(int height) {
return height - (24 - 10) * 4;
}
}
//#endif

View File

@@ -5,6 +5,9 @@
"mixins": [],
"server": [],
"client": [
//#if MC>=11600
"Mixin_MoveRealmsButton",
//#endif
//#if MC>=11400
"MixinCamera",
"MixinInGameHud",

View File

@@ -1 +1 @@
2.4.4
2.4.5

View File

@@ -1,3 +1,4 @@
net.minecraft.entity.player.EntityPlayer isWearing() func_175148_a()
net.minecraft.client.renderer.WorldRenderer begin() startDrawing()
net.minecraft.network.play.server.S38PacketPlayerListItem getAction() func_179768_b()
net.minecraft.network.play.server.S40PacketDisconnect getReason() func_149165_c()

View File

@@ -225,25 +225,25 @@ dependencies {
11404: '1.14.4',
11502: '1.15.2',
11601: '1.16.1',
11602: '1.16.2',
11603: '1.16.3',
][mcVersion]
mappings 'net.fabricmc:yarn:' + [
11404: '1.14.4+build.16',
11502: '1.15.2+build.14',
11601: '1.16.1+build.17:v2',
11602: '1.16.2+build.1:v2',
11603: '1.16.3+build.1:v2',
][mcVersion]
modCompile 'net.fabricmc:fabric-loader:' + [
11404: '0.7.8+build.189',
11502: '0.7.8+build.189',
11601: '0.8.8+build.202',
11602: '0.9.1+build.205',
11603: '0.9.1+build.205',
][mcVersion]
def fabricApiVersion = [
11404: '0.4.3+build.247-1.14',
11502: '0.5.1+build.294-1.15',
11601: '0.14.0+build.371-1.16',
11602: '0.17.1+build.394-1.16',
11603: '0.17.1+build.394-1.16',
][mcVersion]
def fabricApiModules = [
"api-base",
@@ -295,7 +295,7 @@ dependencies {
shadow 'com.github.ReplayMod.JavaBlend:2.79.0:a0696f8'
shadow "com.github.ReplayMod:ReplayStudio:bc8baba", shadeExclusions
shadow "com.github.ReplayMod:ReplayStudio:b29955e", shadeExclusions
implementation(jGui){
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those

View File

@@ -1 +1 @@
1.16.2
1.16.3