Merge branch 'stable' into develop
This commit is contained in:
@@ -20,7 +20,7 @@ After installing Forge, simply put the downloaded `ReplayMod.jar` file in the `/
|
|||||||
To render your creations with **Replay Mod** you will need to have FFmpeg installed.
|
To render your creations with **Replay Mod** you will need to have FFmpeg installed.
|
||||||
|
|
||||||
### Windows [windows]
|
### Windows [windows]
|
||||||
Download the **latest** FFmpeg build from <http://ffmpeg.zeranoe.com/builds/>.
|
Download the **latest** FFmpeg build from <https://www.gyan.dev/ffmpeg/builds/> (the essentials version is sufficient).
|
||||||
|
|
||||||
Extract the downloaded .zip file into your `.minecraft` folder.
|
Extract the downloaded .zip file into your `.minecraft` folder.
|
||||||
|
|
||||||
|
|||||||
2
jGui
2
jGui
Submodule jGui updated: 9c7bf29f77...5e515a2ecc
@@ -66,6 +66,7 @@ import java.security.cert.CertificateException;
|
|||||||
import java.security.cert.CertificateFactory;
|
import java.security.cert.CertificateFactory;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@@ -350,6 +351,10 @@ public class Utils {
|
|||||||
super(container);
|
super(container);
|
||||||
setBackgroundColor(Colors.DARK_TRANSPARENT);
|
setBackgroundColor(Colors.DARK_TRANSPARENT);
|
||||||
|
|
||||||
|
ProtocolVersion latestVersion = ProtocolVersion.getProtocols()
|
||||||
|
.stream()
|
||||||
|
.max(Comparator.comparing(ProtocolVersion::getId))
|
||||||
|
.orElseThrow(RuntimeException::new);
|
||||||
getInfo().addElements(new VerticalLayout.Data(0.5),
|
getInfo().addElements(new VerticalLayout.Data(0.5),
|
||||||
new GuiLabel()
|
new GuiLabel()
|
||||||
.setColor(Colors.BLACK)
|
.setColor(Colors.BLACK)
|
||||||
@@ -357,10 +362,7 @@ public class Utils {
|
|||||||
new GuiLabel()
|
new GuiLabel()
|
||||||
.setColor(Colors.BLACK)
|
.setColor(Colors.BLACK)
|
||||||
.setI18nText("replaymod.gui.minimalmode.supportedversion",
|
.setI18nText("replaymod.gui.minimalmode.supportedversion",
|
||||||
ProtocolVersion.v1_7_6.getName()
|
"1.7.10 - " + latestVersion.getName()));
|
||||||
+ " - "
|
|
||||||
+ Iterables.getLast(ProtocolVersion.getProtocols()).getName()
|
|
||||||
));
|
|
||||||
|
|
||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ public class MarkerProcessor {
|
|||||||
List<Pair<Path, ReplayMetaData>> outputPaths = new ArrayList<>();
|
List<Pair<Path, ReplayMetaData>> outputPaths = new ArrayList<>();
|
||||||
|
|
||||||
Path inputPath = path.resolveSibling("raw").resolve(path.getFileName());
|
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.createDirectories(inputPath.getParent());
|
||||||
Files.move(path, inputPath);
|
Files.move(path, inputPath);
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public class GuiCreateScreenshot extends GuiRenderSettings implements Loadable {
|
|||||||
protected File generateOutputFile(RenderSettings.EncodingPreset encodingPreset) {
|
protected File generateOutputFile(RenderSettings.EncodingPreset encodingPreset) {
|
||||||
DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
|
DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
|
||||||
File screenshotFolder = new File(getMinecraft().runDirectory, "screenshots");
|
File screenshotFolder = new File(getMinecraft().runDirectory, "screenshots");
|
||||||
|
screenshotFolder.mkdirs();
|
||||||
String baseName = DATE_FORMAT.format(new Date());
|
String baseName = DATE_FORMAT.format(new Date());
|
||||||
for (int i = 1; ; i++) {
|
for (int i = 1; ; i++) {
|
||||||
File screenshotFile = new File(screenshotFolder, baseName + (i == 1 ? "" : "_" + i) + ".png");
|
File screenshotFile = new File(screenshotFolder, baseName + (i == 1 ? "" : "_" + i) + ".png");
|
||||||
@@ -106,6 +107,11 @@ public class GuiCreateScreenshot extends GuiRenderSettings implements Loadable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(RenderSettings settings) {
|
||||||
|
super.load(settings.withEncodingPreset(RenderSettings.EncodingPreset.PNG));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Path getSettingsPath() {
|
protected Path getSettingsPath() {
|
||||||
return getMinecraft().runDirectory.toPath().resolve("config/replaymod-screenshotsettings.json");
|
return getMinecraft().runDirectory.toPath().resolve("config/replaymod-screenshotsettings.json");
|
||||||
|
|||||||
@@ -212,6 +212,30 @@ public class RenderSettings {
|
|||||||
this.highPerformance = highPerformance;
|
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.
|
* @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -141,6 +141,5 @@ public abstract class OpenGlFrameCapturer<F extends Frame, D extends CaptureData
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
worldRenderer.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.replaymod.render.rendering;
|
|||||||
|
|
||||||
import com.replaymod.core.mixin.MinecraftAccessor;
|
import com.replaymod.core.mixin.MinecraftAccessor;
|
||||||
import com.replaymod.core.versions.MCVer;
|
import com.replaymod.core.versions.MCVer;
|
||||||
|
import com.replaymod.render.capturer.WorldRenderer;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
import net.minecraft.util.crash.CrashException;
|
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 {
|
public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
||||||
|
|
||||||
|
private final WorldRenderer worldRenderer;
|
||||||
private final FrameCapturer<R> capturer;
|
private final FrameCapturer<R> capturer;
|
||||||
private final FrameProcessor<R, P> processor;
|
private final FrameProcessor<R, P> processor;
|
||||||
private int consumerNextFrame;
|
private int consumerNextFrame;
|
||||||
@@ -31,7 +33,8 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
|||||||
|
|
||||||
private volatile boolean abort;
|
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.capturer = capturer;
|
||||||
this.processor = processor;
|
this.processor = processor;
|
||||||
this.consumer = consumer;
|
this.consumer = consumer;
|
||||||
@@ -81,6 +84,7 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
worldRenderer.close();
|
||||||
capturer.close();
|
capturer.close();
|
||||||
processor.close();
|
processor.close();
|
||||||
consumer.close();
|
consumer.close();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.replaymod.render.capturer.SimpleOpenGlFrameCapturer;
|
|||||||
import com.replaymod.render.capturer.SimplePboOpenGlFrameCapturer;
|
import com.replaymod.render.capturer.SimplePboOpenGlFrameCapturer;
|
||||||
import com.replaymod.render.capturer.StereoscopicOpenGlFrameCapturer;
|
import com.replaymod.render.capturer.StereoscopicOpenGlFrameCapturer;
|
||||||
import com.replaymod.render.capturer.StereoscopicPboOpenGlFrameCapturer;
|
import com.replaymod.render.capturer.StereoscopicPboOpenGlFrameCapturer;
|
||||||
|
import com.replaymod.render.capturer.WorldRenderer;
|
||||||
import com.replaymod.render.frame.CubicOpenGlFrame;
|
import com.replaymod.render.frame.CubicOpenGlFrame;
|
||||||
import com.replaymod.render.frame.ODSOpenGlFrame;
|
import com.replaymod.render.frame.ODSOpenGlFrame;
|
||||||
import com.replaymod.render.frame.OpenGlFrame;
|
import com.replaymod.render.frame.OpenGlFrame;
|
||||||
@@ -45,66 +46,72 @@ public class Pipelines {
|
|||||||
|
|
||||||
public static Pipeline<OpenGlFrame, RGBFrame> newDefaultPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
public static Pipeline<OpenGlFrame, RGBFrame> newDefaultPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||||
RenderSettings settings = renderInfo.getRenderSettings();
|
RenderSettings settings = renderInfo.getRenderSettings();
|
||||||
|
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
|
||||||
FrameCapturer<OpenGlFrame> capturer;
|
FrameCapturer<OpenGlFrame> capturer;
|
||||||
if (PixelBufferObject.SUPPORTED) {
|
if (PixelBufferObject.SUPPORTED) {
|
||||||
capturer = new SimplePboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
|
capturer = new SimplePboOpenGlFrameCapturer(worldRenderer, renderInfo);
|
||||||
} else {
|
} 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) {
|
public static Pipeline<StereoscopicOpenGlFrame, RGBFrame> newStereoscopicPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||||
RenderSettings settings = renderInfo.getRenderSettings();
|
RenderSettings settings = renderInfo.getRenderSettings();
|
||||||
|
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
|
||||||
FrameCapturer<StereoscopicOpenGlFrame> capturer;
|
FrameCapturer<StereoscopicOpenGlFrame> capturer;
|
||||||
if (PixelBufferObject.SUPPORTED) {
|
if (PixelBufferObject.SUPPORTED) {
|
||||||
capturer = new StereoscopicPboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo);
|
capturer = new StereoscopicPboOpenGlFrameCapturer(worldRenderer, renderInfo);
|
||||||
} else {
|
} 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) {
|
public static Pipeline<CubicOpenGlFrame, RGBFrame> newCubicPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||||
RenderSettings settings = renderInfo.getRenderSettings();
|
RenderSettings settings = renderInfo.getRenderSettings();
|
||||||
|
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
|
||||||
FrameCapturer<CubicOpenGlFrame> capturer;
|
FrameCapturer<CubicOpenGlFrame> capturer;
|
||||||
if (PixelBufferObject.SUPPORTED) {
|
if (PixelBufferObject.SUPPORTED) {
|
||||||
capturer = new CubicPboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, settings.getVideoWidth() / 4);
|
capturer = new CubicPboOpenGlFrameCapturer(worldRenderer, renderInfo, settings.getVideoWidth() / 4);
|
||||||
} else {
|
} 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) {
|
public static Pipeline<CubicOpenGlFrame, RGBFrame> newEquirectangularPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||||
RenderSettings settings = renderInfo.getRenderSettings();
|
RenderSettings settings = renderInfo.getRenderSettings();
|
||||||
|
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
|
||||||
|
|
||||||
EquirectangularToRGBProcessor processor = new EquirectangularToRGBProcessor(settings.getVideoWidth(),
|
EquirectangularToRGBProcessor processor = new EquirectangularToRGBProcessor(settings.getVideoWidth(),
|
||||||
settings.getVideoHeight(), settings.getSphericalFovX());
|
settings.getVideoHeight(), settings.getSphericalFovX());
|
||||||
|
|
||||||
FrameCapturer<CubicOpenGlFrame> capturer;
|
FrameCapturer<CubicOpenGlFrame> capturer;
|
||||||
if (PixelBufferObject.SUPPORTED) {
|
if (PixelBufferObject.SUPPORTED) {
|
||||||
capturer = new CubicPboOpenGlFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, processor.getFrameSize());
|
capturer = new CubicPboOpenGlFrameCapturer(worldRenderer, renderInfo, processor.getFrameSize());
|
||||||
} else {
|
} 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) {
|
public static Pipeline<ODSOpenGlFrame, RGBFrame> newODSPipeline(RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||||
RenderSettings settings = renderInfo.getRenderSettings();
|
RenderSettings settings = renderInfo.getRenderSettings();
|
||||||
|
WorldRenderer worldRenderer = new EntityRendererHandler(settings, renderInfo);
|
||||||
|
|
||||||
ODSToRGBProcessor processor = new ODSToRGBProcessor(settings.getVideoWidth(),
|
ODSToRGBProcessor processor = new ODSToRGBProcessor(settings.getVideoWidth(),
|
||||||
settings.getVideoHeight(), settings.getSphericalFovX());
|
settings.getVideoHeight(), settings.getSphericalFovX());
|
||||||
|
|
||||||
FrameCapturer<ODSOpenGlFrame> capturer =
|
FrameCapturer<ODSOpenGlFrame> capturer =
|
||||||
new ODSFrameCapturer(new EntityRendererHandler(settings, renderInfo), renderInfo, processor.getFrameSize());
|
new ODSFrameCapturer(worldRenderer, renderInfo, processor.getFrameSize());
|
||||||
return new Pipeline<>(capturer, processor, consumer);
|
return new Pipeline<>(worldRenderer, capturer, processor, consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Pipeline<RGBFrame, RGBFrame> newBlendPipeline(RenderInfo renderInfo) {
|
public static Pipeline<RGBFrame, RGBFrame> newBlendPipeline(RenderInfo renderInfo) {
|
||||||
RenderSettings settings = renderInfo.getRenderSettings();
|
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>() {
|
FrameConsumer<RGBFrame> consumer = new FrameConsumer<RGBFrame>() {
|
||||||
@Override
|
@Override
|
||||||
public void consume(RGBFrame frame) {
|
public void consume(RGBFrame frame) {
|
||||||
@@ -114,6 +121,6 @@ public class Pipelines {
|
|||||||
public void close() {
|
public void close() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return new Pipeline<>(capturer, new DummyProcessor<>(), consumer);
|
return new Pipeline<>(worldRenderer, capturer, new DummyProcessor<>(), consumer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -729,10 +729,12 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
final PlayerPositionLookS2CPacket ppl = (PlayerPositionLookS2CPacket) p;
|
final PlayerPositionLookS2CPacket ppl = (PlayerPositionLookS2CPacket) p;
|
||||||
if(!hasWorldLoaded) hasWorldLoaded = true;
|
if(!hasWorldLoaded) hasWorldLoaded = true;
|
||||||
|
|
||||||
|
ReplayMod.instance.runLater(() -> {
|
||||||
if (mc.currentScreen instanceof DownloadingTerrainScreen) {
|
if (mc.currentScreen instanceof DownloadingTerrainScreen) {
|
||||||
// Close the world loading screen manually in case we swallow the packet
|
// Close the world loading screen manually in case we swallow the packet
|
||||||
mc.openScreen(null);
|
mc.openScreen(null);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if(replayHandler.shouldSuppressCameraMovements()) return null;
|
if(replayHandler.shouldSuppressCameraMovements()) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -519,10 +519,6 @@ public class ReplayHandler {
|
|||||||
return spectating;
|
return spectating;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTargetPosition(Location pos) {
|
|
||||||
targetCameraPosition = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void moveCameraToTargetPosition() {
|
public void moveCameraToTargetPosition() {
|
||||||
CameraEntity cam = getCameraEntity();
|
CameraEntity cam = getCameraEntity();
|
||||||
if (cam != null && targetCameraPosition != null) {
|
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) {
|
||||||
if (diff > 0 && diff < 5000) { // Small difference and no time travel
|
if (diff > 0 && diff < 5000) { // Small difference and no time travel
|
||||||
replaySender.jumpToTime(targetTime);
|
replaySender.jumpToTime(targetTime);
|
||||||
|
|||||||
@@ -74,11 +74,13 @@ import net.minecraft.util.Hand;
|
|||||||
|
|
||||||
//#if MC>=10800
|
//#if MC>=10800
|
||||||
import net.minecraft.client.network.ClientPlayerEntity;
|
import net.minecraft.client.network.ClientPlayerEntity;
|
||||||
|
import net.minecraft.client.render.entity.PlayerModelPart;
|
||||||
//#else
|
//#else
|
||||||
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
|
//$$ import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||||
//$$ import net.minecraft.util.Session;
|
//$$ import net.minecraft.util.Session;
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -98,6 +100,8 @@ public class CameraEntity
|
|||||||
//$$ extends EntityClientPlayerMP
|
//$$ extends EntityClientPlayerMP
|
||||||
//#endif
|
//#endif
|
||||||
{
|
{
|
||||||
|
private static final UUID CAMERA_UUID = UUID.nameUUIDFromBytes("ReplayModCamera".getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Roll of this camera in degrees.
|
* Roll of this camera in degrees.
|
||||||
*/
|
*/
|
||||||
@@ -154,6 +158,11 @@ public class CameraEntity
|
|||||||
, false
|
, false
|
||||||
//#endif
|
//#endif
|
||||||
);
|
);
|
||||||
|
//#if MC>=10900
|
||||||
|
setUuid(CAMERA_UUID);
|
||||||
|
//#else
|
||||||
|
//$$ entityUniqueID = CAMERA_UUID;
|
||||||
|
//#endif
|
||||||
eventHandler.register();
|
eventHandler.register();
|
||||||
if (ReplayModReplay.instance.getReplayHandler().getSpectatedUUID() == null) {
|
if (ReplayModReplay.instance.getReplayHandler().getSpectatedUUID() == null) {
|
||||||
cameraController = ReplayModReplay.instance.createCameraController(this);
|
cameraController = ReplayModReplay.instance.createCameraController(this);
|
||||||
@@ -423,6 +432,15 @@ public class CameraEntity
|
|||||||
}
|
}
|
||||||
return super.getModel();
|
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
|
//#endif
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.replaymod.core.ReplayMod;
|
|||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
|
import com.replaymod.replay.camera.CameraEntity;
|
||||||
import com.replaymod.replaystudio.data.Marker;
|
import com.replaymod.replaystudio.data.Marker;
|
||||||
import com.replaymod.replaystudio.util.Location;
|
import com.replaymod.replaystudio.util.Location;
|
||||||
import de.johni0702.minecraft.gui.GuiRenderer;
|
import de.johni0702.minecraft.gui.GuiRenderer;
|
||||||
@@ -168,11 +169,14 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
|
|||||||
} else if (button == 1) { // Right click
|
} else if (button == 1) { // Right click
|
||||||
selectedMarker = null;
|
selectedMarker = null;
|
||||||
if (replayHandler != null) {
|
if (replayHandler != null) {
|
||||||
replayHandler.setTargetPosition(new Location(
|
CameraEntity cameraEntity = replayHandler.getCameraEntity();
|
||||||
|
if (cameraEntity != null) {
|
||||||
|
cameraEntity.setCameraPosRot(new Location(
|
||||||
marker.getX(), marker.getY(), marker.getZ(),
|
marker.getX(), marker.getY(), marker.getZ(),
|
||||||
marker.getPitch(), marker.getYaw()
|
marker.getYaw(), marker.getPitch()
|
||||||
));
|
));
|
||||||
replayHandler.doJump(marker.getTime(), false);
|
}
|
||||||
|
replayHandler.doJump(marker.getTime(), true);
|
||||||
} else {
|
} else {
|
||||||
setCursorPosition(marker.getTime());
|
setCursorPosition(marker.getTime());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 * 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
@@ -5,6 +5,9 @@
|
|||||||
"mixins": [],
|
"mixins": [],
|
||||||
"server": [],
|
"server": [],
|
||||||
"client": [
|
"client": [
|
||||||
|
//#if MC>=11600
|
||||||
|
"Mixin_MoveRealmsButton",
|
||||||
|
//#endif
|
||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
"MixinCamera",
|
"MixinCamera",
|
||||||
"MixinInGameHud",
|
"MixinInGameHud",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.4.4
|
2.4.5
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
net.minecraft.entity.player.EntityPlayer isWearing() func_175148_a()
|
||||||
net.minecraft.client.renderer.WorldRenderer begin() startDrawing()
|
net.minecraft.client.renderer.WorldRenderer begin() startDrawing()
|
||||||
net.minecraft.network.play.server.S38PacketPlayerListItem getAction() func_179768_b()
|
net.minecraft.network.play.server.S38PacketPlayerListItem getAction() func_179768_b()
|
||||||
net.minecraft.network.play.server.S40PacketDisconnect getReason() func_149165_c()
|
net.minecraft.network.play.server.S40PacketDisconnect getReason() func_149165_c()
|
||||||
|
|||||||
@@ -295,7 +295,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:2773270", shadeExclusions
|
shadow "com.github.ReplayMod:ReplayStudio:b29955e", shadeExclusions
|
||||||
|
|
||||||
implementation(jGui){
|
implementation(jGui){
|
||||||
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those
|
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those
|
||||||
|
|||||||
Reference in New Issue
Block a user