Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
plugins {
id "java"
id "java"
}

allprojects {
apply plugin: "java"

repositories {
mavenCentral()
maven { url "https://jitpack.io/" }
maven { url "https://maven.fabricmc.net/" }
maven { url "https://mcphackers.org/libraries/" }
maven { url "https://maven.glass-launcher.net/releases" }
maven { url = "https://jitpack.io/" }
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://mcphackers.org/libraries/" }
maven { url = "https://maven.glass-launcher.net/releases" }
}

dependencies {
runtimeOnly sourceSets.test.output

// Required libraries
implementation "org.ow2.asm:asm:${project.asm_version}"
implementation "org.ow2.asm:asm-analysis:${project.asm_version}"
implementation "org.ow2.asm:asm-commons:${project.asm_version}"
implementation "org.ow2.asm:asm-tree:${project.asm_version}"
implementation "org.ow2.asm:asm-util:${project.asm_version}"
implementation libs.asm
implementation libs.asm.analysis
implementation libs.asm.commons
implementation libs.asm.tree
implementation libs.asm.util

implementation "org.mcphackers.rdi:rdi-nio:${project.rdi_version}"
implementation "org.mcphackers.rdi:rdi:${project.rdi_version}"
implementation libs.rdi.nio
implementation libs.rdi

implementation "io.github.lassebq:fernflower:${project.fernflower_version}"
implementation libs.fernflower

implementation "org.json:json:${project.json_version}"
implementation "com.github.MCPHackers:DiffPatch:${project.diffpatch_version}"
implementation "org.apache.commons:commons-lang3:${project.apache_version}"
implementation "net.fabricmc:mapping-io:${project.mapping_io_version}"
implementation libs.json
implementation libs.diffpatch
implementation libs.commons.lang3
implementation libs.mapping.io
}

tasks.withType(JavaCompile).configureEach {
Expand Down
5 changes: 3 additions & 2 deletions cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id "com.gradleup.shadow" version "8.3.1"
alias libs.plugins.shadow
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

dependencies {
implementation rootProject
implementation "org.fusesource.jansi:jansi:${project.jansi_version}"

implementation libs.jansi
}

application {
Expand Down
9 changes: 0 additions & 9 deletions gradle.properties

This file was deleted.

30 changes: 30 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[versions]
asm = '9.8'
commons-lang3 = '3.17.0'
diffpatch = 'cde1224'
fernflower = '1.0.0'
flatlaf = '3.6'
jansi = '2.4.1'
json = '20250107'
mapping-io = '0.7.1'
rdi = '1.1'
shadow-plugin = '8.3.1'

[libraries]
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
asm-analysis = { module = "org.ow2.asm:asm-analysis", version.ref = "asm" }
asm-commons = { module = "org.ow2.asm:asm-commons", version.ref = "asm" }
asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }
asm-util = { module = "org.ow2.asm:asm-util", version.ref = "asm" }
commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commons-lang3" }
diffpatch = { module = "com.github.MCPHackers:DiffPatch", version.ref = "diffpatch" }
fernflower = { module = "io.github.lassebq:fernflower", version.ref = "fernflower" }
flatlaf = { module = "com.formdev:flatlaf", version.ref = "flatlaf" }
jansi = { module = "org.fusesource.jansi:jansi", version.ref = "jansi" }
json = { module = "org.json:json", version.ref = "json" }
mapping-io = { module = "net.fabricmc:mapping-io", version.ref = "mapping-io" }
rdi = { module = "org.mcphackers.rdi:rdi", version.ref = "rdi" }
rdi-nio = { module = "org.mcphackers.rdi:rdi-nio", version.ref = "rdi" }

[plugins]
shadow = { id = "com.gradleup.shadow", version.ref = "shadow-plugin" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 2 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
6 changes: 3 additions & 3 deletions gui/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
plugins {
id "com.gradleup.shadow" version "8.3.1"
alias libs.plugins.shadow
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

dependencies {
implementation rootProject

implementation "com.formdev:flatlaf:${project.flatlaf_version}"
implementation libs.flatlaf
}

application {
Expand All @@ -29,5 +29,5 @@ tasks.named("shadowJar", ShadowJar) {
archiveBaseName.set("RetroMCP-GUI")
archiveClassifier.set("all")
setDestinationDirectory(rootProject.getLayout().getBuildDirectory().dir("libs"))
minimize()
minimize() // This breaks FlatLaf
}
2 changes: 1 addition & 1 deletion gui/src/main/java/org/mcphackers/mcp/main/MainGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class MainGUI extends MCP {
public static final String[] TABS = {"task.decompile", "task.recompile", "task.reobfuscate", "task.build", "options.running"};
public static final TaskParameter[][] TAB_PARAMETERS = {
{TaskParameter.PATCHES, TaskParameter.FERNFLOWER_OPTIONS, TaskParameter.IGNORED_PACKAGES, TaskParameter.OUTPUT_SRC, TaskParameter.DECOMPILE_RESOURCES, TaskParameter.GUESS_GENERICS, TaskParameter.STRIP_GENERICS},
{TaskParameter.SOURCE_VERSION, TaskParameter.TARGET_VERSION, TaskParameter.JAVA_HOME}, {TaskParameter.OBFUSCATION, TaskParameter.EXCLUDED_CLASSES},
{TaskParameter.SOURCE_VERSION, TaskParameter.TARGET_VERSION, TaskParameter.JAVA_HOME}, {TaskParameter.OBFUSCATION, TaskParameter.SRG_OBFUSCATION, TaskParameter.EXCLUDED_CLASSES},
{TaskParameter.FULL_BUILD}, {TaskParameter.RUN_BUILD, TaskParameter.RUN_ARGS, TaskParameter.GAME_ARGS}
};
public Theme theme = Theme.THEMES_MAP.get(UIManager.getCrossPlatformLookAndFeelClassName());
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/org/mcphackers/mcp/tasks/TaskReobfuscate.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.mcphackers.mcp.MCPPaths.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -118,8 +117,11 @@ private Mappings getMappings(ClassStorage storage, Side side) throws IOException
return new Mappings();
}
final boolean enableObfuscation = mcp.getOptions().getBooleanParameter(TaskParameter.OBFUSCATION);
boolean joined = MappingUtil.readNamespaces(mappingsPath).contains("official");
Mappings mappings = MappingsIO.read(mappingsPath, "named", joined ? "official" : side.name);
final boolean srgObfuscation = mcp.getOptions().getBooleanParameter(TaskParameter.SRG_OBFUSCATION);
List<String> nss = MappingUtil.readNamespaces(mappingsPath);
boolean joined = srgObfuscation ? nss.contains("searge") : nss.contains("official");
Mappings mappings = MappingsIO.read(mappingsPath, "named",
joined ? (srgObfuscation ? "searge" : "official") : side.name);
modifyClassMappings(mappings, storage.getAllClasses(), enableObfuscation);
return mappings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum TaskParameter {
IGNORED_PACKAGES("ignore", String[].class, new String[]{"paulscode", "com/jcraft", "de/jarnbjo", "isom"}),
FERNFLOWER_OPTIONS("ff_options", String.class, getDefaultFFOptions()),
OBFUSCATION("obf", Boolean.class, false),
SRG_OBFUSCATION("srgobf", Boolean.class, false),
FULL_BUILD("fullbuild", Boolean.class, false),
RUN_BUILD("runbuild", Boolean.class, false),
RUN_ARGS("runargs", String[].class, new String[]{"-Xms1024M", "-Xmx1024M"}),
Expand All @@ -41,7 +42,7 @@ public enum TaskParameter {
public final Class<?> type;
public final Object defaultValue;

TaskParameter(String name, Class<?> c, Object value) {
<T> TaskParameter(String name, Class<T> c, T value) {
TaskParameterMap.nameToParamMap.put(name, this);
this.name = name;
this.type = c;
Expand All @@ -64,7 +65,7 @@ private static String getDefaultFFOptions() {
ffOptions.put(IFernflowerPreferences.OVERRIDE_ANNOTATION, "0");
ffOptions.put(IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES, "1");
ffOptions.put(IFernflowerPreferences.INDENT_STRING, "\t");
ffOptions.remove("ban");
ffOptions.remove(IFernflowerPreferences.BANNER);
return ffOptions.toString();
}
}
24 changes: 20 additions & 4 deletions src/main/resources/lang/de_DE.lang
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mcp.confirmUpdateMD5 = Sind Sie sicher, dass Sie die ursprünglichen Hashes neu
mcp.confirmAction = Aktion bestätigen
mcp.confirmDecompile = Sind Sie sicher, dass Sie die Quellen löschen und erneut dekompilieren wollen?
mcp.confirmSetup = Sind Sie sicher, dass Sie das Setup für die ausgewählte Version ausführen wollen?
mcp.confirmCleanup = Sind Sie sicher, dass Sie alle Quelldateien löschen und die derzeit aktive Version leeren wollen?
mcp.askSourceBackup = Ein Backup der Quelldateien machen?
mcp.incompatiblePlugin = Inkompatibles Plugin gefunden:
mcp.versionList.currentVersion = Aktuelle Version:
Expand All @@ -26,6 +27,7 @@ mcp.side = Seite
mcp.startClient = Client starten
mcp.startServer = Server starten
mcp.console = Konsolenausgabe
mcp.clearConsole = Konsolenausgabe leeren

side.client = Client
side.server = Server
Expand All @@ -34,13 +36,19 @@ side.any = Beliebig

options = Optionen
options.language = Sprache
options.theme = Thema
options.enterValue = Einen Wert eingeben
options.enterValues = Eine Reihe von Werten eingeben
options.enterValues.info = (Werte mit Komma trennen)
options.running = Laufend
options.resetDefaults = Auf Standardwerte zurücksetzen
options.invalidValue = Ungültiger Wert!

options.theme.swing = Swing
options.theme.flatlightlaf = FlatLightLaf
options.theme.flatdarklaf = FlatDarkLaf
options.theme.flatdarculalaf = FlatDarculaLaf

task.help = Hilfe
task.help.desc = Zeigt die Verwendung des Befehls an
task.setup = Einrichtung
Expand All @@ -66,6 +74,10 @@ task.createpatch = Patch erstellen
task.createpatch.desc = Erzeugt einen Patch auf der Grundlage Ihrer Änderungen am Quelltext
task.backupsrc = Quelldateien sichern
task.backupsrc.desc = Packe Quelldateien in eine zip
task.applypatch = Patch anwenden
task.applypatch.desc = Patch aus dem Patchordner anwenden
task.updatemcp = RetroMCP aktualisieren
task.updatemcp.desc = Nach Aktualisierungen suchen
task.noDesc = Keine Beschreibung angegeben

task.stage.idle = Leerlauf
Expand Down Expand Up @@ -94,18 +106,22 @@ task.param.side = Seite einstellen
task.param.src = Quelle bereinigen
task.param.patch = Patches anwenden
task.param.ignore = Ignorierte Pakete einstellen
task.param.ind = Einrückungszeichenfolge setzen
task.param.obf = Mod obfuskieren
task.param.ff_options = Fernflower-Einstellungen setzen
task.param.obf = Modklassen obfuskieren
task.param.srgobf = Mit Searge-Namen obfuskieren
task.param.excludedclasses = Ausgeschlossene Klassen
task.param.fullbuild = Vollständig bauen
task.param.runbuild = Build ausführen
task.param.runargs = Argumente ausführen
task.param.runargs = JVM-Argumente
task.param.gameargs = Spiel-Parameter
task.param.setup = Version einrichten
task.param.source = Eine bestimmte Quellversion festlegen
task.param.target = Eine bestimmte Zielversion festlegen
task.param.javahome = JAVA_HOME für die Kompilierung festlegen
task.param.override = @Override hinzufügen
task.param.resources = Ressourcen behalten
task.param.generics = Generics erraten
task.param.stripgenerics = Generics entfernen
task.param.outputsrc = Quelldateien ausgeben

tasks.success = Erfolgreich beendet!
tasks.warning = Mit Warnungen beendet!
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ task.param.patch = Apply patches
task.param.ignore = Set ignored packages
task.param.ff_options = Set Fernflower options
task.param.obf = Obfuscate mod classes
task.param.srgobf = Obfuscate using Searge names
task.param.excludedclasses = Excluded classes
task.param.fullbuild = Full build
task.param.runbuild = Run build
Expand Down