Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vanilla): PluginPackResources#getResources not working #3678

Merged
merged 3 commits into from May 8, 2022
Merged

fix(vanilla): PluginPackResources#getResources not working #3678

merged 3 commits into from May 8, 2022

Conversation

SettingDust
Copy link
Contributor

fix #3677
Dupe resolve of namespace
Filter files
Output always input path

.collect(Collectors.toList());
final Path namespaceDir = root.resolve(namespace);
return Files.walk(namespaceDir, depth)
.filter(Files::isRegularFile)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FilePackResources from Minecraft looks like below codes, so I filter files:

while(var3.hasMoreElements()) {
    ZipEntry var7 = var3.nextElement();
    if (!var7.isDirectory()) {
        String var8 = var7.getName();
        if (!var8.endsWith(".mcmeta") && var8.startsWith(var6)) {
            String var9 = var8.substring(var5.length());
            String[] var10 = var9.split("/");
            if (var10.length >= param3 + 1 && param4.test(var10[var10.length - 1])) {
                var4.add(new ResourceLocation(param1, var9));
            }
        }
    }
}

@SettingDust SettingDust changed the title fix: PluginPackResources#getResources not working fix(vanilla): PluginPackResources#getResources not working May 8, 2022
@dualspiral dualspiral merged commit f66e868 into SpongePowered:api-8 May 8, 2022
@SettingDust SettingDust deleted the fix/3677 branch May 9, 2022 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PluginPackResources#getResources not working
2 participants