Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fc0ef44
normalize gamedir
Player3324 May 28, 2022
e29a925
Refactor system property queries
Player3324 Jun 3, 2022
2d939c7
Update Mixin
modmuss50 Jul 1, 2025
c47fb15
Move builtin transform selection to game provider (#1056)
Player3324 Jul 2, 2025
f69cf4c
Fix code source URL converstion for class names containing spaces
Player3324 Jun 17, 2025
dd90651
Rework handling of isDevelopment and mapping namespaces
Player3324 Jun 3, 2022
9d1bbd9
Add fabric.mappingPath system property, refactor mapping reading
Player3324 Jul 2, 2025
456cb85
Expose the raw game version
Player3324 Jul 4, 2025
41de1d9
Add fabric.gameLibraries to explicitly specify game libraries instead…
Player3324 Jun 28, 2025
a5fdbc3
Use correct repository in mod metadata
Gamebuster19901 Jul 16, 2025
e55b0fb
implement locating pre-classic versions of minecraft
SpaceWalkerRS Apr 19, 2025
ad1a33b
Fix and improve version normalization for old Minecraft versions (#1041)
SpaceWalkerRS Jul 27, 2025
c0a9caa
Add field write stripping with @Environment (#1047)
Player3324 Jul 27, 2025
44b6253
Update Mixin to 0.16.3+mixin.0.8.7
Player3324 Jul 27, 2025
09ff522
Update Mixin Extras to 0.5.0
modmuss50 Jul 27, 2025
71e53c9
Support 1.21.9 snapshot cycle. (#1069)
DrexHD Jul 29, 2025
c8cd016
Bump version: 0.17.0
modmuss50 Jul 29, 2025
a5c26a4
Update Tiny Remapper to 0.11.2
Player3324 Jul 30, 2025
5b58d4a
Visually losslessly optimize compression of PNG resources
Luracasmus Aug 2, 2025
938f343
Fix regressions in version normalization since #1041 (#1072)
SpaceWalkerRS Aug 5, 2025
29ca405
Implement on-demand native library extraction
Player3324 Jul 29, 2025
59d318e
Normalization regression testing (#1073)
dexman545 Aug 5, 2025
61641d8
Bump version to 0.17.1
Player3324 Aug 5, 2025
0b5f84e
Ignore invalid library paths with a warning
Player3324 Aug 8, 2025
8fc5065
Bump version to 0.17.2
Player3324 Aug 8, 2025
da13225
Merge branch 'master' into remoteMaster
Gamebuster19901 Aug 12, 2025
4917181
Fix checkstyle and compilation errors
Gamebuster19901 Aug 12, 2025
b1b7d93
Version 0.17.2+WilderForge.0.2.1
Gamebuster19901 Aug 12, 2025
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ dependencies {
// impl dependencies
include 'org.ow2.sat4j:org.ow2.sat4j.core:2.3.6'
include 'org.ow2.sat4j:org.ow2.sat4j.pb:2.3.6'
include "net.fabricmc:tiny-remapper:0.11.1"
include "net.fabricmc:tiny-remapper:0.11.2"
include "net.fabricmc:access-widener:2.1.0"
include "net.fabricmc:mapping-io:0.7.1"

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ description = The mod loading component of Fabric
url = https://github.com/FabricMC/fabric-loader

asm_version = 9.8
mixin_version = 0.15.5+mixin.0.8.7
mixin_extras_version = 0.4.1
mixin_version = 0.16.3+mixin.0.8.7
mixin_extras_version = 0.5.0
7 changes: 6 additions & 1 deletion minecraft/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ dependencies {
transitive = false
}
//implementation 'net.sf.jopt-simple:jopt-simple:5.0.3'

// Unit testing for semver
implementation project(":").sourceSets.main.output
testImplementation('org.junit.jupiter:junit-jupiter:5.9.2')
testRuntimeOnly('org.junit.platform:junit-platform-launcher')
}

sourceSets {
Expand All @@ -39,7 +44,7 @@ jar {
}

test {
enabled = false
useJUnitPlatform()
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import net.fabricmc.loader.impl.game.LibClassifier.LibraryType;

enum McLibrary implements LibraryType {
MC_CLIENT(EnvType.CLIENT, "net/minecraft/client/main/Main.class", "net/minecraft/client/MinecraftApplet.class", "com/mojang/minecraft/MinecraftApplet.class"),
MC_CLIENT(EnvType.CLIENT, "net/minecraft/client/main/Main.class", "net/minecraft/client/MinecraftApplet.class", "com/mojang/minecraft/MinecraftApplet.class", "com/mojang/rubydung/RubyDung.class"),
MC_SERVER(EnvType.SERVER, "net/minecraft/server/Main.class", "net/minecraft/server/MinecraftServer.class", "com/mojang/minecraft/server/MinecraftServer.class"),
MC_COMMON("net/minecraft/server/MinecraftServer.class"),
MC_ASSETS_ROOT("assets/.mcassetsroot"),
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -150,18 +151,36 @@ public Path getLaunchDirectory() {
}

@Override
public boolean isObfuscated() {
return true; // generally yes...
public boolean requiresUrlClassLoader() {
return hasModLoader;
}

@Override
public boolean requiresUrlClassLoader() {
return hasModLoader;
public Set<BuiltinTransform> getBuiltinTransforms(String className) {
boolean isMinecraftClass = className.startsWith("net.minecraft.") // unobf classes in indev and later
|| className.startsWith("com.mojang.minecraft.") // unobf classes in classic
|| className.startsWith("com.mojang.rubydung.") // unobf classes in pre-classic
|| className.startsWith("com.mojang.blaze3d.") // unobf blaze3d classes
|| className.indexOf('.') < 0; // obf classes

if (isMinecraftClass) {
if (FabricLoaderImpl.INSTANCE.isDevelopmentEnvironment()) { // combined client+server jar, strip back down to production equivalent
return TRANSFORM_WIDENALL_STRIPENV_CLASSTWEAKS;
} else { // environment specific jar, inherently env stripped
return TRANSFORM_WIDENALL_CLASSTWEAKS;
}
} else { // mod class TODO: exclude game libs
return TRANSFORM_STRIPENV;
}
}

private static final Set<BuiltinTransform> TRANSFORM_WIDENALL_STRIPENV_CLASSTWEAKS = EnumSet.of(BuiltinTransform.WIDEN_ALL_PACKAGE_ACCESS, BuiltinTransform.STRIP_ENVIRONMENT, BuiltinTransform.CLASS_TWEAKS);
private static final Set<BuiltinTransform> TRANSFORM_WIDENALL_CLASSTWEAKS = EnumSet.of(BuiltinTransform.WIDEN_ALL_PACKAGE_ACCESS, BuiltinTransform.CLASS_TWEAKS);
private static final Set<BuiltinTransform> TRANSFORM_STRIPENV = EnumSet.of(BuiltinTransform.STRIP_ENVIRONMENT);

@Override
public boolean isEnabled() {
return System.getProperty(SystemProperties.SKIP_MC_PROVIDER) == null;
return !SystemProperties.isSet(SystemProperties.SKIP_MC_PROVIDER);
}

@Override
Expand Down Expand Up @@ -296,7 +315,22 @@ private static Path getLaunchDirectory(Arguments argMap) {
public void initialize(FabricLauncher launcher) {
launcher.setValidParentClassPath(validParentClassPath);

if (isObfuscated()) {
String gameNs = System.getProperty(SystemProperties.GAME_MAPPING_NAMESPACE);

if (gameNs == null) {
List<String> mappingNamespaces;

if (launcher.isDevelopment()) {
gameNs = MappingConfiguration.NAMED_NAMESPACE;
} else if ((mappingNamespaces = launcher.getMappingConfiguration().getNamespaces()) == null
|| mappingNamespaces.contains(MappingConfiguration.OFFICIAL_NAMESPACE)) {
gameNs = MappingConfiguration.OFFICIAL_NAMESPACE;
} else {
gameNs = envType == EnvType.CLIENT ? MappingConfiguration.CLIENT_OFFICIAL_NAMESPACE : MappingConfiguration.SERVER_OFFICIAL_NAMESPACE;
}
}

if (!gameNs.equals(launcher.getMappingConfiguration().getRuntimeNamespace())) { // game is obfuscated / in another namespace -> remap
Map<String, Path> obfJars = new HashMap<>(3);
String[] names = new String[gameJars.size()];

Expand All @@ -319,19 +353,11 @@ public void initialize(FabricLauncher launcher) {
obfJars.put("realms", realmsJar);
}

String sourceNamespace = "official";

MappingConfiguration mappingConfig = launcher.getMappingConfiguration();
List<String> mappingNamespaces = mappingConfig.getNamespaces();

if (mappingNamespaces != null && !mappingNamespaces.contains(sourceNamespace)) {
sourceNamespace = envType == EnvType.CLIENT ? "clientOfficial" : "serverOfficial";
}

obfJars = GameProviderHelper.deobfuscate(obfJars,
gameNs,
getGameId(), getNormalizedGameVersion(),
getLaunchDirectory(),
launcher, sourceNamespace);
launcher);

for (int i = 0; i < gameJars.size(); i++) {
Path newJar = obfJars.get(names[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ public void launch(String[] args) {

File instance = new File(arguments.getOrDefault("gameDir", "."));

if (System.getProperty("minecraft.applet.TargetDirectory") == null) {
String targetDir = System.getProperty("minecraft.applet.TargetDirectory");

if (targetDir == null) {
System.setProperty("minecraft.applet.TargetDirectory", instance.toString());
} else {
instance = new File(System.getProperty("minecraft.applet.TargetDirectory"));
instance = new File(targetDir);
}

// 1.3 ~ 1.5 FML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public abstract class FabricTweaker extends FabricLauncherBase implements ITweak
protected Arguments arguments;
private LaunchClassLoader launchClassLoader;
private final List<Path> classPath = new ArrayList<>();
private boolean isDevelopment;

@SuppressWarnings("unchecked")
private final boolean isPrimaryTweaker = ((List<ITweaker>) Launch.blackboard.get("Tweaks")).isEmpty();
Expand All @@ -74,12 +73,6 @@ public String getEntrypoint() {
return getLaunchTarget();
}

@Override
public String getTargetNamespace() {
// TODO: Won't work outside of Yarn
return isDevelopment ? "named" : "intermediary";
}

@Override
public void acceptOptions(List<String> localArgs, File gameDir, File assetsDir, String profile) {
arguments = new Arguments();
Expand All @@ -96,8 +89,7 @@ public void acceptOptions(List<String> localArgs, File gameDir, File assetsDir,

@Override
public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
isDevelopment = Boolean.parseBoolean(System.getProperty(SystemProperties.DEVELOPMENT, "false"));
Launch.blackboard.put(SystemProperties.DEVELOPMENT, isDevelopment);
Launch.blackboard.put(SystemProperties.DEVELOPMENT, IS_DEVELOPMENT);
setProperties(Launch.blackboard);

this.launchClassLoader = launchClassLoader;
Expand Down Expand Up @@ -141,10 +133,9 @@ private void init() {

arguments = null;

provider.initialize(this);

FabricLoaderImpl loader = FabricLoaderImpl.INSTANCE;
loader.setGameProvider(provider);
provider.initialize(this);
loader.load();
loader.freeze();

Expand Down Expand Up @@ -295,9 +286,4 @@ private byte[] toByteArray(InputStream inputStream) throws IOException {

return outputStream.toByteArray();
}

@Override
public boolean isDevelopment() {
return isDevelopment;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package net.fabricmc.loader.impl.game.minecraft.patch;

import static net.fabricmc.loader.impl.launch.MappingConfiguration.INTERMEDIARY_NAMESPACE;

import java.util.ListIterator;
import java.util.function.Consumer;
import java.util.function.Function;
Expand Down Expand Up @@ -55,9 +57,9 @@ public void process(FabricLauncher launcher, Function<String, ClassNode> classSo
String className = MORE_OPTIONS_DIALOG_CLASS_NAME;

// Only remap the classname when needed to prevent loading the mappings when not required in prod.
if (!launcher.getMappingConfiguration().getTargetNamespace().equals("intermediary")
&& FabricLoader.getInstance().getMappingResolver().getNamespaces().contains("intermediary")) {
className = FabricLoader.getInstance().getMappingResolver().mapClassName("intermediary", MORE_OPTIONS_DIALOG_CLASS_NAME);
if (!launcher.getMappingConfiguration().getRuntimeNamespace().equals(INTERMEDIARY_NAMESPACE)
&& FabricLoader.getInstance().getMappingResolver().getNamespaces().contains(INTERMEDIARY_NAMESPACE)) {
className = FabricLoader.getInstance().getMappingResolver().mapClassName(INTERMEDIARY_NAMESPACE, MORE_OPTIONS_DIALOG_CLASS_NAME);
}

final ClassNode classNode = classSource.apply(className);
Expand Down
Loading