Make use of the source remapping feature of The Preprocessor plugin

This commit is contained in:
Jonas Herzig
2019-04-24 15:02:33 +02:00
parent 6127e0a027
commit 2ee91515f7
72 changed files with 401 additions and 1121 deletions

View File

@@ -64,7 +64,7 @@ public class ReplayModOnline implements Module {
@Override
public void initClient() {
Path path = MCVer.mcDataDir(MCVer.getMinecraft()).toPath().resolve("config/replaymod-online.token");
Path path = MCVer.getMinecraft().gameDir.toPath().resolve("config/replaymod-online.token");
PlainFileAuthData authData = new PlainFileAuthData(path);
apiClient = new ApiClient(authData);
if (Files.notExists(path)) {
@@ -106,7 +106,7 @@ public class ReplayModOnline implements Module {
*/
private AuthData loadOldAuthData() {
//#if MC<11300
//$$ Path path = MCVer.mcDataDir(MCVer.getMinecraft()).toPath().resolve("config/replaymod-online.cfg");
//$$ Path path = MCVer.getMinecraft().mcDataDir.toPath().resolve("config/replaymod-online.cfg");
//$$ Configuration config = new Configuration(path.toFile());
//$$ ConfigurationAuthData authData = new ConfigurationAuthData(config);
//$$ authData.load(new ApiClient(authData));
@@ -139,7 +139,7 @@ public class ReplayModOnline implements Module {
public File getDownloadsFolder() {
String path = core.getSettingsRegistry().get(Setting.DOWNLOAD_PATH);
return new File(path.startsWith("./") ? mcDataDir(getMinecraft()) : null, path);
return new File(path.startsWith("./") ? getMinecraft().gameDir : null, path);
}
public File getDownloadedFile(int id) {

View File

@@ -16,8 +16,6 @@ import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
import net.minecraft.client.gui.FontRenderer;
import static com.replaymod.core.versions.MCVer.*;
public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
public static final int MIN_PW_LENGTH = 5;
public static final int MAX_PW_LENGTH = 1024;
@@ -57,7 +55,7 @@ public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
pos(cancelButton, width / 2 + 2, 170);
pos(statusLabel, width / 2 - statusLabel.getMinSize().getWidth() / 2, 152);
FontRenderer font = getFontRenderer(getMinecraft());
FontRenderer font = getMinecraft().fontRenderer;
int lineCount = font.listFormattedStringToWidth(disclaimerLabel.getText(), width - 10).size();
Dimension dim = new Dimension(width - 10, font.FONT_HEIGHT * lineCount);
disclaimerLabel.setSize(dim);

View File

@@ -35,6 +35,7 @@ import de.johni0702.minecraft.gui.utils.Colors;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.ReportedException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
@@ -50,7 +51,6 @@ import java.io.IOException;
import java.util.Set;
import java.util.stream.Collectors;
import static com.replaymod.core.versions.MCVer.newReportedException;
import static java.util.Arrays.stream;
public class GuiUploadReplay extends GuiScreen {
@@ -134,7 +134,7 @@ public class GuiUploadReplay extends GuiScreen {
metaData = replayFile.getMetaData();
optThumbnail = replayFile.getThumb();
} catch (IOException e) {
throw newReportedException(CrashReport.makeCrashReport(e, "Read replay file " + file.getName()));
throw new ReportedException(CrashReport.makeCrashReport(e, "Read replay file " + file.getName()));
}
// Apply to gui