Switch core to 1.14 (generated via ./gradlew :1.14:setCoreVersion)
This commit is contained in:
@@ -15,7 +15,7 @@ import de.johni0702.minecraft.gui.utils.Utils;
|
||||
import com.replaymod.core.utils.Patterns;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
|
||||
public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
|
||||
public static final int MIN_PW_LENGTH = 5;
|
||||
@@ -56,9 +56,9 @@ public class GuiRegister extends AbstractGuiScreen<GuiRegister> {
|
||||
pos(cancelButton, width / 2 + 2, 170);
|
||||
pos(statusLabel, width / 2 - statusLabel.getMinSize().getWidth() / 2, 152);
|
||||
|
||||
FontRenderer font = getMinecraft().fontRenderer;
|
||||
int lineCount = font.listFormattedStringToWidth(disclaimerLabel.getText(), width - 10).size();
|
||||
Dimension dim = new Dimension(width - 10, font.FONT_HEIGHT * lineCount);
|
||||
TextRenderer font = getMinecraft().textRenderer;
|
||||
int lineCount = font.wrapStringToWidthAsList(disclaimerLabel.getText(), width - 10).size();
|
||||
Dimension dim = new Dimension(width - 10, font.fontHeight * lineCount);
|
||||
disclaimerLabel.setSize(dim);
|
||||
pos(disclaimerLabel, 5, height - dim.getHeight() - 5);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import de.johni0702.minecraft.gui.utils.Consumer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.text.TextFormat;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
@@ -220,7 +220,7 @@ public class GuiReplayCenter extends GuiScreen {
|
||||
public void onSuccess(Boolean result) {
|
||||
if (result) {
|
||||
apiClient.logout();
|
||||
getMinecraft().displayGuiScreen(null);
|
||||
getMinecraft().openScreen(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class GuiReplayCenter extends GuiScreen {
|
||||
public final GuiButton mainMenuButton = new GuiButton().onClick(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getMinecraft().displayGuiScreen(null);
|
||||
getMinecraft().openScreen(null);
|
||||
}
|
||||
}).setSize(195, 20).setI18nLabel("replaymod.gui.mainmenu");
|
||||
|
||||
@@ -417,9 +417,9 @@ public class GuiReplayCenter extends GuiScreen {
|
||||
this.downloaded = downloaded;
|
||||
ReplayMetaData metaData = fileInfo.getMetadata();
|
||||
|
||||
name.setText(TextFormatting.UNDERLINE + Utils.fileNameToReplayName(fileInfo.getName()));
|
||||
name.setText(TextFormat.UNDERLINE + Utils.fileNameToReplayName(fileInfo.getName()));
|
||||
author.setI18nText("replaymod.gui.center.author",
|
||||
"" + TextFormatting.GRAY + TextFormatting.ITALIC, fileInfo.getOwner());
|
||||
"" + TextFormat.GRAY + TextFormat.ITALIC, fileInfo.getOwner());
|
||||
if (StringUtils.isEmpty(metaData.getServerName())) {
|
||||
server.setI18nText("replaymod.gui.iphidden").setColor(Colors.DARK_RED);
|
||||
} else {
|
||||
@@ -443,7 +443,7 @@ public class GuiReplayCenter extends GuiScreen {
|
||||
favorites.setText("⭑" + fileInfo.getFavorites());
|
||||
likes.setText("⬆" + fileInfo.getRatings().getPositive());
|
||||
dislikes.setText("⬇" + fileInfo.getRatings().getNegative());
|
||||
category.setText(TextFormatting.ITALIC + Optional.fromNullable(Category.fromId(fileInfo.getCategory()))
|
||||
category.setText(TextFormat.ITALIC + Optional.fromNullable(Category.fromId(fileInfo.getCategory()))
|
||||
.or(Category.MISCELLANEOUS).toNiceString());
|
||||
addElements(null, durationPanel, downloadsPanel);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import de.johni0702.minecraft.gui.layout.GridLayout;
|
||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
|
||||
//#if MC>=11300
|
||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||
@@ -61,26 +61,26 @@ public class GuiReplayCenterSearch extends AbstractGuiPopup<GuiReplayCenterSearc
|
||||
}).setI18nLabel("replaymod.gui.center.top.search");
|
||||
{
|
||||
List<String> categories = new ArrayList<>();
|
||||
categories.add(I18n.format("replaymod.gui.center.search.category"));
|
||||
categories.add(I18n.translate("replaymod.gui.center.search.category"));
|
||||
for (Category c : Category.values()) {
|
||||
categories.add(c.toNiceString());
|
||||
}
|
||||
category.setValues(categories.toArray(new String[categories.size()]));
|
||||
|
||||
List<String> versions = new ArrayList<>();
|
||||
versions.add(I18n.format("replaymod.gui.center.search.version"));
|
||||
versions.add(I18n.translate("replaymod.gui.center.search.version"));
|
||||
for (MinecraftVersion v : MinecraftVersion.values()) {
|
||||
versions.add(v.toNiceName());
|
||||
}
|
||||
version.setValues(versions.toArray(new String[versions.size()]));
|
||||
|
||||
gameType.setI18nLabel("replaymod.gui.center.search.gametype")
|
||||
.setValues(I18n.format("options.particles.all"),
|
||||
I18n.format("menu.singleplayer"),
|
||||
I18n.format("menu.multiplayer"));
|
||||
.setValues(I18n.translate("options.particles.all"),
|
||||
I18n.translate("menu.singleplayer"),
|
||||
I18n.translate("menu.multiplayer"));
|
||||
sort.setI18nLabel("replaymod.gui.center.search.order")
|
||||
.setValues(I18n.format("replaymod.gui.center.search.order.best"),
|
||||
I18n.format("replaymod.gui.center.search.order.recent"));
|
||||
.setValues(I18n.translate("replaymod.gui.center.search.order.best"),
|
||||
I18n.translate("replaymod.gui.center.search.order.recent"));
|
||||
|
||||
popup.setLayout(new GridLayout().setColumns(3).setSpacingX(5).setSpacingY(5));
|
||||
popup.addElements(null,
|
||||
|
||||
@@ -10,7 +10,7 @@ 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 net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.text.TextFormat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -34,7 +34,7 @@ public class GuiReplayDownloading extends AbstractGuiScreen<GuiReplayDownloading
|
||||
this.apiClient = mod.getApiClient();
|
||||
setTitle(new GuiLabel().setI18nText("replaymod.gui.viewer.download.title"));
|
||||
final GuiLabel subTitle = new GuiLabel(this).setI18nText("replaymod.gui.viewer.download.message",
|
||||
TextFormatting.UNDERLINE + name + TextFormatting.RESET);
|
||||
TextFormat.UNDERLINE + name + TextFormat.RESET);
|
||||
setLayout(new CustomLayout<GuiReplayDownloading>() {
|
||||
@Override
|
||||
protected void layout(GuiReplayDownloading container, int width, int height) {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class GuiSaveModifiedReplay extends GuiScreen {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
getMinecraft().displayGuiScreen(null);
|
||||
getMinecraft().openScreen(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class GuiSaveModifiedReplay extends GuiScreen {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
getMinecraft().displayGuiScreen(null);
|
||||
getMinecraft().openScreen(null);
|
||||
}
|
||||
}
|
||||
}).setSize(147, 20).setI18nLabel("replaymod.gui.replaymodified.yes");
|
||||
@@ -67,7 +67,7 @@ public class GuiSaveModifiedReplay extends GuiScreen {
|
||||
@Override
|
||||
public void run() {
|
||||
FileUtils.deleteQuietly(file);
|
||||
getMinecraft().displayGuiScreen(null);
|
||||
getMinecraft().openScreen(null);
|
||||
}
|
||||
}).setSize(147, 20).setI18nLabel("replaymod.gui.replaymodified.no");
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import de.johni0702.minecraft.gui.popup.GuiYesNoPopup;
|
||||
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 net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.options.KeyBinding;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GuiUploadReplay extends GuiScreen {
|
||||
public final GuiLabel durationLabel = new GuiLabel();
|
||||
public final GuiCheckbox hideServerIP = new GuiCheckbox();
|
||||
public final GuiDropdownMenu<Category> category = new GuiDropdownMenu<Category>().setHeight(20)
|
||||
.setValues(Category.values()).setToString(v -> I18n.format("replaymod.category") + ": " + v.toNiceString());
|
||||
.setValues(Category.values()).setToString(v -> I18n.translate("replaymod.category") + ": " + v.toNiceString());
|
||||
public final GuiTextField tags = new GuiTextField().setHeight(20).setMaxLength(30)
|
||||
.setI18nHint("replaymod.gui.upload.tagshint");
|
||||
|
||||
@@ -134,7 +134,7 @@ public class GuiUploadReplay extends GuiScreen {
|
||||
metaData = replayFile.getMetaData();
|
||||
optThumbnail = replayFile.getThumb();
|
||||
} catch (IOException e) {
|
||||
throw new ReportedException(CrashReport.makeCrashReport(e, "Read replay file " + file.getName()));
|
||||
throw new CrashException(CrashReport.create(e, "Read replay file " + file.getName()));
|
||||
}
|
||||
|
||||
// Apply to gui
|
||||
@@ -152,7 +152,7 @@ public class GuiUploadReplay extends GuiScreen {
|
||||
KeyBindingRegistry registry = mod.getCore().getKeyBindingRegistry();
|
||||
KeyBinding keyBinding = registry.getKeyBindings().get("replaymod.input.thumbnail");
|
||||
//#if MC>=11300
|
||||
String keyName = keyBinding == null ? "???" : keyBinding.func_197978_k();
|
||||
String keyName = keyBinding == null ? "???" : keyBinding.getLocalizedName();
|
||||
//#else
|
||||
//$$ String keyName = keyBinding == null ? "???" : GameSettings.getKeyDisplayString(keyBinding.getKeyCode());
|
||||
//#endif
|
||||
@@ -216,7 +216,7 @@ public class GuiUploadReplay extends GuiScreen {
|
||||
if (e instanceof ApiException) {
|
||||
message = e.getLocalizedMessage();
|
||||
} else {
|
||||
message = I18n.format("replaymod.gui.unknownerror");
|
||||
message = I18n.translate("replaymod.gui.unknownerror");
|
||||
}
|
||||
mod.getCore().runLater(() -> {
|
||||
// Show error popup
|
||||
|
||||
Reference in New Issue
Block a user