Drop lombok, it has been causing too much confusion
Basically the result of the Delombok function, except we use IntelliJ's equals, hashCode and toString and don't re-organize imports (cause that breaks the preprocessor) and a bunch of manual cleanup was necessary (and half the classes weren't even converted).
This commit is contained in:
@@ -19,7 +19,6 @@ import com.replaymod.replaystudio.util.I18n;
|
||||
import com.replaymod.replaystudio.viaversion.ViaVersionPacketConverter;
|
||||
import com.replaymod.simplepathing.ReplayModSimplePathing;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.resource.DirectoryResourcePack;
|
||||
@@ -123,16 +122,17 @@ public class ReplayMod implements
|
||||
Module
|
||||
{
|
||||
|
||||
@Getter(lazy = true)
|
||||
//#if MC>=11400
|
||||
private static final String minecraftVersion = MinecraftClient.getInstance().getGame().getVersion().getName();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
//$$ private static final String minecraftVersion = MCPVersion.getMCVersion();
|
||||
//#else
|
||||
//$$ private static final String minecraftVersion = Loader.MC_VERSION;
|
||||
//#endif
|
||||
//#endif
|
||||
public static String getMinecraftVersion() {
|
||||
//#if MC>=11400
|
||||
return MinecraftClient.getInstance().getGame().getVersion().getName();
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
//$$ return MCPVersion.getMCVersion();
|
||||
//#else
|
||||
//$$ return Loader.MC_VERSION;
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
public static final String MOD_ID = "replaymod";
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
|
||||
import java.util.List;
|
||||
@@ -115,11 +114,15 @@ public class GuiReplaySettings extends AbstractGuiScreen<GuiReplaySettings> {
|
||||
return this;
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
private static class MultipleChoiceDropdownEntry {
|
||||
private final Object value;
|
||||
private final String text;
|
||||
|
||||
public MultipleChoiceDropdownEntry(Object value, String text) {
|
||||
this.value = value;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return text;
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.replaymod.render.capturer.RenderInfo;
|
||||
import com.replaymod.render.rendering.Pipelines;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
|
||||
@@ -22,7 +21,6 @@ import com.replaymod.render.hooks.ChunkLoadingRenderGlobal;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.getRenderPartialTicks;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class ScreenshotRenderer implements RenderInfo {
|
||||
|
||||
private final MinecraftClient mc = MCVer.getMinecraft();
|
||||
@@ -31,6 +29,10 @@ public class ScreenshotRenderer implements RenderInfo {
|
||||
|
||||
private int framesDone;
|
||||
|
||||
public ScreenshotRenderer(RenderSettings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public boolean renderScreenshot() throws Throwable {
|
||||
try {
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -22,7 +22,6 @@ import de.johni0702.minecraft.gui.popup.GuiFileChooserPopup;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import de.johni0702.minecraft.gui.versions.Image;
|
||||
import joptsimple.internal.Strings;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
@@ -46,7 +45,6 @@ import java.security.GeneralSecurityException;
|
||||
import static com.replaymod.extras.ReplayModExtras.LOGGER;
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class GuiYoutubeUpload extends GuiScreen {
|
||||
private final GuiScreen previousScreen;
|
||||
private final File videoFile;
|
||||
@@ -185,6 +183,13 @@ public class GuiYoutubeUpload extends GuiScreen {
|
||||
inputValidation.run();
|
||||
}
|
||||
|
||||
public GuiYoutubeUpload(GuiScreen previousScreen, File videoFile, int videoFrames, RenderSettings settings) {
|
||||
this.previousScreen = previousScreen;
|
||||
this.videoFile = videoFile;
|
||||
this.videoFrames = videoFrames;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
private void setState(boolean uploading) {
|
||||
forEach(GuiElement.class).setEnabled(!uploading);
|
||||
uploadButton.setEnabled();
|
||||
|
||||
@@ -26,8 +26,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.google.common.util.concurrent.SettableFuture;
|
||||
import com.replaymod.render.RenderSettings;
|
||||
import com.replaymod.render.metadata.MetadataInjector;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import org.apache.commons.exec.CommandLine;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -60,10 +59,8 @@ public class YoutubeUploader {
|
||||
@NonNull
|
||||
private Supplier<Double> progress = Suppliers.ofInstance(0d);
|
||||
|
||||
@Getter
|
||||
private State state;
|
||||
|
||||
@Getter
|
||||
private volatile boolean cancelled;
|
||||
|
||||
public YoutubeUploader(MinecraftClient minecraft, File videoFile, int videoFrames,
|
||||
@@ -252,6 +249,14 @@ public class YoutubeUploader {
|
||||
return progress.get();
|
||||
}
|
||||
|
||||
public State getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
public enum State {
|
||||
AUTH, PREPARE_VIDEO, UPLOAD, CLEANUP
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
||||
import com.replaymod.replaystudio.pathing.property.AbstractPropertyGroup;
|
||||
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
||||
import com.replaymod.replaystudio.pathing.property.PropertyParts;
|
||||
import lombok.NonNull;
|
||||
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.replaymod.replay.ReplaySender;
|
||||
import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
||||
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
||||
import com.replaymod.replaystudio.pathing.property.PropertyParts;
|
||||
import lombok.NonNull;
|
||||
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.replaymod.render;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
@@ -26,7 +23,6 @@ import org.apache.maven.artifact.versioning.ComparableVersion;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
@Data
|
||||
public class RenderSettings {
|
||||
public enum RenderMethod {
|
||||
DEFAULT, STEREOSCOPIC, CUBIC, EQUIRECTANGULAR, ODS, BLEND;
|
||||
@@ -119,13 +115,19 @@ public class RenderSettings {
|
||||
}
|
||||
}
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum AntiAliasing {
|
||||
NONE(1), X2(2), X4(4), X8(8);
|
||||
|
||||
@Getter
|
||||
private final int factor;
|
||||
|
||||
AntiAliasing(int factor) {
|
||||
this.factor = factor;
|
||||
}
|
||||
|
||||
public int getFactor() {
|
||||
return factor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return I18n.translate("replaymod.gui.rendersettings.antialiasing." + name().toLowerCase());
|
||||
@@ -162,6 +164,48 @@ public class RenderSettings {
|
||||
|
||||
private final boolean highPerformance;
|
||||
|
||||
public RenderSettings(
|
||||
RenderMethod renderMethod,
|
||||
EncodingPreset encodingPreset,
|
||||
int videoWidth,
|
||||
int videoHeight,
|
||||
int framesPerSecond,
|
||||
int bitRate,
|
||||
File outputFile,
|
||||
boolean renderNameTags,
|
||||
boolean stabilizeYaw,
|
||||
boolean stabilizePitch,
|
||||
boolean stabilizeRoll,
|
||||
ReadableColor chromaKeyingColor,
|
||||
int sphericalFovX,
|
||||
int sphericalFovY,
|
||||
boolean injectSphericalMetadata,
|
||||
AntiAliasing antiAliasing,
|
||||
String exportCommand,
|
||||
String exportArguments,
|
||||
boolean highPerformance
|
||||
) {
|
||||
this.renderMethod = renderMethod;
|
||||
this.encodingPreset = encodingPreset;
|
||||
this.videoWidth = videoWidth;
|
||||
this.videoHeight = videoHeight;
|
||||
this.framesPerSecond = framesPerSecond;
|
||||
this.bitRate = bitRate;
|
||||
this.outputFile = outputFile;
|
||||
this.renderNameTags = renderNameTags;
|
||||
this.stabilizeYaw = stabilizeYaw;
|
||||
this.stabilizePitch = stabilizePitch;
|
||||
this.stabilizeRoll = stabilizeRoll;
|
||||
this.chromaKeyingColor = chromaKeyingColor;
|
||||
this.sphericalFovX = sphericalFovX;
|
||||
this.sphericalFovY = sphericalFovY;
|
||||
this.injectSphericalMetadata = injectSphericalMetadata;
|
||||
this.antiAliasing = antiAliasing;
|
||||
this.exportCommand = exportCommand;
|
||||
this.exportArguments = exportArguments;
|
||||
this.highPerformance = highPerformance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
|
||||
*/
|
||||
@@ -253,4 +297,71 @@ public class RenderSettings {
|
||||
return "ffmpeg";
|
||||
}
|
||||
|
||||
public RenderMethod getRenderMethod() {
|
||||
return renderMethod;
|
||||
}
|
||||
|
||||
public EncodingPreset getEncodingPreset() {
|
||||
return encodingPreset;
|
||||
}
|
||||
|
||||
public int getFramesPerSecond() {
|
||||
return framesPerSecond;
|
||||
}
|
||||
|
||||
public int getBitRate() {
|
||||
return bitRate;
|
||||
}
|
||||
|
||||
public File getOutputFile() {
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
public boolean isRenderNameTags() {
|
||||
return renderNameTags;
|
||||
}
|
||||
|
||||
public boolean isStabilizeYaw() {
|
||||
return stabilizeYaw;
|
||||
}
|
||||
|
||||
public boolean isStabilizePitch() {
|
||||
return stabilizePitch;
|
||||
}
|
||||
|
||||
public boolean isStabilizeRoll() {
|
||||
return stabilizeRoll;
|
||||
}
|
||||
|
||||
public ReadableColor getChromaKeyingColor() {
|
||||
return chromaKeyingColor;
|
||||
}
|
||||
|
||||
public int getSphericalFovX() {
|
||||
return sphericalFovX;
|
||||
}
|
||||
|
||||
public int getSphericalFovY() {
|
||||
return sphericalFovY;
|
||||
}
|
||||
|
||||
public boolean isInjectSphericalMetadata() {
|
||||
return injectSphericalMetadata;
|
||||
}
|
||||
|
||||
public AntiAliasing getAntiAliasing() {
|
||||
return antiAliasing;
|
||||
}
|
||||
|
||||
public String getExportCommand() {
|
||||
return exportCommand;
|
||||
}
|
||||
|
||||
public String getExportArguments() {
|
||||
return exportArguments;
|
||||
}
|
||||
|
||||
public boolean isHighPerformance() {
|
||||
return highPerformance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.replaymod.render.frame;
|
||||
|
||||
import com.replaymod.render.rendering.Frame;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class CubicOpenGlFrame implements Frame {
|
||||
@Getter
|
||||
private final OpenGlFrame left, right, front, back, top, bottom;
|
||||
|
||||
public CubicOpenGlFrame(OpenGlFrame left, OpenGlFrame right, OpenGlFrame front, OpenGlFrame back, OpenGlFrame top, OpenGlFrame bottom) {
|
||||
@@ -31,4 +29,28 @@ public class CubicOpenGlFrame implements Frame {
|
||||
public int getFrameId() {
|
||||
return left.getFrameId();
|
||||
}
|
||||
|
||||
public OpenGlFrame getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
public OpenGlFrame getRight() {
|
||||
return this.right;
|
||||
}
|
||||
|
||||
public OpenGlFrame getFront() {
|
||||
return this.front;
|
||||
}
|
||||
|
||||
public OpenGlFrame getBack() {
|
||||
return this.back;
|
||||
}
|
||||
|
||||
public OpenGlFrame getTop() {
|
||||
return this.top;
|
||||
}
|
||||
|
||||
public OpenGlFrame getBottom() {
|
||||
return this.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.replaymod.render.frame;
|
||||
|
||||
import com.replaymod.render.rendering.Frame;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class ODSOpenGlFrame implements Frame {
|
||||
@Getter
|
||||
private final CubicOpenGlFrame left, right;
|
||||
|
||||
public ODSOpenGlFrame(CubicOpenGlFrame left, CubicOpenGlFrame right) {
|
||||
@@ -18,4 +16,12 @@ public class ODSOpenGlFrame implements Frame {
|
||||
public int getFrameId() {
|
||||
return left.getFrameId();
|
||||
}
|
||||
|
||||
public CubicOpenGlFrame getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
public CubicOpenGlFrame getRight() {
|
||||
return this.right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,31 @@ package com.replaymod.render.frame;
|
||||
|
||||
import com.replaymod.render.rendering.Frame;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class OpenGlFrame implements Frame {
|
||||
@Getter
|
||||
private final int frameId;
|
||||
|
||||
@Getter
|
||||
private final ReadableDimension size;
|
||||
|
||||
@Getter
|
||||
private final ByteBuffer byteBuffer;
|
||||
|
||||
public OpenGlFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) {
|
||||
this.frameId = frameId;
|
||||
this.size = size;
|
||||
this.byteBuffer = byteBuffer;
|
||||
}
|
||||
|
||||
public int getFrameId() {
|
||||
return this.frameId;
|
||||
}
|
||||
|
||||
public ReadableDimension getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public ByteBuffer getByteBuffer() {
|
||||
return this.byteBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,15 @@ package com.replaymod.render.frame;
|
||||
|
||||
import com.replaymod.render.rendering.Frame;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class RGBFrame implements Frame {
|
||||
@Getter
|
||||
private final int frameId;
|
||||
|
||||
@Getter
|
||||
private final ReadableDimension size;
|
||||
|
||||
@Getter
|
||||
private final ByteBuffer byteBuffer;
|
||||
|
||||
public RGBFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) {
|
||||
@@ -25,4 +21,16 @@ public class RGBFrame implements Frame {
|
||||
this.size = size;
|
||||
this.byteBuffer = byteBuffer;
|
||||
}
|
||||
|
||||
public int getFrameId() {
|
||||
return this.frameId;
|
||||
}
|
||||
|
||||
public ReadableDimension getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public ByteBuffer getByteBuffer() {
|
||||
return this.byteBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.replaymod.render.frame;
|
||||
|
||||
import com.replaymod.render.rendering.Frame;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
public class StereoscopicOpenGlFrame implements Frame {
|
||||
@Getter
|
||||
private final OpenGlFrame left, right;
|
||||
|
||||
public StereoscopicOpenGlFrame(OpenGlFrame left, OpenGlFrame right) {
|
||||
@@ -19,4 +17,12 @@ public class StereoscopicOpenGlFrame implements Frame {
|
||||
public int getFrameId() {
|
||||
return left.getFrameId();
|
||||
}
|
||||
|
||||
public OpenGlFrame getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
public OpenGlFrame getRight() {
|
||||
return this.right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,9 @@ import de.johni0702.minecraft.gui.element.GuiLabel;
|
||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class GuiRenderingDone extends GuiScreen {
|
||||
public final ReplayModRender mod;
|
||||
public final File videoFile;
|
||||
@@ -72,6 +70,13 @@ public class GuiRenderingDone extends GuiScreen {
|
||||
setBackground(Background.DIRT);
|
||||
}
|
||||
|
||||
public GuiRenderingDone(ReplayModRender mod, File videoFile, int videoFrames, RenderSettings settings) {
|
||||
this.mod = mod;
|
||||
this.videoFile = videoFile;
|
||||
this.videoFrames = videoFrames;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display() {
|
||||
if (mod.getCore().getSettingsRegistry().get(Setting.SKIP_POST_RENDER_GUI)) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.replaymod.render.capturer.CaptureData;
|
||||
import com.replaymod.render.capturer.RenderInfo;
|
||||
import com.replaymod.render.capturer.WorldRenderer;
|
||||
import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
//#if MC>=11500
|
||||
@@ -30,10 +29,8 @@ import java.io.IOException;
|
||||
public class EntityRendererHandler extends EventRegistrations implements WorldRenderer {
|
||||
public final MinecraftClient mc = MCVer.getMinecraft();
|
||||
|
||||
@Getter
|
||||
protected final RenderSettings settings;
|
||||
|
||||
@Getter
|
||||
private final RenderInfo renderInfo;
|
||||
|
||||
public CaptureData data;
|
||||
@@ -99,6 +96,14 @@ public class EntityRendererHandler extends EventRegistrations implements WorldRe
|
||||
this.omnidirectional = omnidirectional;
|
||||
}
|
||||
|
||||
public RenderSettings getSettings() {
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
public RenderInfo getRenderInfo() {
|
||||
return this.renderInfo;
|
||||
}
|
||||
|
||||
public interface IEntityRenderer {
|
||||
void replayModRender_setHandler(EntityRendererHandler handler);
|
||||
EntityRendererHandler replayModRender_getHandler();
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.replaymod.render.frame.CubicOpenGlFrame;
|
||||
import com.replaymod.render.frame.RGBFrame;
|
||||
import com.replaymod.render.utils.ByteBufferPool;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -19,7 +18,6 @@ public class EquirectangularToRGBProcessor extends AbstractFrameProcessor<CubicO
|
||||
private static final byte IMAGE_TOP = 4;
|
||||
private static final byte IMAGE_BOTTOM = 5;
|
||||
|
||||
@Getter
|
||||
private final int frameSize;
|
||||
private final int width;
|
||||
private final int height;
|
||||
@@ -138,4 +136,8 @@ public class EquirectangularToRGBProcessor extends AbstractFrameProcessor<CubicO
|
||||
ByteBufferPool.release(rawFrame.getBottom().getByteBuffer());
|
||||
return new RGBFrame(rawFrame.getFrameId(), new Dimension(width, height), result);
|
||||
}
|
||||
|
||||
public int getFrameSize() {
|
||||
return frameSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.replaymod.render.rendering;
|
||||
|
||||
import com.replaymod.core.mixin.MinecraftAccessor;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
@@ -95,10 +94,13 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
|
||||
abort = true;
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
private class ProcessTask implements Runnable {
|
||||
private final R rawFrame;
|
||||
|
||||
public ProcessTask(R rawFrame) {
|
||||
this.rawFrame = rawFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
@@ -23,11 +23,7 @@ import com.replaymod.render.processor.ODSToRGBProcessor;
|
||||
import com.replaymod.render.processor.OpenGlToRGBProcessor;
|
||||
import com.replaymod.render.processor.StereoscopicToRGBProcessor;
|
||||
import com.replaymod.render.utils.PixelBufferObject;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@UtilityClass
|
||||
public class Pipelines {
|
||||
public static Pipeline newPipeline(RenderSettings.RenderMethod method, RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
|
||||
switch (method) {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.replaymod.render.utils;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
//#if MC>=11400
|
||||
@@ -25,13 +24,17 @@ import static org.lwjgl.opengl.ARBVertexBufferObject.*;
|
||||
//#endif
|
||||
|
||||
public class PixelBufferObject {
|
||||
@RequiredArgsConstructor
|
||||
public enum Usage {
|
||||
COPY(GL_STREAM_COPY_ARB, GL_STREAM_COPY),
|
||||
DRAW(GL_STREAM_DRAW_ARB, GL_STREAM_DRAW),
|
||||
READ(GL_STREAM_READ_ARB, GL_STREAM_READ);
|
||||
|
||||
private final int arb, gl15;
|
||||
|
||||
Usage(int arb, int gl15) {
|
||||
this.arb = arb;
|
||||
this.gl15 = gl15;
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
|
||||
@@ -2,11 +2,62 @@ package com.replaymod.render.utils;
|
||||
|
||||
import com.replaymod.render.RenderSettings;
|
||||
import com.replaymod.replaystudio.pathing.path.Timeline;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
import java.util.Objects;
|
||||
|
||||
public class RenderJob {
|
||||
private String name;
|
||||
private Timeline timeline;
|
||||
private RenderSettings settings;
|
||||
|
||||
public RenderJob() {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public Timeline getTimeline() {
|
||||
return this.timeline;
|
||||
}
|
||||
|
||||
public RenderSettings getSettings() {
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setTimeline(Timeline timeline) {
|
||||
this.timeline = timeline;
|
||||
}
|
||||
|
||||
public void setSettings(RenderSettings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
RenderJob renderJob = (RenderJob) o;
|
||||
return name.equals(renderJob.name) &&
|
||||
timeline.equals(renderJob.timeline) &&
|
||||
settings.equals(renderJob.settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, timeline, settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RenderJob{" +
|
||||
"name='" + name + '\'' +
|
||||
", timeline=" + timeline +
|
||||
", settings=" + settings +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,6 @@ import com.google.common.util.concurrent.SettableFuture;
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import de.johni0702.minecraft.gui.versions.Image;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.util.ScreenshotUtils;
|
||||
@@ -26,13 +23,29 @@ import static com.replaymod.core.versions.MCVer.getWindow;
|
||||
//$$ import java.io.File;
|
||||
//#endif
|
||||
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
@Getter
|
||||
public class NoGuiScreenshot {
|
||||
private final Image image;
|
||||
private final int width;
|
||||
private final int height;
|
||||
|
||||
private NoGuiScreenshot(Image image, int width, int height) {
|
||||
this.image = image;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public Image getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public static ListenableFuture<NoGuiScreenshot> take(final MinecraftClient mc, final int width, final int height) {
|
||||
final SettableFuture<NoGuiScreenshot> future = SettableFuture.create();
|
||||
Runnable runnable = new Runnable() {
|
||||
|
||||
@@ -10,8 +10,6 @@ import com.replaymod.replay.ReplayModReplay;
|
||||
import com.replaymod.replay.Setting;
|
||||
import com.replaymod.replay.mixin.FirstPersonRendererAccessor;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
@@ -105,8 +103,6 @@ public class CameraEntity
|
||||
*/
|
||||
public float roll;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private CameraController cameraController;
|
||||
|
||||
private long lastControllerUpdate = System.currentTimeMillis();
|
||||
@@ -166,6 +162,14 @@ public class CameraEntity
|
||||
}
|
||||
}
|
||||
|
||||
public CameraController getCameraController() {
|
||||
return cameraController;
|
||||
}
|
||||
|
||||
public void setCameraController(CameraController cameraController) {
|
||||
this.cameraController = cameraController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the camera by the specified delta.
|
||||
* @param x Delta in X direction
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.replaymod.replay.camera;
|
||||
|
||||
import com.replaymod.replay.ReplayModReplay;
|
||||
import com.replaymod.replay.mixin.EntityPlayerAccessor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.options.KeyBinding;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -21,10 +20,13 @@ import java.util.Arrays;
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class SpectatorCameraController implements CameraController {
|
||||
private final CameraEntity camera;
|
||||
|
||||
public SpectatorCameraController(CameraEntity camera) {
|
||||
this.camera = camera;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(float partialTicksPassed) {
|
||||
MinecraftClient mc = getMinecraft();
|
||||
|
||||
@@ -2,15 +2,19 @@
|
||||
//$$ package com.replaymod.replay.events;
|
||||
//$$
|
||||
//$$ import com.replaymod.replay.camera.CameraEntity;
|
||||
//$$ import lombok.Getter;
|
||||
//$$ import lombok.RequiredArgsConstructor;
|
||||
//$$ import net.minecraftforge.eventbus.api.Cancelable;
|
||||
//$$ import net.minecraftforge.eventbus.api.Event;
|
||||
//$$
|
||||
//$$ @Cancelable
|
||||
//$$ @RequiredArgsConstructor
|
||||
//$$ public class ReplayChatMessageEvent extends Event {
|
||||
//$$ @Getter
|
||||
//$$ private final CameraEntity cameraEntity;
|
||||
//$$
|
||||
//$$ public ReplayChatMessageEvent(CameraEntity cameraEntity) {
|
||||
//$$ this.cameraEntity = cameraEntity;
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ public CameraEntity getCameraEntity() {
|
||||
//$$ return cameraEntity;
|
||||
//$$ }
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
@@ -35,7 +35,6 @@ import de.johni0702.minecraft.gui.utils.Consumer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.gui.screen.NoticeScreen;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
@@ -252,16 +251,12 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
return popup;
|
||||
}
|
||||
|
||||
@Getter
|
||||
private final SettableFuture<File> future = SettableFuture.create();
|
||||
|
||||
@Getter
|
||||
private final GuiReplayList list = new GuiReplayList(popup);
|
||||
|
||||
@Getter
|
||||
private final GuiButton acceptButton = new GuiButton(popup).setI18nLabel("gui.done").setSize(50, 20).setDisabled();
|
||||
|
||||
@Getter
|
||||
private final GuiButton cancelButton = new GuiButton(popup).setI18nLabel("gui.cancel").setSize(50, 20);
|
||||
|
||||
|
||||
@@ -301,6 +296,22 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
});
|
||||
}
|
||||
|
||||
public SettableFuture<File> getFuture() {
|
||||
return future;
|
||||
}
|
||||
|
||||
public GuiReplayList getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public GuiButton getAcceptButton() {
|
||||
return acceptButton;
|
||||
}
|
||||
|
||||
public GuiButton getCancelButton() {
|
||||
return cancelButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiSelectReplayPopup getThis() {
|
||||
return this;
|
||||
|
||||
@@ -4,26 +4,31 @@ import com.replaymod.replaystudio.pathing.interpolation.CatmullRomSplineInterpol
|
||||
import com.replaymod.replaystudio.pathing.interpolation.CubicSplineInterpolator;
|
||||
import com.replaymod.replaystudio.pathing.interpolation.Interpolator;
|
||||
import com.replaymod.replaystudio.pathing.interpolation.LinearInterpolator;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum InterpolatorType {
|
||||
DEFAULT("default", null, null),
|
||||
CATMULL_ROM("catmullrom", CatmullRomSplineInterpolator.class, () -> new CatmullRomSplineInterpolator(0.5)),
|
||||
CUBIC("cubic", CubicSplineInterpolator.class, CubicSplineInterpolator::new),
|
||||
LINEAR("linear", LinearInterpolator.class, LinearInterpolator::new);
|
||||
|
||||
@Getter
|
||||
private String localizationKey;
|
||||
|
||||
@Getter
|
||||
private Class<? extends Interpolator> interpolatorClass;
|
||||
|
||||
private Supplier<Interpolator> interpolatorConstructor;
|
||||
|
||||
InterpolatorType(String localizationKey, Class<? extends Interpolator> interpolatorClass, Supplier<Interpolator> interpolatorConstructor) {
|
||||
this.localizationKey = localizationKey;
|
||||
this.interpolatorClass = interpolatorClass;
|
||||
this.interpolatorConstructor = interpolatorConstructor;
|
||||
}
|
||||
|
||||
public String getLocalizationKey() {
|
||||
return localizationKey;
|
||||
}
|
||||
|
||||
public String getI18nName() {
|
||||
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.name", localizationKey);
|
||||
}
|
||||
@@ -32,6 +37,10 @@ public enum InterpolatorType {
|
||||
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.desc", localizationKey);
|
||||
}
|
||||
|
||||
public Class<? extends Interpolator> getInterpolatorClass() {
|
||||
return interpolatorClass;
|
||||
}
|
||||
|
||||
public static InterpolatorType fromString(String string) {
|
||||
for (InterpolatorType t : values()) {
|
||||
if (t.getI18nName().equals(string)) return t;
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.simplepathing.SPTimeline.SPPath;
|
||||
import com.replaymod.simplepathing.gui.GuiPathing;
|
||||
import com.replaymod.simplepathing.preview.PathPreview;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -149,7 +148,6 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
||||
private SPTimeline currentTimeline;
|
||||
|
||||
private SPPath selectedPath;
|
||||
@Getter
|
||||
private long selectedTime;
|
||||
|
||||
public SPPath getSelectedPath() {
|
||||
@@ -160,6 +158,10 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
|
||||
return selectedPath;
|
||||
}
|
||||
|
||||
public long getSelectedTime() {
|
||||
return selectedTime;
|
||||
}
|
||||
|
||||
public boolean isSelected(Keyframe keyframe) {
|
||||
return getSelectedPath() != null && currentTimeline.getKeyframe(selectedPath, selectedTime) == keyframe;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.replaymod.replaystudio.pathing.property.Property;
|
||||
import com.replaymod.replaystudio.util.EntityPositionTracker;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
@@ -63,14 +62,10 @@ public class SPTimeline implements PathingRegistry {
|
||||
POSITION,
|
||||
}
|
||||
|
||||
@Getter
|
||||
private final Timeline timeline;
|
||||
@Getter
|
||||
private final Path timePath;
|
||||
@Getter
|
||||
private final Path positionPath;
|
||||
|
||||
@Getter
|
||||
private EntityPositionTracker entityTracker;
|
||||
private InterpolatorType defaultInterpolatorType;
|
||||
|
||||
@@ -84,6 +79,22 @@ public class SPTimeline implements PathingRegistry {
|
||||
this.positionPath = timeline.getPaths().get(SPPath.POSITION.ordinal());
|
||||
}
|
||||
|
||||
public Timeline getTimeline() {
|
||||
return timeline;
|
||||
}
|
||||
|
||||
public Path getTimePath() {
|
||||
return timePath;
|
||||
}
|
||||
|
||||
public Path getPositionPath() {
|
||||
return positionPath;
|
||||
}
|
||||
|
||||
public EntityPositionTracker getEntityTracker() {
|
||||
return entityTracker;
|
||||
}
|
||||
|
||||
public Path getPath(SPPath path) {
|
||||
switch (path) {
|
||||
case TIME:
|
||||
|
||||
@@ -34,7 +34,6 @@ import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -283,7 +282,6 @@ public abstract class GuiEditKeyframe<T extends GuiEditKeyframe<T>> extends Abst
|
||||
|
||||
public class InterpolationPanel extends AbstractGuiContainer<InterpolationPanel> {
|
||||
|
||||
@Getter
|
||||
private SettingsPanel settingsPanel;
|
||||
|
||||
private GuiDropdownMenu<InterpolatorType> dropdown;
|
||||
@@ -330,6 +328,10 @@ public abstract class GuiEditKeyframe<T extends GuiEditKeyframe<T>> extends Abst
|
||||
}
|
||||
}
|
||||
|
||||
public SettingsPanel getSettingsPanel() {
|
||||
return settingsPanel;
|
||||
}
|
||||
|
||||
public void setSettingsPanel(InterpolatorType type) {
|
||||
removeElement(this.settingsPanel);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.replaymod.replaystudio.pathing.property.AbstractProperty;
|
||||
import com.replaymod.replaystudio.pathing.property.PropertyPart;
|
||||
import lombok.NonNull;
|
||||
import de.johni0702.minecraft.gui.utils.NonNull;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
Reference in New Issue
Block a user