Merge pull request #624 from buepas/master

Fix issue related to launch-wrapping
This commit is contained in:
libraryaddict 2021-10-07 13:14:44 +13:00 committed by GitHub
commit 27bff9e613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -96,8 +96,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<asm.version>9.0</asm.version>
<lombok.version>1.18.16</lombok.version>
<protocollib.version>4.7.0-SNAPSHOT</protocollib.version>
<lombok.version>1.18.20</lombok.version>
<protocollib.version>4.7.0</protocollib.version>
<spigot.version>[1.17,]</spigot.version>
<junit.version>4.13.1</junit.version>
<paper-api.version>[1.16,]</paper-api.version>

View File

@ -687,7 +687,8 @@ public class DisguiseConfig {
DisguiseUtilities.getLogger().warning("Cannot parse '" + config.getString("UpdatesBranch") + "' to a valid option for UpdatesBranch");
}
PermissionDefault commandVisibility = PermissionDefault.getByName(config.getString("Permissions.SeeCommands"));
String seeCommands = config.getString("Permissions.SeeCommands");
PermissionDefault commandVisibility = seeCommands == null ? null : PermissionDefault.getByName(seeCommands);
if (commandVisibility == null) {
DisguiseUtilities.getLogger()

View File

@ -51,19 +51,23 @@ public class ClassGetter {
// Get a File object for the package
CodeSource src = runFrom.getProtectionDomain().getCodeSource();
if (src != null) {
URL resource = src.getLocation();
if (resource.getPath().toLowerCase(Locale.ENGLISH).endsWith(".jar")) {
boolean isInsideJar = resource.getPath().toLowerCase(Locale.ENGLISH).contains(".jar!") && resource.getPath().toLowerCase(Locale.ENGLISH).endsWith(".class");
if (resource.getPath().toLowerCase(Locale.ENGLISH).endsWith(".jar") || isInsideJar) {
processJarfile(resource, pkgname, classes);
} else {
for (File f : new File(resource.getPath() + "/" + pkgname.replace(".", "/")).listFiles()) {
if (f.getName().contains("$")) {
continue;
}
File[] baseFileList = new File(resource.getPath() + "/" + pkgname.replace(".", "/")).listFiles();
if (baseFileList != null) {
for (File f : baseFileList){
if (f.getName().contains("$")) {
continue;
}
classes.add(pkgname + "/" + f.getName());
classes.add(pkgname + "/" + f.getName());
}
} else {
System.out.println("File not found for: " + resource.getPath() + "/" + pkgname.replace(".", "/"));
}
}
}