Switch core to 1.14 (generated via ./gradlew :1.14:setCoreVersion)
This commit is contained in:
@@ -22,7 +22,7 @@ import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Color;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
@@ -153,13 +153,13 @@ public class GuiEditReplay extends AbstractGuiPopup<GuiEditReplay> {
|
||||
replayFile.writeMarkers(markers);
|
||||
replayFile.save();
|
||||
} catch (IOException e) {
|
||||
Utils.error(ReplayModEditor.LOGGER, this, CrashReport.makeCrashReport(e, "Writing markers"), this::close);
|
||||
Utils.error(ReplayModEditor.LOGGER, this, CrashReport.create(e, "Writing markers"), this::close);
|
||||
}
|
||||
|
||||
try {
|
||||
MarkerProcessor.apply(inputPath, progressPopup.progressBar::setProgress);
|
||||
} catch (IOException e) {
|
||||
Utils.error(ReplayModEditor.LOGGER, this, CrashReport.makeCrashReport(e, "Running marker processor"), this::close);
|
||||
Utils.error(ReplayModEditor.LOGGER, this, CrashReport.create(e, "Running marker processor"), this::close);
|
||||
}
|
||||
|
||||
ReplayMod.instance.runLater(() -> {
|
||||
|
||||
@@ -35,7 +35,7 @@ import de.johni0702.minecraft.gui.popup.GuiInfoPopup;
|
||||
import de.johni0702.minecraft.gui.popup.GuiYesNoPopup;
|
||||
import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -221,7 +221,7 @@ public class GuiReplayEditor extends GuiScreen {
|
||||
try {
|
||||
replayFolder = mod.getReplayFolder();
|
||||
} catch (IOException e) {
|
||||
Utils.error(LOGGER, GuiReplayEditor.this, CrashReport.makeCrashReport(e, "Getting replay folder"), null);
|
||||
Utils.error(LOGGER, GuiReplayEditor.this, CrashReport.create(e, "Getting replay folder"), null);
|
||||
return;
|
||||
}
|
||||
File targetFile = new File(replayFolder, Utils.replayNameToFileName(name));
|
||||
@@ -275,7 +275,7 @@ public class GuiReplayEditor extends GuiScreen {
|
||||
try {
|
||||
runnable.run();
|
||||
} catch (Throwable t) {
|
||||
CrashReport crashReport = CrashReport.makeCrashReport(t, "Editing replay file");
|
||||
CrashReport crashReport = CrashReport.create(t, "Editing replay file");
|
||||
mod.runLater(() -> Utils.error(LOGGER, this, crashReport, popup::close));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ import de.johni0702.minecraft.gui.layout.GridLayout;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.Dimension;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -96,9 +96,9 @@ public class GuiTrimPanel extends GuiPanel {
|
||||
|
||||
Function<Marker, String> toString = m -> {
|
||||
if (m == NO_MARKER) {
|
||||
return I18n.format("replaymod.gui.editor.trim.marker");
|
||||
return I18n.translate("replaymod.gui.editor.trim.marker");
|
||||
} else {
|
||||
return ofNullable(m.getName()).orElse(I18n.format("replaymod.gui.ingame.unnamedmarker"))
|
||||
return ofNullable(m.getName()).orElse(I18n.translate("replaymod.gui.ingame.unnamedmarker"))
|
||||
+ " (" + Utils.convertSecondsToShortString(m.getTime() / 1000) + ")";
|
||||
}
|
||||
};
|
||||
@@ -112,7 +112,7 @@ public class GuiTrimPanel extends GuiPanel {
|
||||
try {
|
||||
folder = gui.getMod().getReplayFolder();
|
||||
} catch (IOException e) {
|
||||
Utils.error(LOGGER, gui, CrashReport.makeCrashReport(e, "Getting replay folder"), gui.backButton::onClick);
|
||||
Utils.error(LOGGER, gui, CrashReport.create(e, "Getting replay folder"), gui.backButton::onClick);
|
||||
return;
|
||||
}
|
||||
GuiReplayViewer.GuiSelectReplayPopup popup = GuiReplayViewer.GuiSelectReplayPopup.openGui(gui, folder);
|
||||
@@ -128,7 +128,7 @@ public class GuiTrimPanel extends GuiPanel {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
Utils.error(LOGGER, gui, CrashReport.makeCrashReport(t, "Selecting replay"), gui.backButton::onClick);
|
||||
Utils.error(LOGGER, gui, CrashReport.create(t, "Selecting replay"), gui.backButton::onClick);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -174,7 +174,7 @@ public class GuiTrimPanel extends GuiPanel {
|
||||
File file = inputReplay;
|
||||
|
||||
// Update input button label
|
||||
inputReplayButton.setLabel(file == NO_REPLAY ? I18n.format("gui.none") : Utils.fileNameToReplayName(file.getName()));
|
||||
inputReplayButton.setLabel(file == NO_REPLAY ? I18n.translate("gui.none") : Utils.fileNameToReplayName(file.getName()));
|
||||
|
||||
// Load markers and meta data from replay file
|
||||
ReplayMetaData metaData;
|
||||
@@ -188,7 +188,7 @@ public class GuiTrimPanel extends GuiPanel {
|
||||
markers = replayFile.getMarkers().or(Collections.emptySet());
|
||||
LOGGER.debug("Loaded {} markers from replay {}", markers.size(), file);
|
||||
} catch (Exception e) {
|
||||
Utils.error(LOGGER, gui, CrashReport.makeCrashReport(e, "Reading markers from replay"), null);
|
||||
Utils.error(LOGGER, gui, CrashReport.create(e, "Reading markers from replay"), null);
|
||||
metaData = new ReplayMetaData();
|
||||
markers = Collections.emptySet();
|
||||
}
|
||||
|
||||
@@ -8,16 +8,16 @@ import com.replaymod.replay.gui.screen.GuiReplayViewer;
|
||||
import de.johni0702.minecraft.gui.container.AbstractGuiScreen;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import de.johni0702.minecraft.gui.element.GuiButton;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
|
||||
//#if MC>=11400
|
||||
//$$ import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
|
||||
//$$ import net.minecraft.client.gui.Screen;
|
||||
//$$ import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
//$$ import java.util.List;
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
|
||||
import net.minecraft.client.gui.Screen;
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import java.util.List;
|
||||
//#else
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//$$ import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -26,12 +26,12 @@ import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
public class GuiHandler extends EventRegistrations {
|
||||
//#if MC>=11400
|
||||
//$$ { on(InitScreenCallback.EVENT, this::injectIntoReplayViewer); }
|
||||
//$$ public void injectIntoReplayViewer(Screen vanillaGuiScreen, List<AbstractButtonWidget> buttonList) {
|
||||
{ on(InitScreenCallback.EVENT, this::injectIntoReplayViewer); }
|
||||
public void injectIntoReplayViewer(Screen vanillaGuiScreen, List<AbstractButtonWidget> buttonList) {
|
||||
//#else
|
||||
@SubscribeEvent
|
||||
public void injectIntoReplayViewer(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
net.minecraft.client.gui.GuiScreen vanillaGuiScreen = getGui(event);
|
||||
//$$ @SubscribeEvent
|
||||
//$$ public void injectIntoReplayViewer(GuiScreenEvent.InitGuiEvent.Post event) {
|
||||
//$$ net.minecraft.client.gui.GuiScreen vanillaGuiScreen = getGui(event);
|
||||
//#endif
|
||||
AbstractGuiScreen guiScreen = GuiScreen.from(vanillaGuiScreen);
|
||||
if (!(guiScreen instanceof GuiReplayViewer)) {
|
||||
@@ -50,7 +50,7 @@ public class GuiHandler extends EventRegistrations {
|
||||
}
|
||||
}.open();
|
||||
} catch (IOException e) {
|
||||
Utils.error(ReplayModEditor.LOGGER, replayViewer, CrashReport.makeCrashReport(e, "Opening replay editor"), () -> {});
|
||||
Utils.error(ReplayModEditor.LOGGER, replayViewer, CrashReport.create(e, "Opening replay editor"), () -> {});
|
||||
}
|
||||
}).setSize(73, 20).setI18nLabel("replaymod.gui.edit").setDisabled());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user