mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Gently fail on new overworlds
This commit is contained in:
parent
09edc78bdc
commit
fbdb060e10
@ -263,6 +263,12 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
for (File j : dims.listFiles()) {
|
||||
if (j.getName().endsWith(".json")) {
|
||||
IrisDimension dim = data.getDimensionLoader().load(j.getName().split("\\Q.\\E")[0]);
|
||||
|
||||
if(dim == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Iris.verbose(" Checking Dimension " + dim.getLoadFile().getPath());
|
||||
if (dim.installDataPack(() -> data, dpacks)) {
|
||||
reboot = true;
|
||||
@ -358,6 +364,12 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
if (j.getName().endsWith(".json")) {
|
||||
IrisDimension dim = data.getDimensionLoader().load(j.getName().split("\\Q.\\E")[0]);
|
||||
|
||||
if(dim == null)
|
||||
{
|
||||
Iris.error("Failed to load " + j.getPath());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!verifyDataPackInstalled(dim)) {
|
||||
bad = true;
|
||||
}
|
||||
|
@ -103,6 +103,8 @@ public class IrisSettings {
|
||||
public boolean pluginMetrics = true;
|
||||
public boolean splashLogoStartup = true;
|
||||
public boolean autoStartDefaultStudio = false;
|
||||
public boolean useConsoleCustomColors = false;
|
||||
public boolean useCustomColorsIngame = true;
|
||||
public String forceMainWorld = "";
|
||||
public int spinh = -20;
|
||||
public int spins = 7;
|
||||
|
@ -441,19 +441,12 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
||||
{
|
||||
Iris.error("Failed to read " + typeToken.getRawType().getCanonicalName() + "... faking objects a little to load the file at least.");
|
||||
try {
|
||||
T o = (T) typeToken.getRawType().getConstructor().newInstance();
|
||||
return o;
|
||||
} catch (InstantiationException ex) {
|
||||
ex.printStackTrace();
|
||||
} catch (IllegalAccessException ex) {
|
||||
ex.printStackTrace();
|
||||
} catch (InvocationTargetException ex) {
|
||||
ex.printStackTrace();
|
||||
} catch (NoSuchMethodException ex) {
|
||||
ex.printStackTrace();
|
||||
return (T) typeToken.getRawType().getConstructor().newInstance();
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user