Normalize resource paths on 1.18 as well

Seems the fix from 1.16 was accidentally not ported
This commit is contained in:
embeddedt 2023-04-01 12:05:28 -04:00
parent b2a8b7dc97
commit d5d06a3452
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -7,6 +7,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
import net.minecraftforge.resource.PathResourcePack;
import org.embeddedt.modernfix.ModernFix;
import org.embeddedt.modernfix.util.FileUtil;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@ -118,7 +119,7 @@ public abstract class PathResourcePackMixin {
@Inject(method = "hasResource(Ljava/lang/String;)Z", at = @At(value = "HEAD"), cancellable = true)
private void useCacheForExistence(String path, CallbackInfoReturnable<Boolean> cir) {
this.generateResourceCache();
cir.setReturnValue(this.containedPaths.contains(path));
cir.setReturnValue(this.containedPaths.contains(FileUtil.normalize(path)));
}
/**