Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@ public void onInitialize() {
error = new PatchworkInitializationException("Failed to construct Patchwork mods");
}

Throwable checked;

if (t instanceof BootstrapMethodError) {
checked = t.getCause();
} else {
checked = t;
}

if (checked instanceof NoClassDefFoundError || checked instanceof NoSuchMethodError || checked instanceof NoSuchFieldError) {
final String unDefinedClass = checked.getMessage().substring(checked.getMessage().lastIndexOf(' ') + 1).replace('/', '.');
String type;

if (checked instanceof NoClassDefFoundError) {
type = "class";
} else if (checked instanceof NoSuchMethodError) {
type = "method";
} else {
type = "field";
}

if (unDefinedClass.startsWith("net.minecraft.") || (unDefinedClass.startsWith("net.minecraftforge.") && !unDefinedClass.startsWith("net.minecraftforge.lex."))) {
throw new PatchworkInitializationException("Patchwork mod " + initializer.getModId() + " tried to access an unimplemented " + type + ".", t);
} else {
throw new PatchworkInitializationException("Patchwork mod " + initializer.getModId() + " tried to access a missing " + type + " from a missing and undeclared, or outdated dependency.", t);
}
}

error.addSuppressed(t);
}

Expand Down