Merge pull request #3915 from JurgenKuyper/JarInJarFix

implemented catch to prevent server crash when jar in jar methods are used
This commit is contained in:
mikeprimm 2023-01-25 09:10:56 -06:00 committed by GitHub
commit 322c370bbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 16 deletions

View File

@ -1023,12 +1023,25 @@ public class DynmapPlugin
}
@Override
public File getModContainerFile(String name) {
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
if (mfi != null) {
File f = mfi.getFile().getFilePath().toFile();
return f;
try {
File f = mfi.getFile().getFilePath().toFile();
return f;
}
catch (UnsupportedOperationException ex) {
//TODO Implement proper jar in jar method for fetching data
/*
Log.info("Searching for: " + name);
for (IModInfo e: ModList.get().getMods()) {
Log.info("in: " + e.getModId().toString());
Log.info("resource: "+ ModList.get().getModFileById(e.getModId()).getFile().findResource(String.valueOf(mfi.getFile().getFilePath()))); //requires forge 1.18.2-40.1.60+ (update build.gradle)
}
*/
Log.warning("jar in jar method found, skipping: " + ex.getMessage());
}
}
return null;
return null;
}
@Override
public List<String> getModList() {

View File

@ -1023,12 +1023,25 @@ public class DynmapPlugin
}
@Override
public File getModContainerFile(String name) {
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
if (mfi != null) {
File f = mfi.getFile().getFilePath().toFile();
return f;
try {
File f = mfi.getFile().getFilePath().toFile();
return f;
}
catch (UnsupportedOperationException ex) {
//TODO Implement proper jar in jar method for fetching data
/*
Log.info("Searching for: " + name);
for (IModInfo e: ModList.get().getMods()) {
Log.info("in: " + e.getModId().toString());
Log.info("resource: "+ ModList.get().getModFileById(e.getModId()).getFile().findResource(String.valueOf(mfi.getFile().getFilePath())));
}
*/
Log.warning("jar in jar method found, skipping: " + ex.getMessage());
}
}
return null;
return null;
}
@Override
public List<String> getModList() {

View File

@ -1025,12 +1025,25 @@ public class DynmapPlugin
}
@Override
public File getModContainerFile(String name) {
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
if (mfi != null) {
File f = mfi.getFile().getFilePath().toFile();
return f;
try {
File f = mfi.getFile().getFilePath().toFile();
return f;
}
catch (UnsupportedOperationException ex) {
//TODO Implement proper jar in jar method for fetching data
/*
Log.info("Searching for: " + name);
for (IModInfo e: ModList.get().getMods()) {
Log.info("in: " + e.getModId().toString());
Log.info("resource: "+ ModList.get().getModFileById(e.getModId()).getFile().findResource(String.valueOf(mfi.getFile().getFilePath())));
}
*/
Log.warning("jar in jar method found, skipping: " + ex.getMessage());
}
}
return null;
return null;
}
@Override
public List<String> getModList() {

View File

@ -1023,12 +1023,25 @@ public class DynmapPlugin
}
@Override
public File getModContainerFile(String name) {
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup
if (mfi != null) {
File f = mfi.getFile().getFilePath().toFile();
return f;
try {
File f = mfi.getFile().getFilePath().toFile();
return f;
}
catch (UnsupportedOperationException ex) {
//TODO Implement proper jar in jar method for fetching data
/*
Log.info("Searching for: " + name);
for (IModInfo e: ModList.get().getMods()) {
Log.info("in: " + e.getModId().toString());
Log.info("resource: "+ ModList.get().getModFileById(e.getModId()).getFile().findResource(String.valueOf(mfi.getFile().getFilePath())));
}
*/
Log.warning("jar in jar method found, skipping: " + ex.getMessage());
}
}
return null;
return null;
}
@Override
public List<String> getModList() {