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()) {
|
for (File j : dims.listFiles()) {
|
||||||
if (j.getName().endsWith(".json")) {
|
if (j.getName().endsWith(".json")) {
|
||||||
IrisDimension dim = data.getDimensionLoader().load(j.getName().split("\\Q.\\E")[0]);
|
IrisDimension dim = data.getDimensionLoader().load(j.getName().split("\\Q.\\E")[0]);
|
||||||
|
|
||||||
|
if(dim == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Iris.verbose(" Checking Dimension " + dim.getLoadFile().getPath());
|
Iris.verbose(" Checking Dimension " + dim.getLoadFile().getPath());
|
||||||
if (dim.installDataPack(() -> data, dpacks)) {
|
if (dim.installDataPack(() -> data, dpacks)) {
|
||||||
reboot = true;
|
reboot = true;
|
||||||
@ -358,6 +364,12 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
if (j.getName().endsWith(".json")) {
|
if (j.getName().endsWith(".json")) {
|
||||||
IrisDimension dim = data.getDimensionLoader().load(j.getName().split("\\Q.\\E")[0]);
|
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)) {
|
if (!verifyDataPackInstalled(dim)) {
|
||||||
bad = true;
|
bad = true;
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,8 @@ public class IrisSettings {
|
|||||||
public boolean pluginMetrics = true;
|
public boolean pluginMetrics = true;
|
||||||
public boolean splashLogoStartup = true;
|
public boolean splashLogoStartup = true;
|
||||||
public boolean autoStartDefaultStudio = false;
|
public boolean autoStartDefaultStudio = false;
|
||||||
|
public boolean useConsoleCustomColors = false;
|
||||||
|
public boolean useCustomColorsIngame = true;
|
||||||
public String forceMainWorld = "";
|
public String forceMainWorld = "";
|
||||||
public int spinh = -20;
|
public int spinh = -20;
|
||||||
public int spins = 7;
|
public int spins = 7;
|
||||||
|
@ -441,20 +441,13 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
|||||||
{
|
{
|
||||||
Iris.error("Failed to read " + typeToken.getRawType().getCanonicalName() + "... faking objects a little to load the file at least.");
|
Iris.error("Failed to read " + typeToken.getRawType().getCanonicalName() + "... faking objects a little to load the file at least.");
|
||||||
try {
|
try {
|
||||||
T o = (T) typeToken.getRawType().getConstructor().newInstance();
|
return (T) typeToken.getRawType().getConstructor().newInstance();
|
||||||
return o;
|
} catch (Throwable ignored) {
|
||||||
} catch (InstantiationException ex) {
|
|
||||||
ex.printStackTrace();
|
}
|
||||||
} catch (IllegalAccessException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
} catch (InvocationTargetException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
} catch (NoSuchMethodException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user