Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Commit

Permalink
[create release] Release 1.4.0 (#29)
Browse files Browse the repository at this point in the history
* Update data file name

* Spaces → Tabs
They are far superior.

* (Some) UI Improvements
Add arrows to select option.
Hold "shift" to reverse options.
Better buttons with cool outlines.

* Relocate misplaced event

* Make ConfigOnlyMod abstract

* I'm picky

* Clean up packages and class names

* Another unused class

* Rename some class references

* Allow customisation of recording indicator

* Better mod naming

* Add shadow to Replay Mod sliders

* Add opt-in crash reporter

* What's occuring?

* Update version to 1.4.0

* Update package-lock.json
  • Loading branch information
TheKodeToad authored Dec 1, 2021
1 parent c578858 commit 340ae3b
Show file tree
Hide file tree
Showing 328 changed files with 12,414 additions and 11,587 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const Launcher = require("./launcher");
const Utils = require("./utils");
const Config = require("./config");
const launcher = Launcher.instance;
const {ipcRenderer, shell} = require("electron");
const {MicrosoftAuthService, YggdrasilAuthService, Account} = require("./auth");
const { ipcRenderer, shell } = require("electron");
const { MicrosoftAuthService, YggdrasilAuthService, Account } = require("./auth");
const microsoftAuthService = MicrosoftAuthService.instance;
const yggdrasilAuthService = YggdrasilAuthService.instance;
const fs = require("fs");
Expand Down
44 changes: 22 additions & 22 deletions game/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,51 +116,51 @@ static def process(File inputFile, File outputFile, Map<String, String> methods,
}

static def addReplayModRemapper(def fixBuilder) {
fixBuilder.add("CL: com/replaymod/core/ReplayModBackend me/mcblueparrot/client/replaymod/SCReplayModBackend")
fixBuilder.add("CL: com/replaymod/core/ReplayModBackend me/mcblueparrot/client/mod/impl/replay/fix/SCReplayModBackend")
fixBuilder.add("CL: com/replaymod/core/SettingsRegistry " +
"me/mcblueparrot/client/replaymod/SCSettingsRegistry")
"me/mcblueparrot/client/mod/impl/replay/fix/SCSettingsRegistry")
fixBuilder.add("CL: com/replaymod/core/versions/scheduler/SchedulerImpl " +
"me/mcblueparrot/client/replaymod/SCScheduler")
"me/mcblueparrot/client/mod/impl/replay/fix/SCScheduler")
fixBuilder.add("CL: com/replaymod/core/utils/ModInfoGetter " +
"me/mcblueparrot/client/replaymod/SCModInfoGetter")
"me/mcblueparrot/client/mod/impl/replay/fix/SCModInfoGetter")
fixBuilder.add("CL: com/replaymod/lib/de/johni0702/minecraft/gui/utils/EventRegistrations " +
"me/mcblueparrot/client/replaymod/SCEventRegistrations")
"me/mcblueparrot/client/mod/impl/replay/fix/SCEventRegistrations")
fixBuilder.add("CL: com/replaymod/recording/ReplayModRecording " +
"me/mcblueparrot/client/replaymod/SCReplayModRecording")
"me/mcblueparrot/client/mod/impl/replay/fix/SCReplayModRecording")
fixBuilder.add("CL: com/replaymod/compat/ReplayModCompat " +
"me/mcblueparrot/client/replaymod/SCReplayModCompat")
"me/mcblueparrot/client/mod/impl/replay/fix/SCReplayModCompat")
fixBuilder.add("CL: net/minecraftforge/client/event/GuiScreenEvent\$ActionPerformedEvent\$Pre " +
"me/mcblueparrot/client/events/ActionPerformedEvent")
"me/mcblueparrot/client/event/impl/ActionPerformedEvent")
fixBuilder.add("CL: net/minecraftforge/fml/client/registry/ClientRegistry " +
"me/mcblueparrot/client/replaymod/SCClientRegistry")
"me/mcblueparrot/client/mod/impl/replay/fix/SCClientRegistry")
fixBuilder.add("CL: net/minecraftforge/fml/common/eventhandler/SubscribeEvent " +
"me/mcblueparrot/client/events/EventHandler")
"me/mcblueparrot/client/event/EventHandler")
fixBuilder.add("CL: net/minecraftforge/fml/common/gameevent/PlayerEvent\$ItemPickupEvent " +
"me/mcblueparrot/client/events/ItemPickupEvent")
"me/mcblueparrot/client/event/impl/ItemPickupEvent")
fixBuilder.add("CL: net/minecraftforge/event/entity/player/PlayerSleepInBedEvent " +
"me/mcblueparrot/client/events/PlayerSleepEvent")
"me/mcblueparrot/client/event/impl/PlayerSleepEvent")
fixBuilder.add("CL: net/minecraftforge/client/event/EntityViewRenderEvent\$CameraSetup " +
"me/mcblueparrot/client/events/CameraRotateEvent")
"me/mcblueparrot/client/event/impl/CameraRotateEvent")
fixBuilder.add("CL: net/minecraftforge/client/event/RenderGameOverlayEvent\$ElementType " +
"me/mcblueparrot/client/events/GameOverlayElement")
"me/mcblueparrot/client/event/impl/GameOverlayElement")
fixBuilder.add("CL: net/minecraftforge/client/event/RenderGameOverlayEvent\$Pre " +
"me/mcblueparrot/client/events/PreGameOverlayRenderEvent")
"me/mcblueparrot/client/event/impl/PreGameOverlayRenderEvent")
fixBuilder.add("CL: net/minecraftforge/client/event/RenderGameOverlayEvent\$Post " +
"me/mcblueparrot/client/events/PostGameOverlayRenderEvent")
"me/mcblueparrot/client/event/impl/PostGameOverlayRenderEvent")
fixBuilder.add("CL: net/minecraftforge/fml/common/gameevent/TickEvent\$RenderTickEvent " +
"me/mcblueparrot/client/events/RenderTickEvent")
"me/mcblueparrot/client/event/impl/RenderTickEvent")
fixBuilder.add("CL: net/minecraftforge/fml/common/network/internal/FMLProxyPacket " +
"me/mcblueparrot/client/util/Stub")
fixBuilder.add("CL: net/minecraftforge/client/event/GuiScreenEvent\$MouseInputEvent\$Pre " +
"me/mcblueparrot/client/events/PreGuiMouseInputEvent")
"me/mcblueparrot/client/event/impl/PreGuiMouseInputEvent")
fixBuilder.add("CL: net/minecraftforge/client/event/GuiScreenEvent\$KeyboardInputEvent\$Pre " +
"me/mcblueparrot/client/events/PreGuiKeyboardInputEvent")
"me/mcblueparrot/client/event/impl/PreGuiKeyboardInputEvent")
fixBuilder.add("CL: net/minecraftforge/fml/common/FMLCommonHandler " +
"me/mcblueparrot/client/replaymod/SCFMLCommonHandler")
"me/mcblueparrot/client/mod/impl/replay/fix/SCFMLCommonHandler")
fixBuilder.add("CL: net/minecraftforge/client/ForgeHooksClient " +
"me/mcblueparrot/client/replaymod/SCForgeHooksClient")
"me/mcblueparrot/client/mod/impl/replay/fix/SCForgeHooksClient")
fixBuilder.add("CL: com/replaymod/core/SettingsRegistry\$SettingKey " +
"me/mcblueparrot/client/replaymod/SCSettingsRegistry\$SettingKey")
"me/mcblueparrot/client/mod/impl/replay/fix/SCSettingsRegistry\$SettingKey")
}

class SeargeSniffer extends Remapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,135 +22,135 @@

public class CustomTweakerPlugin extends ClientTweaker {

@Override
protected void setupReobf(ReobfTaskFactory.ReobfTaskWrapper reobf) {
super.setupReobf(reobf);
reobf.setMappingType(ReobfMappingType.SEARGE);
}

// Hack to get around ForgeGradle using URL that is increasingly down/unavailable, due to 1.8 not being supported
// (which is fair enough, as it is surprisingly old)
/*
* Modified from ForgeGradle.
* Original License:
*
* A Gradle plugin for the creation of Minecraft mods and MinecraftForge plugins.
* Copyright (C) 2013 Minecraft Forge
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
@Override
protected String getWithEtag(String strUrl, File cache, File etagFile) {
try {
if(project.getGradle().getStartParameter().isOffline()) { // dont even try the internet
return Files.toString(cache, Charsets.UTF_8);
}

// dude, its been less than 1 minute since the last time..
if(cache.exists() && cache.lastModified() + 60000 >= System.currentTimeMillis()) {
return Files.toString(cache, Charsets.UTF_8);
}

String etag;
if(etagFile.exists()) {
etag = Files.toString(etagFile, Charsets.UTF_8);
}
else {
etagFile.getParentFile().mkdirs();
etag = "";
}

URL url = new URL(strUrl);

HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setInstanceFollowRedirects(true);
con.setRequestProperty("User-Agent", Constants.USER_AGENT);
con.setIfModifiedSince(cache.lastModified());

if(!Strings.isNullOrEmpty(etag)) {
con.setRequestProperty("If-None-Match", etag);
}

con.connect();

String out = null;
if(con.getResponseCode() == 304) {
// the existing file is good
Files.touch(cache); // touch it to update last-modified time, to wait another minute
out = Files.toString(cache, Charsets.UTF_8);
}
else if(con.getResponseCode() == 200) {
InputStream stream = con.getInputStream();
byte[] data = ByteStreams.toByteArray(stream);
Files.write(data, cache);
stream.close();

// write etag
etag = con.getHeaderField("ETag");
if(Strings.isNullOrEmpty(etag)) {
Files.touch(etagFile);
}
else {
Files.write(etag, etagFile, Charsets.UTF_8);
}

out = new String(data);
}
else {
project.getLogger().warn("Etag download for " + strUrl + " failed with code " + con.getResponseCode()
+ ". Mappings may be outdated.");

return fallbackGetWithEtag(strUrl);
}

con.disconnect();

return out;
}
catch(Exception e) {
e.printStackTrace();
}

if(cache.exists()) {
try {
return Files.toString(cache, Charsets.UTF_8);
}
catch(IOException e) {
Throwables.propagate(e);
}
}

try {
return fallbackGetWithEtag(strUrl);
}
catch(Exception error) {
throw new RuntimeException(error);
}
}

private String fallbackGetWithEtag(String strUrl) {
try {
if ("http://export.mcpbot.bspk.rs/versions.json".equals(strUrl)) {
// Sol Client - Use potentially older local version.
return Resources.toString(getClass().getResource("/McpMappings.json"), StandardCharsets.UTF_8);
}
}
catch(IOException error) {}

throw new RuntimeException("Unable to obtain url (" + strUrl + ") with etag!");
}
@Override
protected void setupReobf(ReobfTaskFactory.ReobfTaskWrapper reobf) {
super.setupReobf(reobf);
reobf.setMappingType(ReobfMappingType.SEARGE);
}

// Hack to get around ForgeGradle using URL that is increasingly down/unavailable, due to 1.8 not being supported
// (which is fair enough, as it is surprisingly old)
/*
* Modified from ForgeGradle.
* Original License:
*
* A Gradle plugin for the creation of Minecraft mods and MinecraftForge plugins.
* Copyright (C) 2013 Minecraft Forge
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
@Override
protected String getWithEtag(String strUrl, File cache, File etagFile) {
try {
if(project.getGradle().getStartParameter().isOffline()) { // dont even try the internet
return Files.toString(cache, Charsets.UTF_8);
}

// dude, its been less than 1 minute since the last time..
if(cache.exists() && cache.lastModified() + 60000 >= System.currentTimeMillis()) {
return Files.toString(cache, Charsets.UTF_8);
}

String etag;
if(etagFile.exists()) {
etag = Files.toString(etagFile, Charsets.UTF_8);
}
else {
etagFile.getParentFile().mkdirs();
etag = "";
}

URL url = new URL(strUrl);

HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setInstanceFollowRedirects(true);
con.setRequestProperty("User-Agent", Constants.USER_AGENT);
con.setIfModifiedSince(cache.lastModified());

if(!Strings.isNullOrEmpty(etag)) {
con.setRequestProperty("If-None-Match", etag);
}

con.connect();

String out = null;
if(con.getResponseCode() == 304) {
// the existing file is good
Files.touch(cache); // touch it to update last-modified time, to wait another minute
out = Files.toString(cache, Charsets.UTF_8);
}
else if(con.getResponseCode() == 200) {
InputStream stream = con.getInputStream();
byte[] data = ByteStreams.toByteArray(stream);
Files.write(data, cache);
stream.close();

// write etag
etag = con.getHeaderField("ETag");
if(Strings.isNullOrEmpty(etag)) {
Files.touch(etagFile);
}
else {
Files.write(etag, etagFile, Charsets.UTF_8);
}

out = new String(data);
}
else {
project.getLogger().warn("Etag download for " + strUrl + " failed with code " + con.getResponseCode()
+ ". Mappings may be outdated.");

return fallbackGetWithEtag(strUrl);
}

con.disconnect();

return out;
}
catch(Exception e) {
e.printStackTrace();
}

if(cache.exists()) {
try {
return Files.toString(cache, Charsets.UTF_8);
}
catch(IOException e) {
Throwables.propagate(e);
}
}

try {
return fallbackGetWithEtag(strUrl);
}
catch(Exception error) {
throw new RuntimeException(error);
}
}

private String fallbackGetWithEtag(String strUrl) {
try {
if ("http://export.mcpbot.bspk.rs/versions.json".equals(strUrl)) {
// Sol Client - Use potentially older local version.
return Resources.toString(getClass().getResource("/McpMappings.json"), StandardCharsets.UTF_8);
}
}
catch(IOException error) {}

throw new RuntimeException("Unable to obtain url (" + strUrl + ") with etag!");
}

}
Loading

0 comments on commit 340ae3b

Please sign in to comment.