Remove remaining old packages
This commit is contained in:
@@ -5,11 +5,10 @@ import com.google.common.util.concurrent.ListenableFutureTask;
|
||||
import com.replaymod.core.gui.GuiReplaySettings;
|
||||
import com.replaymod.core.gui.RestoreReplayGui;
|
||||
import com.replaymod.core.handler.MainMenuHandler;
|
||||
import com.replaymod.core.utils.OpenGLUtils;
|
||||
import com.replaymod.render.utils.SoundHandler;
|
||||
import com.replaymod.replaystudio.util.I18n;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import com.replaymod.render.utils.SoundHandler;
|
||||
import com.replaymod.core.utils.OpenGLUtils;
|
||||
import eu.crushedpixel.replaymod.utils.TooltipRenderer;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
@@ -67,8 +66,6 @@ public class ReplayMod {
|
||||
@Deprecated
|
||||
public static Configuration config;
|
||||
@Deprecated
|
||||
public static TooltipRenderer tooltipRenderer;
|
||||
@Deprecated
|
||||
public static SoundHandler soundHandler = new SoundHandler();
|
||||
|
||||
private final KeyBindingRegistry keyBindingRegistry = new KeyBindingRegistry();
|
||||
@@ -125,8 +122,6 @@ public class ReplayMod {
|
||||
if(!FMLClientHandler.instance().hasOptifine())
|
||||
GameSettings.Options.RENDER_DISTANCE.setValueMax(64f);
|
||||
|
||||
tooltipRenderer = new TooltipRenderer();
|
||||
|
||||
if (System.getProperty("replaymod.render.file") != null) {
|
||||
final File file = new File(System.getProperty("replaymod.render.file"));
|
||||
if (!file.exists()) {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.replaymod.extras;
|
||||
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.online.ReplayModOnline;
|
||||
import eu.crushedpixel.replaymod.utils.StringUtils;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -12,6 +11,8 @@ import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class VersionChecker implements Extra {
|
||||
@Mod.Instance(ReplayModOnline.MOD_ID)
|
||||
@@ -43,7 +44,8 @@ public class VersionChecker implements Extra {
|
||||
|
||||
int width = Math.max(100, event.gui.width / 2 - 100 - 10);
|
||||
|
||||
String[] lines = StringUtils.splitStringInMultipleRows(I18n.format("replaymod.gui.outdated"), width);
|
||||
@SuppressWarnings("unchecked") List<String> lines =
|
||||
event.gui.mc.fontRendererObj.listFormattedStringToWidth(I18n.format("replaymod.gui.outdated"), width);
|
||||
|
||||
int maxLineWidth = 0;
|
||||
for(String line : lines) {
|
||||
@@ -53,7 +55,7 @@ public class VersionChecker implements Extra {
|
||||
}
|
||||
}
|
||||
|
||||
Gui.drawRect(2, 77, 5 + maxLineWidth + 3, 80 + (lines.length * 10), 0x80FF0000);
|
||||
Gui.drawRect(2, 77, 5 + maxLineWidth + 3, 80 + (lines.size() * 10), 0x80FF0000);
|
||||
|
||||
int i = 0;
|
||||
for(String line : lines) {
|
||||
|
||||
@@ -6,11 +6,10 @@ import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.mojang.authlib.exceptions.AuthenticationException;
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.online.AuthenticationHash;
|
||||
import com.replaymod.online.api.replay.ReplayModApiMethods;
|
||||
import com.replaymod.online.api.replay.SearchQuery;
|
||||
import com.replaymod.online.api.replay.holders.*;
|
||||
import eu.crushedpixel.replaymod.gui.elements.listeners.ProgressUpdateListener;
|
||||
import com.replaymod.online.AuthenticationHash;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
@@ -21,6 +20,7 @@ import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class ApiClient {
|
||||
|
||||
@@ -135,7 +135,7 @@ public class ApiClient {
|
||||
|
||||
private boolean cancelDownload = false;
|
||||
|
||||
public void downloadFile(int file, File target, ProgressUpdateListener listener) throws IOException, ApiException {
|
||||
public void downloadFile(int file, File target, Consumer<Float> listener) throws IOException, ApiException {
|
||||
cancelDownload = false;
|
||||
|
||||
QueryBuilder builder = new QueryBuilder(ReplayModApiMethods.download_file);
|
||||
@@ -168,7 +168,7 @@ public class ApiClient {
|
||||
|
||||
fout.write(data, 0, count);
|
||||
read += count;
|
||||
listener.onProgressChanged((float)(read)/fileSize);
|
||||
listener.accept((float) read / fileSize);
|
||||
}
|
||||
} finally {
|
||||
bin.close();
|
||||
|
||||
@@ -10,7 +10,6 @@ import de.johni0702.minecraft.gui.element.GuiTextField;
|
||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||
import de.johni0702.minecraft.gui.utils.Consumer;
|
||||
import de.johni0702.minecraft.gui.utils.Utils;
|
||||
import eu.crushedpixel.replaymod.gui.GuiConstants;
|
||||
|
||||
public class GuiLoginPrompt extends AbstractGuiScreen<GuiLoginPrompt> {
|
||||
|
||||
|
||||
@@ -10,12 +10,11 @@ import de.johni0702.minecraft.gui.element.GuiButton;
|
||||
import de.johni0702.minecraft.gui.element.GuiLabel;
|
||||
import de.johni0702.minecraft.gui.element.advanced.GuiProgressBar;
|
||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||
import eu.crushedpixel.replaymod.gui.elements.listeners.ProgressUpdateListener;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class GuiReplayDownloading extends AbstractGuiScreen<GuiReplayDownloading> implements ProgressUpdateListener {
|
||||
public class GuiReplayDownloading extends AbstractGuiScreen<GuiReplayDownloading> {
|
||||
private final GuiScreen cancelScreen;
|
||||
private final ApiClient apiClient;
|
||||
|
||||
@@ -52,7 +51,7 @@ public class GuiReplayDownloading extends AbstractGuiScreen<GuiReplayDownloading
|
||||
public void run() {
|
||||
final File replayFile = mod.getDownloadedFile(replayId);
|
||||
try {
|
||||
apiClient.downloadFile(replayId, replayFile, GuiReplayDownloading.this);
|
||||
apiClient.downloadFile(replayId, replayFile, progressBar::setProgress);
|
||||
if (replayFile.exists()) {
|
||||
getMinecraft().addScheduledTask(new Runnable() {
|
||||
@Override
|
||||
@@ -72,17 +71,6 @@ public class GuiReplayDownloading extends AbstractGuiScreen<GuiReplayDownloading
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(float progress) {
|
||||
progressBar.setProgress(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(float progress, String progressString) {
|
||||
onProgressChanged(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiReplayDownloading getThis() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import com.replaymod.render.frame.RGBFrame;
|
||||
import com.replaymod.render.rendering.FrameConsumer;
|
||||
import com.replaymod.render.utils.ByteBufferPool;
|
||||
import com.replaymod.render.utils.StreamPipe;
|
||||
import eu.crushedpixel.replaymod.utils.StringUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import org.apache.commons.exec.CommandLine;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.lwjgl.util.ReadableDimension;
|
||||
|
||||
@@ -17,8 +17,6 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.apache.commons.lang3.Validate.isTrue;
|
||||
@@ -45,11 +43,10 @@ public class VideoWriter implements FrameConsumer<RGBFrame> {
|
||||
.replace("%FILENAME%", fileName)
|
||||
.replace("%BITRATE%", String.valueOf(settings.getBitRate()));
|
||||
|
||||
List<String> command = new ArrayList<>();
|
||||
command.add(settings.getExportCommand().isEmpty() ? "ffmpeg" : settings.getExportCommand());
|
||||
command.addAll(StringUtils.translateCommandline(commandArgs));
|
||||
String executable = settings.getExportCommand().isEmpty() ? "ffmpeg" : settings.getExportCommand();
|
||||
System.out.println("Starting " + settings.getExportCommand() + " with args: " + commandArgs);
|
||||
process = new ProcessBuilder(command).directory(outputFolder).start();
|
||||
String[] cmdline = new CommandLine(executable).addArguments(commandArgs).toStrings();
|
||||
process = new ProcessBuilder(cmdline).directory(outputFolder).start();
|
||||
OutputStream exportLogOut = new FileOutputStream("export.log");
|
||||
new StreamPipe(process.getInputStream(), exportLogOut).start();
|
||||
new StreamPipe(process.getErrorStream(), exportLogOut).start();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.replaymod.replay;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.replaymod.core.utils.Restrictions;
|
||||
import com.replaymod.replay.camera.CameraEntity;
|
||||
import com.replaymod.replay.camera.SpectatorCameraController;
|
||||
import com.replaymod.replay.events.ReplayCloseEvent;
|
||||
@@ -9,14 +10,13 @@ import com.replaymod.replay.events.ReplayOpenEvent;
|
||||
import com.replaymod.replay.gui.overlay.GuiReplayOverlay;
|
||||
import com.replaymod.replaystudio.data.Marker;
|
||||
import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.core.utils.Restrictions;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import eu.crushedpixel.replaymod.utils.MouseUtils;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.embedded.EmbeddedChannel;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityOtherPlayerMP;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -26,7 +26,6 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.util.Point;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
@@ -307,8 +306,8 @@ public class ReplayHandler {
|
||||
mc.getFramebuffer().bindFramebuffer(true);
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
|
||||
Point point = MouseUtils.getScaledDimensions();
|
||||
guiScreen.setWorldAndResolution(mc, point.getX(), point.getY());
|
||||
ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
guiScreen.setWorldAndResolution(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
|
||||
guiScreen.drawScreen(0, 0, 0);
|
||||
|
||||
mc.getFramebuffer().unbindFramebuffer();
|
||||
|
||||
Reference in New Issue
Block a user