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:
Jonas Herzig
2020-08-28 13:18:23 +02:00
parent 23e51d7099
commit 16c759f1dd
32 changed files with 400 additions and 103 deletions

2
jGui

Submodule jGui updated: bf00dcf2ce...8c026e191b

View File

@@ -19,7 +19,6 @@ import com.replaymod.replaystudio.util.I18n;
import com.replaymod.replaystudio.viaversion.ViaVersionPacketConverter; import com.replaymod.replaystudio.viaversion.ViaVersionPacketConverter;
import com.replaymod.simplepathing.ReplayModSimplePathing; import com.replaymod.simplepathing.ReplayModSimplePathing;
import de.johni0702.minecraft.gui.container.GuiScreen; import de.johni0702.minecraft.gui.container.GuiScreen;
import lombok.Getter;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.resource.DirectoryResourcePack; import net.minecraft.resource.DirectoryResourcePack;
@@ -123,16 +122,17 @@ public class ReplayMod implements
Module Module
{ {
@Getter(lazy = true) public static String getMinecraftVersion() {
//#if MC>=11400 //#if MC>=11400
private static final String minecraftVersion = MinecraftClient.getInstance().getGame().getVersion().getName(); return MinecraftClient.getInstance().getGame().getVersion().getName();
//#else //#else
//#if MC>=11400 //#if MC>=11400
//$$ private static final String minecraftVersion = MCPVersion.getMCVersion(); //$$ return MCPVersion.getMCVersion();
//#else //#else
//$$ private static final String minecraftVersion = Loader.MC_VERSION; //$$ return Loader.MC_VERSION;
//#endif //#endif
//#endif //#endif
}
public static final String MOD_ID = "replaymod"; public static final String MOD_ID = "replaymod";

View File

@@ -14,7 +14,6 @@ import de.johni0702.minecraft.gui.layout.VerticalLayout;
import de.johni0702.minecraft.gui.utils.Consumer; import de.johni0702.minecraft.gui.utils.Consumer;
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension; import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.resource.language.I18n; import net.minecraft.client.resource.language.I18n;
import java.util.List; import java.util.List;
@@ -115,11 +114,15 @@ public class GuiReplaySettings extends AbstractGuiScreen<GuiReplaySettings> {
return this; return this;
} }
@RequiredArgsConstructor
private static class MultipleChoiceDropdownEntry { private static class MultipleChoiceDropdownEntry {
private final Object value; private final Object value;
private final String text; private final String text;
public MultipleChoiceDropdownEntry(Object value, String text) {
this.value = value;
this.text = text;
}
@Override @Override
public String toString() { public String toString() {
return text; return text;

View File

@@ -7,7 +7,6 @@ import com.replaymod.render.capturer.RenderInfo;
import com.replaymod.render.rendering.Pipelines; import com.replaymod.render.rendering.Pipelines;
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension; import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
@@ -22,7 +21,6 @@ import com.replaymod.render.hooks.ChunkLoadingRenderGlobal;
import static com.replaymod.core.versions.MCVer.getRenderPartialTicks; import static com.replaymod.core.versions.MCVer.getRenderPartialTicks;
@RequiredArgsConstructor
public class ScreenshotRenderer implements RenderInfo { public class ScreenshotRenderer implements RenderInfo {
private final MinecraftClient mc = MCVer.getMinecraft(); private final MinecraftClient mc = MCVer.getMinecraft();
@@ -31,6 +29,10 @@ public class ScreenshotRenderer implements RenderInfo {
private int framesDone; private int framesDone;
public ScreenshotRenderer(RenderSettings settings) {
this.settings = settings;
}
public boolean renderScreenshot() throws Throwable { public boolean renderScreenshot() throws Throwable {
try { try {
//#if MC>=11400 //#if MC>=11400

View File

@@ -22,7 +22,6 @@ import de.johni0702.minecraft.gui.popup.GuiFileChooserPopup;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import de.johni0702.minecraft.gui.versions.Image; import de.johni0702.minecraft.gui.versions.Image;
import joptsimple.internal.Strings; import joptsimple.internal.Strings;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.resource.language.I18n; import net.minecraft.client.resource.language.I18n;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
@@ -46,7 +45,6 @@ import java.security.GeneralSecurityException;
import static com.replaymod.extras.ReplayModExtras.LOGGER; import static com.replaymod.extras.ReplayModExtras.LOGGER;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
@RequiredArgsConstructor
public class GuiYoutubeUpload extends GuiScreen { public class GuiYoutubeUpload extends GuiScreen {
private final GuiScreen previousScreen; private final GuiScreen previousScreen;
private final File videoFile; private final File videoFile;
@@ -185,6 +183,13 @@ public class GuiYoutubeUpload extends GuiScreen {
inputValidation.run(); 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) { private void setState(boolean uploading) {
forEach(GuiElement.class).setEnabled(!uploading); forEach(GuiElement.class).setEnabled(!uploading);
uploadButton.setEnabled(); uploadButton.setEnabled();

View File

@@ -26,8 +26,7 @@ import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture; import com.google.common.util.concurrent.SettableFuture;
import com.replaymod.render.RenderSettings; import com.replaymod.render.RenderSettings;
import com.replaymod.render.metadata.MetadataInjector; import com.replaymod.render.metadata.MetadataInjector;
import lombok.Getter; import de.johni0702.minecraft.gui.utils.NonNull;
import lombok.NonNull;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
@@ -60,10 +59,8 @@ public class YoutubeUploader {
@NonNull @NonNull
private Supplier<Double> progress = Suppliers.ofInstance(0d); private Supplier<Double> progress = Suppliers.ofInstance(0d);
@Getter
private State state; private State state;
@Getter
private volatile boolean cancelled; private volatile boolean cancelled;
public YoutubeUploader(MinecraftClient minecraft, File videoFile, int videoFrames, public YoutubeUploader(MinecraftClient minecraft, File videoFile, int videoFrames,
@@ -252,6 +249,14 @@ public class YoutubeUploader {
return progress.get(); return progress.get();
} }
public State getState() {
return this.state;
}
public boolean isCancelled() {
return this.cancelled;
}
public enum State { public enum State {
AUTH, PREPARE_VIDEO, UPLOAD, CLEANUP AUTH, PREPARE_VIDEO, UPLOAD, CLEANUP
} }

View File

@@ -9,7 +9,7 @@ import com.replaymod.replaystudio.pathing.property.AbstractProperty;
import com.replaymod.replaystudio.pathing.property.AbstractPropertyGroup; import com.replaymod.replaystudio.pathing.property.AbstractPropertyGroup;
import com.replaymod.replaystudio.pathing.property.PropertyPart; import com.replaymod.replaystudio.pathing.property.PropertyPart;
import com.replaymod.replaystudio.pathing.property.PropertyParts; 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 org.apache.commons.lang3.tuple.Triple;
import java.io.IOException; import java.io.IOException;

View File

@@ -7,7 +7,7 @@ import com.replaymod.replay.ReplaySender;
import com.replaymod.replaystudio.pathing.property.AbstractProperty; import com.replaymod.replaystudio.pathing.property.AbstractProperty;
import com.replaymod.replaystudio.pathing.property.PropertyPart; import com.replaymod.replaystudio.pathing.property.PropertyPart;
import com.replaymod.replaystudio.pathing.property.PropertyParts; import com.replaymod.replaystudio.pathing.property.PropertyParts;
import lombok.NonNull; import de.johni0702.minecraft.gui.utils.NonNull;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;

View File

@@ -3,9 +3,6 @@ package com.replaymod.render;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.replaymod.core.versions.MCVer; import com.replaymod.core.versions.MCVer;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor; 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.client.resource.language.I18n;
import net.minecraft.util.Util; import net.minecraft.util.Util;
@@ -26,7 +23,6 @@ import org.apache.maven.artifact.versioning.ComparableVersion;
//#endif //#endif
//#endif //#endif
@Data
public class RenderSettings { public class RenderSettings {
public enum RenderMethod { public enum RenderMethod {
DEFAULT, STEREOSCOPIC, CUBIC, EQUIRECTANGULAR, ODS, BLEND; DEFAULT, STEREOSCOPIC, CUBIC, EQUIRECTANGULAR, ODS, BLEND;
@@ -119,13 +115,19 @@ public class RenderSettings {
} }
} }
@AllArgsConstructor
public enum AntiAliasing { public enum AntiAliasing {
NONE(1), X2(2), X4(4), X8(8); NONE(1), X2(2), X4(4), X8(8);
@Getter
private final int factor; private final int factor;
AntiAliasing(int factor) {
this.factor = factor;
}
public int getFactor() {
return factor;
}
@Override @Override
public String toString() { public String toString() {
return I18n.translate("replaymod.gui.rendersettings.antialiasing." + name().toLowerCase()); return I18n.translate("replaymod.gui.rendersettings.antialiasing." + name().toLowerCase());
@@ -162,6 +164,48 @@ public class RenderSettings {
private final boolean highPerformance; 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. * @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
*/ */
@@ -253,4 +297,71 @@ public class RenderSettings {
return "ffmpeg"; 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;
}
} }

View File

@@ -1,11 +1,9 @@
package com.replaymod.render.frame; package com.replaymod.render.frame;
import com.replaymod.render.rendering.Frame; import com.replaymod.render.rendering.Frame;
import lombok.Getter;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
public class CubicOpenGlFrame implements Frame { public class CubicOpenGlFrame implements Frame {
@Getter
private final OpenGlFrame left, right, front, back, top, bottom; private final OpenGlFrame left, right, front, back, top, bottom;
public CubicOpenGlFrame(OpenGlFrame left, OpenGlFrame right, OpenGlFrame front, OpenGlFrame back, OpenGlFrame top, OpenGlFrame 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() { public int getFrameId() {
return left.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;
}
} }

View File

@@ -1,11 +1,9 @@
package com.replaymod.render.frame; package com.replaymod.render.frame;
import com.replaymod.render.rendering.Frame; import com.replaymod.render.rendering.Frame;
import lombok.Getter;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
public class ODSOpenGlFrame implements Frame { public class ODSOpenGlFrame implements Frame {
@Getter
private final CubicOpenGlFrame left, right; private final CubicOpenGlFrame left, right;
public ODSOpenGlFrame(CubicOpenGlFrame left, CubicOpenGlFrame right) { public ODSOpenGlFrame(CubicOpenGlFrame left, CubicOpenGlFrame right) {
@@ -18,4 +16,12 @@ public class ODSOpenGlFrame implements Frame {
public int getFrameId() { public int getFrameId() {
return left.getFrameId(); return left.getFrameId();
} }
public CubicOpenGlFrame getLeft() {
return this.left;
}
public CubicOpenGlFrame getRight() {
return this.right;
}
} }

View File

@@ -2,19 +2,31 @@ package com.replaymod.render.frame;
import com.replaymod.render.rendering.Frame; import com.replaymod.render.rendering.Frame;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
@RequiredArgsConstructor
public class OpenGlFrame implements Frame { public class OpenGlFrame implements Frame {
@Getter
private final int frameId; private final int frameId;
@Getter
private final ReadableDimension size; private final ReadableDimension size;
@Getter
private final ByteBuffer byteBuffer; 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;
}
} }

View File

@@ -2,19 +2,15 @@ package com.replaymod.render.frame;
import com.replaymod.render.rendering.Frame; import com.replaymod.render.rendering.Frame;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import lombok.Getter;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
public class RGBFrame implements Frame { public class RGBFrame implements Frame {
@Getter
private final int frameId; private final int frameId;
@Getter
private final ReadableDimension size; private final ReadableDimension size;
@Getter
private final ByteBuffer byteBuffer; private final ByteBuffer byteBuffer;
public RGBFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) { public RGBFrame(int frameId, ReadableDimension size, ByteBuffer byteBuffer) {
@@ -25,4 +21,16 @@ public class RGBFrame implements Frame {
this.size = size; this.size = size;
this.byteBuffer = byteBuffer; this.byteBuffer = byteBuffer;
} }
public int getFrameId() {
return this.frameId;
}
public ReadableDimension getSize() {
return this.size;
}
public ByteBuffer getByteBuffer() {
return this.byteBuffer;
}
} }

View File

@@ -1,11 +1,9 @@
package com.replaymod.render.frame; package com.replaymod.render.frame;
import com.replaymod.render.rendering.Frame; import com.replaymod.render.rendering.Frame;
import lombok.Getter;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
public class StereoscopicOpenGlFrame implements Frame { public class StereoscopicOpenGlFrame implements Frame {
@Getter
private final OpenGlFrame left, right; private final OpenGlFrame left, right;
public StereoscopicOpenGlFrame(OpenGlFrame left, OpenGlFrame right) { public StereoscopicOpenGlFrame(OpenGlFrame left, OpenGlFrame right) {
@@ -19,4 +17,12 @@ public class StereoscopicOpenGlFrame implements Frame {
public int getFrameId() { public int getFrameId() {
return left.getFrameId(); return left.getFrameId();
} }
public OpenGlFrame getLeft() {
return this.left;
}
public OpenGlFrame getRight() {
return this.right;
}
} }

View File

@@ -13,11 +13,9 @@ import de.johni0702.minecraft.gui.element.GuiLabel;
import de.johni0702.minecraft.gui.layout.CustomLayout; import de.johni0702.minecraft.gui.layout.CustomLayout;
import de.johni0702.minecraft.gui.layout.HorizontalLayout; import de.johni0702.minecraft.gui.layout.HorizontalLayout;
import de.johni0702.minecraft.gui.layout.VerticalLayout; import de.johni0702.minecraft.gui.layout.VerticalLayout;
import lombok.RequiredArgsConstructor;
import java.io.File; import java.io.File;
@RequiredArgsConstructor
public class GuiRenderingDone extends GuiScreen { public class GuiRenderingDone extends GuiScreen {
public final ReplayModRender mod; public final ReplayModRender mod;
public final File videoFile; public final File videoFile;
@@ -72,6 +70,13 @@ public class GuiRenderingDone extends GuiScreen {
setBackground(Background.DIRT); 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 @Override
public void display() { public void display() {
if (mod.getCore().getSettingsRegistry().get(Setting.SKIP_POST_RENDER_GUI)) { if (mod.getCore().getSettingsRegistry().get(Setting.SKIP_POST_RENDER_GUI)) {

View File

@@ -6,7 +6,6 @@ import com.replaymod.render.capturer.CaptureData;
import com.replaymod.render.capturer.RenderInfo; import com.replaymod.render.capturer.RenderInfo;
import com.replaymod.render.capturer.WorldRenderer; import com.replaymod.render.capturer.WorldRenderer;
import de.johni0702.minecraft.gui.utils.EventRegistrations; import de.johni0702.minecraft.gui.utils.EventRegistrations;
import lombok.Getter;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
//#if MC>=11500 //#if MC>=11500
@@ -30,10 +29,8 @@ import java.io.IOException;
public class EntityRendererHandler extends EventRegistrations implements WorldRenderer { public class EntityRendererHandler extends EventRegistrations implements WorldRenderer {
public final MinecraftClient mc = MCVer.getMinecraft(); public final MinecraftClient mc = MCVer.getMinecraft();
@Getter
protected final RenderSettings settings; protected final RenderSettings settings;
@Getter
private final RenderInfo renderInfo; private final RenderInfo renderInfo;
public CaptureData data; public CaptureData data;
@@ -99,6 +96,14 @@ public class EntityRendererHandler extends EventRegistrations implements WorldRe
this.omnidirectional = omnidirectional; this.omnidirectional = omnidirectional;
} }
public RenderSettings getSettings() {
return this.settings;
}
public RenderInfo getRenderInfo() {
return this.renderInfo;
}
public interface IEntityRenderer { public interface IEntityRenderer {
void replayModRender_setHandler(EntityRendererHandler handler); void replayModRender_setHandler(EntityRendererHandler handler);
EntityRendererHandler replayModRender_getHandler(); EntityRendererHandler replayModRender_getHandler();

View File

@@ -4,7 +4,6 @@ import com.replaymod.render.frame.CubicOpenGlFrame;
import com.replaymod.render.frame.RGBFrame; import com.replaymod.render.frame.RGBFrame;
import com.replaymod.render.utils.ByteBufferPool; import com.replaymod.render.utils.ByteBufferPool;
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension; import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
import lombok.Getter;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import java.nio.ByteBuffer; 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_TOP = 4;
private static final byte IMAGE_BOTTOM = 5; private static final byte IMAGE_BOTTOM = 5;
@Getter
private final int frameSize; private final int frameSize;
private final int width; private final int width;
private final int height; private final int height;
@@ -138,4 +136,8 @@ public class EquirectangularToRGBProcessor extends AbstractFrameProcessor<CubicO
ByteBufferPool.release(rawFrame.getBottom().getByteBuffer()); ByteBufferPool.release(rawFrame.getBottom().getByteBuffer());
return new RGBFrame(rawFrame.getFrameId(), new Dimension(width, height), result); return new RGBFrame(rawFrame.getFrameId(), new Dimension(width, height), result);
} }
public int getFrameSize() {
return frameSize;
}
} }

View File

@@ -2,7 +2,6 @@ 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 lombok.RequiredArgsConstructor;
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;
@@ -95,10 +94,13 @@ public class Pipeline<R extends Frame, P extends Frame> implements Runnable {
abort = true; abort = true;
} }
@RequiredArgsConstructor
private class ProcessTask implements Runnable { private class ProcessTask implements Runnable {
private final R rawFrame; private final R rawFrame;
public ProcessTask(R rawFrame) {
this.rawFrame = rawFrame;
}
@Override @Override
public void run() { public void run() {
try { try {

View File

@@ -23,11 +23,7 @@ import com.replaymod.render.processor.ODSToRGBProcessor;
import com.replaymod.render.processor.OpenGlToRGBProcessor; import com.replaymod.render.processor.OpenGlToRGBProcessor;
import com.replaymod.render.processor.StereoscopicToRGBProcessor; import com.replaymod.render.processor.StereoscopicToRGBProcessor;
import com.replaymod.render.utils.PixelBufferObject; import com.replaymod.render.utils.PixelBufferObject;
import lombok.experimental.UtilityClass;
import java.io.IOException;
@UtilityClass
public class Pipelines { public class Pipelines {
public static Pipeline newPipeline(RenderSettings.RenderMethod method, RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) { public static Pipeline newPipeline(RenderSettings.RenderMethod method, RenderInfo renderInfo, FrameConsumer<RGBFrame> consumer) {
switch (method) { switch (method) {

View File

@@ -2,7 +2,6 @@ package com.replaymod.render.utils;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.replaymod.core.ReplayMod; import com.replaymod.core.ReplayMod;
import lombok.RequiredArgsConstructor;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
//#if MC>=11400 //#if MC>=11400
@@ -25,13 +24,17 @@ import static org.lwjgl.opengl.ARBVertexBufferObject.*;
//#endif //#endif
public class PixelBufferObject { public class PixelBufferObject {
@RequiredArgsConstructor
public enum Usage { public enum Usage {
COPY(GL_STREAM_COPY_ARB, GL_STREAM_COPY), COPY(GL_STREAM_COPY_ARB, GL_STREAM_COPY),
DRAW(GL_STREAM_DRAW_ARB, GL_STREAM_DRAW), DRAW(GL_STREAM_DRAW_ARB, GL_STREAM_DRAW),
READ(GL_STREAM_READ_ARB, GL_STREAM_READ); READ(GL_STREAM_READ_ARB, GL_STREAM_READ);
private final int arb, gl15; private final int arb, gl15;
Usage(int arb, int gl15) {
this.arb = arb;
this.gl15 = gl15;
}
} }
//#if MC>=11400 //#if MC>=11400

View File

@@ -2,11 +2,62 @@ package com.replaymod.render.utils;
import com.replaymod.render.RenderSettings; import com.replaymod.render.RenderSettings;
import com.replaymod.replaystudio.pathing.path.Timeline; import com.replaymod.replaystudio.pathing.path.Timeline;
import lombok.Data;
@Data import java.util.Objects;
public class RenderJob { public class RenderJob {
private String name; private String name;
private Timeline timeline; private Timeline timeline;
private RenderSettings settings; 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 +
'}';
}
} }

View File

@@ -5,9 +5,6 @@ import com.google.common.util.concurrent.SettableFuture;
import com.replaymod.core.ReplayMod; import com.replaymod.core.ReplayMod;
import com.replaymod.core.versions.MCVer; import com.replaymod.core.versions.MCVer;
import de.johni0702.minecraft.gui.versions.Image; import de.johni0702.minecraft.gui.versions.Image;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.util.ScreenshotUtils; import net.minecraft.client.util.ScreenshotUtils;
@@ -26,13 +23,29 @@ import static com.replaymod.core.versions.MCVer.getWindow;
//$$ import java.io.File; //$$ import java.io.File;
//#endif //#endif
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public class NoGuiScreenshot { public class NoGuiScreenshot {
private final Image image; private final Image image;
private final int width; private final int width;
private final int height; 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) { public static ListenableFuture<NoGuiScreenshot> take(final MinecraftClient mc, final int width, final int height) {
final SettableFuture<NoGuiScreenshot> future = SettableFuture.create(); final SettableFuture<NoGuiScreenshot> future = SettableFuture.create();
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {

View File

@@ -10,8 +10,6 @@ import com.replaymod.replay.ReplayModReplay;
import com.replaymod.replay.Setting; import com.replaymod.replay.Setting;
import com.replaymod.replay.mixin.FirstPersonRendererAccessor; import com.replaymod.replay.mixin.FirstPersonRendererAccessor;
import com.replaymod.replaystudio.util.Location; import com.replaymod.replaystudio.util.Location;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayNetworkHandler;
@@ -105,8 +103,6 @@ public class CameraEntity
*/ */
public float roll; public float roll;
@Getter
@Setter
private CameraController cameraController; private CameraController cameraController;
private long lastControllerUpdate = System.currentTimeMillis(); 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. * Moves the camera by the specified delta.
* @param x Delta in X direction * @param x Delta in X direction

View File

@@ -2,7 +2,6 @@ package com.replaymod.replay.camera;
import com.replaymod.replay.ReplayModReplay; import com.replaymod.replay.ReplayModReplay;
import com.replaymod.replay.mixin.EntityPlayerAccessor; import com.replaymod.replay.mixin.EntityPlayerAccessor;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.options.KeyBinding; import net.minecraft.client.options.KeyBinding;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -21,10 +20,13 @@ import java.util.Arrays;
import static com.replaymod.core.versions.MCVer.*; import static com.replaymod.core.versions.MCVer.*;
@RequiredArgsConstructor
public class SpectatorCameraController implements CameraController { public class SpectatorCameraController implements CameraController {
private final CameraEntity camera; private final CameraEntity camera;
public SpectatorCameraController(CameraEntity camera) {
this.camera = camera;
}
@Override @Override
public void update(float partialTicksPassed) { public void update(float partialTicksPassed) {
MinecraftClient mc = getMinecraft(); MinecraftClient mc = getMinecraft();

View File

@@ -2,15 +2,19 @@
//$$ package com.replaymod.replay.events; //$$ package com.replaymod.replay.events;
//$$ //$$
//$$ import com.replaymod.replay.camera.CameraEntity; //$$ import com.replaymod.replay.camera.CameraEntity;
//$$ import lombok.Getter;
//$$ import lombok.RequiredArgsConstructor;
//$$ import net.minecraftforge.eventbus.api.Cancelable; //$$ import net.minecraftforge.eventbus.api.Cancelable;
//$$ import net.minecraftforge.eventbus.api.Event; //$$ import net.minecraftforge.eventbus.api.Event;
//$$ //$$
//$$ @Cancelable //$$ @Cancelable
//$$ @RequiredArgsConstructor
//$$ public class ReplayChatMessageEvent extends Event { //$$ public class ReplayChatMessageEvent extends Event {
//$$ @Getter
//$$ private final CameraEntity cameraEntity; //$$ private final CameraEntity cameraEntity;
//$$
//$$ public ReplayChatMessageEvent(CameraEntity cameraEntity) {
//$$ this.cameraEntity = cameraEntity;
//$$ }
//$$
//$$ public CameraEntity getCameraEntity() {
//$$ return cameraEntity;
//$$ }
//$$ } //$$ }
//#endif //#endif

View File

@@ -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.Dimension;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
import lombok.Getter;
import net.minecraft.client.gui.screen.NoticeScreen; import net.minecraft.client.gui.screen.NoticeScreen;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashException; import net.minecraft.util.crash.CrashException;
@@ -252,16 +251,12 @@ public class GuiReplayViewer extends GuiScreen {
return popup; return popup;
} }
@Getter
private final SettableFuture<File> future = SettableFuture.create(); private final SettableFuture<File> future = SettableFuture.create();
@Getter
private final GuiReplayList list = new GuiReplayList(popup); private final GuiReplayList list = new GuiReplayList(popup);
@Getter
private final GuiButton acceptButton = new GuiButton(popup).setI18nLabel("gui.done").setSize(50, 20).setDisabled(); 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); 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 @Override
protected GuiSelectReplayPopup getThis() { protected GuiSelectReplayPopup getThis() {
return this; return this;

View File

@@ -4,26 +4,31 @@ import com.replaymod.replaystudio.pathing.interpolation.CatmullRomSplineInterpol
import com.replaymod.replaystudio.pathing.interpolation.CubicSplineInterpolator; import com.replaymod.replaystudio.pathing.interpolation.CubicSplineInterpolator;
import com.replaymod.replaystudio.pathing.interpolation.Interpolator; import com.replaymod.replaystudio.pathing.interpolation.Interpolator;
import com.replaymod.replaystudio.pathing.interpolation.LinearInterpolator; import com.replaymod.replaystudio.pathing.interpolation.LinearInterpolator;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.function.Supplier; import java.util.function.Supplier;
@AllArgsConstructor
public enum InterpolatorType { public enum InterpolatorType {
DEFAULT("default", null, null), DEFAULT("default", null, null),
CATMULL_ROM("catmullrom", CatmullRomSplineInterpolator.class, () -> new CatmullRomSplineInterpolator(0.5)), CATMULL_ROM("catmullrom", CatmullRomSplineInterpolator.class, () -> new CatmullRomSplineInterpolator(0.5)),
CUBIC("cubic", CubicSplineInterpolator.class, CubicSplineInterpolator::new), CUBIC("cubic", CubicSplineInterpolator.class, CubicSplineInterpolator::new),
LINEAR("linear", LinearInterpolator.class, LinearInterpolator::new); LINEAR("linear", LinearInterpolator.class, LinearInterpolator::new);
@Getter
private String localizationKey; private String localizationKey;
@Getter
private Class<? extends Interpolator> interpolatorClass; private Class<? extends Interpolator> interpolatorClass;
private Supplier<Interpolator> interpolatorConstructor; 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() { public String getI18nName() {
return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.name", localizationKey); 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); return String.format("replaymod.gui.editkeyframe.interpolator.%1$s.desc", localizationKey);
} }
public Class<? extends Interpolator> getInterpolatorClass() {
return interpolatorClass;
}
public static InterpolatorType fromString(String string) { public static InterpolatorType fromString(String string) {
for (InterpolatorType t : values()) { for (InterpolatorType t : values()) {
if (t.getI18nName().equals(string)) return t; if (t.getI18nName().equals(string)) return t;

View File

@@ -21,7 +21,6 @@ import com.replaymod.replaystudio.replay.ReplayFile;
import com.replaymod.simplepathing.SPTimeline.SPPath; import com.replaymod.simplepathing.SPTimeline.SPPath;
import com.replaymod.simplepathing.gui.GuiPathing; import com.replaymod.simplepathing.gui.GuiPathing;
import com.replaymod.simplepathing.preview.PathPreview; import com.replaymod.simplepathing.preview.PathPreview;
import lombok.Getter;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashException; import net.minecraft.util.crash.CrashException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@@ -149,7 +148,6 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
private SPTimeline currentTimeline; private SPTimeline currentTimeline;
private SPPath selectedPath; private SPPath selectedPath;
@Getter
private long selectedTime; private long selectedTime;
public SPPath getSelectedPath() { public SPPath getSelectedPath() {
@@ -160,6 +158,10 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
return selectedPath; return selectedPath;
} }
public long getSelectedTime() {
return selectedTime;
}
public boolean isSelected(Keyframe keyframe) { public boolean isSelected(Keyframe keyframe) {
return getSelectedPath() != null && currentTimeline.getKeyframe(selectedPath, selectedTime) == keyframe; return getSelectedPath() != null && currentTimeline.getKeyframe(selectedPath, selectedTime) == keyframe;
} }

View File

@@ -28,7 +28,6 @@ import com.replaymod.replaystudio.pathing.property.Property;
import com.replaymod.replaystudio.util.EntityPositionTracker; import com.replaymod.replaystudio.util.EntityPositionTracker;
import com.replaymod.replaystudio.util.Location; import com.replaymod.replaystudio.util.Location;
import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty; import com.replaymod.simplepathing.properties.ExplicitInterpolationProperty;
import lombok.Getter;
import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashReportSection; import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.util.crash.CrashException; import net.minecraft.util.crash.CrashException;
@@ -63,14 +62,10 @@ public class SPTimeline implements PathingRegistry {
POSITION, POSITION,
} }
@Getter
private final Timeline timeline; private final Timeline timeline;
@Getter
private final Path timePath; private final Path timePath;
@Getter
private final Path positionPath; private final Path positionPath;
@Getter
private EntityPositionTracker entityTracker; private EntityPositionTracker entityTracker;
private InterpolatorType defaultInterpolatorType; private InterpolatorType defaultInterpolatorType;
@@ -84,6 +79,22 @@ public class SPTimeline implements PathingRegistry {
this.positionPath = timeline.getPaths().get(SPPath.POSITION.ordinal()); 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) { public Path getPath(SPPath path) {
switch (path) { switch (path) {
case TIME: case TIME:

View File

@@ -34,7 +34,6 @@ import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
import de.johni0702.minecraft.gui.utils.Colors; import de.johni0702.minecraft.gui.utils.Colors;
import de.johni0702.minecraft.gui.utils.Consumer; import de.johni0702.minecraft.gui.utils.Consumer;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
import lombok.Getter;
import net.minecraft.client.resource.language.I18n; import net.minecraft.client.resource.language.I18n;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; 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> { public class InterpolationPanel extends AbstractGuiContainer<InterpolationPanel> {
@Getter
private SettingsPanel settingsPanel; private SettingsPanel settingsPanel;
private GuiDropdownMenu<InterpolatorType> dropdown; 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) { public void setSettingsPanel(InterpolatorType type) {
removeElement(this.settingsPanel); removeElement(this.settingsPanel);

View File

@@ -4,7 +4,7 @@ import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import com.replaymod.replaystudio.pathing.property.AbstractProperty; import com.replaymod.replaystudio.pathing.property.AbstractProperty;
import com.replaymod.replaystudio.pathing.property.PropertyPart; import com.replaymod.replaystudio.pathing.property.PropertyPart;
import lombok.NonNull; import de.johni0702.minecraft.gui.utils.NonNull;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import java.io.IOException; import java.io.IOException;

View File

@@ -217,7 +217,6 @@ def shadeExclusions = {
exclude group: 'com.google.guava', module: 'guava-jdk5' exclude group: 'com.google.guava', module: 'guava-jdk5'
exclude group: 'com.google.guava', module: 'guava' // provided by MC exclude group: 'com.google.guava', module: 'guava' // provided by MC
exclude group: 'com.google.code.gson', module: 'gson' // provided by MC exclude group: 'com.google.code.gson', module: 'gson' // provided by MC
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
} }
dependencies { dependencies {
@@ -300,7 +299,6 @@ dependencies {
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
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
} }
shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66' shadow 'com.github.ReplayMod:lwjgl-utils:27dcd66'
@@ -315,9 +313,6 @@ dependencies {
} }
} }
annotationProcessor 'org.projectlombok:lombok:1.18.12'
compile 'org.projectlombok:lombok:1.18.12' // runtime only for @SneakyThrows which isn't used
testCompile 'junit:junit:4.11' testCompile 'junit:junit:4.11'
} }