Update to MC 1.14.1

The ReplayStudio update also fixes an issue with reading the
PlayerListEntryPacket leading to NPEs during Quick Mode.
This commit is contained in:
Jonas Herzig
2019-05-20 13:38:38 +02:00
parent 0e086d91a6
commit e5ee6a3d94
49 changed files with 198 additions and 208 deletions

View File

@@ -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.text.TextFormat;
import net.minecraft.ChatFormat;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -417,9 +417,9 @@ public class GuiReplayCenter extends GuiScreen {
this.downloaded = downloaded;
ReplayMetaData metaData = fileInfo.getMetadata();
name.setText(TextFormat.UNDERLINE + Utils.fileNameToReplayName(fileInfo.getName()));
name.setText(ChatFormat.UNDERLINE + Utils.fileNameToReplayName(fileInfo.getName()));
author.setI18nText("replaymod.gui.center.author",
"" + TextFormat.GRAY + TextFormat.ITALIC, fileInfo.getOwner());
"" + ChatFormat.GRAY + ChatFormat.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(TextFormat.ITALIC + Optional.fromNullable(Category.fromId(fileInfo.getCategory()))
category.setText(ChatFormat.ITALIC + Optional.fromNullable(Category.fromId(fileInfo.getCategory()))
.or(Category.MISCELLANEOUS).toNiceString());
addElements(null, durationPanel, downloadsPanel);

View File

@@ -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.text.TextFormat;
import net.minecraft.ChatFormat;
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",
TextFormat.UNDERLINE + name + TextFormat.RESET);
ChatFormat.UNDERLINE + name + ChatFormat.RESET);
setLayout(new CustomLayout<GuiReplayDownloading>() {
@Override
protected void layout(GuiReplayDownloading container, int width, int height) {

View File

@@ -10,12 +10,12 @@ import com.replaymod.replay.handler.GuiHandler.InjectedButton;
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
import de.johni0702.minecraft.gui.container.GuiScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.MainMenuScreen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.resource.language.I18n;
//#if MC>=11400
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
import net.minecraft.client.gui.Screen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import java.util.List;
//#else
@@ -44,7 +44,7 @@ public class GuiHandler extends EventRegistrations {
//$$ public void injectIntoMainMenu(GuiScreenEvent.InitGuiEvent event) {
//$$ final net.minecraft.client.gui.GuiScreen guiScreen = getGui(event);
//#endif
if (!(guiScreen instanceof MainMenuScreen)) {
if (!(guiScreen instanceof TitleScreen)) {
return;
}
@@ -89,7 +89,7 @@ public class GuiHandler extends EventRegistrations {
//#if MC>=11300
private void onButton(InjectedButton button) {
net.minecraft.client.gui.Screen guiScreen = button.guiScreen;
net.minecraft.client.gui.screen.Screen guiScreen = button.guiScreen;
//#else
//$$ @SubscribeEvent
//$$ public void onButton(GuiScreenEvent.ActionPerformedEvent.Pre event) {
@@ -98,7 +98,7 @@ public class GuiHandler extends EventRegistrations {
//#endif
if(!button.active) return;
if (guiScreen instanceof MainMenuScreen) {
if (guiScreen instanceof TitleScreen) {
if (button.id == BUTTON_REPLAY_CENTER) {
GuiReplayCenter replayCenter = new GuiReplayCenter(mod);
if (mod.isLoggedIn()) {