mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 03:05:28 +01:00
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:
commit
322c370bbc
@ -1025,9 +1025,22 @@ public class DynmapPlugin
|
|||||||
public File getModContainerFile(String name) {
|
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) {
|
if (mfi != null) {
|
||||||
|
try {
|
||||||
File f = mfi.getFile().getFilePath().toFile();
|
File f = mfi.getFile().getFilePath().toFile();
|
||||||
return f;
|
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
|
@Override
|
||||||
|
@ -1025,9 +1025,22 @@ public class DynmapPlugin
|
|||||||
public File getModContainerFile(String name) {
|
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) {
|
if (mfi != null) {
|
||||||
|
try {
|
||||||
File f = mfi.getFile().getFilePath().toFile();
|
File f = mfi.getFile().getFilePath().toFile();
|
||||||
return f;
|
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
|
@Override
|
||||||
|
@ -1027,9 +1027,22 @@ public class DynmapPlugin
|
|||||||
public File getModContainerFile(String name) {
|
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) {
|
if (mfi != null) {
|
||||||
|
try {
|
||||||
File f = mfi.getFile().getFilePath().toFile();
|
File f = mfi.getFile().getFilePath().toFile();
|
||||||
return f;
|
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
|
@Override
|
||||||
|
@ -1025,9 +1025,22 @@ public class DynmapPlugin
|
|||||||
public File getModContainerFile(String name) {
|
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) {
|
if (mfi != null) {
|
||||||
|
try {
|
||||||
File f = mfi.getFile().getFilePath().toFile();
|
File f = mfi.getFile().getFilePath().toFile();
|
||||||
return f;
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user