Skip to content

Commit

Permalink
Bump ASM and fix providers with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Apr 20, 2024
1 parent de28766 commit b377005
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {

configurations.all {
outgoing {
capability("net.minecraftforge:$project.name:$version") // For sub modules, they require the exact casing of the name
capability("net.minecraftforge:securemodules:$version")
capability("cpw.mods:securejarhandler:$version")
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
dependencyResolutionManagement {
versionCatalogs {
libs {
version('asm', '9.6')
version('asm', '9.7')
library('asm', 'org.ow2.asm', 'asm' ).versionRef('asm')
library('asm-tree', 'org.ow2.asm', 'asm-tree' ).versionRef('asm')
library('asm-commons', 'org.ow2.asm', 'asm-commons').versionRef('asm')
Expand Down
22 changes: 17 additions & 5 deletions src/main/java/cpw/mods/jarhandling/impl/Jar.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,23 @@ private List<Provider> gatherProviders(BiPredicate<String, String> filter) {
public static Provider getProvider(Path path, BiPredicate<String, String> filter) {
var sname = path.getFileName().toString();
try {
var entries = Files.readAllLines(path).stream()
.map(String::trim)
.filter(l -> l.length() > 0 && !l.startsWith("#"))
.filter(p -> filter == null || filter.test(p.replace('.', '/'), ""))
.toList();
var entries = new ArrayList<String>();
for (var line : Files.readAllLines(path)) {
int idx = line.indexOf('#');
if (idx != -1)
line = line.substring(0, idx);
line = line.trim();

if (line.isEmpty())
continue;

if (filter != null && !filter.test(line.replace('.', '/'), ""))
continue;

entries.add(line);

}

return new Provider(sname, entries);
} catch (IOException e) {
return sneak(e);
Expand Down

0 comments on commit b377005

Please sign in to comment.