Skip to content

Commit

Permalink
A couple of minor bugfixes:
Browse files Browse the repository at this point in the history
- Fixed access transformers only being applied to minecraft, and not whatever the current game is.
- Fixed BuiltinModOption attempting to close the default file system.
  • Loading branch information
AlexIIL committed Apr 12, 2024
1 parent 52e0ea1 commit bc70813
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ group = org.quiltmc
description = The mod loading component of Quilt
url = https://github.com/quiltmc/quilt-loader
# Don't forget to change this in QuiltLoaderImpl as well
quilt_loader = 0.25.0-beta.3
quilt_loader = 0.25.0-beta.4

# Fabric & Quilt Libraries
asm = 9.6
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public final class QuiltLoaderImpl {

public static final int ASM_VERSION = Opcodes.ASM9;

public static final String VERSION = "0.25.0-beta.3";
public static final String VERSION = "0.25.0-beta.4";
public static final String MOD_ID = "quilt_loader";
public static final String DEFAULT_MODS_DIR = "mods";
public static final String DEFAULT_CACHE_DIR = ".cache";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.quiltmc.loader.impl.plugin.quilt;

import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;

import org.quiltmc.loader.api.gui.QuiltLoaderIcon;
Expand Down Expand Up @@ -52,7 +53,7 @@ protected String nameOfType() {

@Override
public ModContainerExt convertToMod(Path transformedResourceRoot) {
if (!transformedResourceRoot.equals(resourceRoot)) {
if (!transformedResourceRoot.equals(resourceRoot) && resourceRoot.getFileSystem() != FileSystems.getDefault()) {
try {
resourceRoot.getFileSystem().close();
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
@QuiltLoaderInternal(QuiltLoaderInternalType.NEW_INTERNAL)
final class QuiltTransformer {
public static byte @Nullable [] transform(boolean isDevelopment, EnvType envType, TransformCache cache, AccessWidener accessWidener, String name, ModLoadOption mod, byte[] bytes) {
boolean isMinecraftClass = mod.id().equals("minecraft");
boolean transformAccess = isMinecraftClass && QuiltLauncherBase.getLauncher().getMappingConfiguration().requiresPackageAccessHack();
boolean strip = !isMinecraftClass || isDevelopment;
boolean applyAccessWidener = isMinecraftClass && accessWidener.getTargets().contains(name);
boolean isGameClass = mod.id().equals(QuiltLoaderImpl.INSTANCE.getGameProvider().getGameId());
boolean transformAccess = isGameClass && QuiltLauncherBase.getLauncher().getMappingConfiguration().requiresPackageAccessHack();
boolean strip = !isGameClass || isDevelopment;
boolean applyAccessWidener = isGameClass && accessWidener.getTargets().contains(name);

if (!transformAccess && !strip && !applyAccessWidener) {
return bytes;
Expand Down

0 comments on commit bc70813

Please sign in to comment.