diff --git a/src/main/java/net/lenni0451/spm/utils/PluginUtils.java b/src/main/java/net/lenni0451/spm/utils/PluginUtils.java index b58a957..0a132b1 100644 --- a/src/main/java/net/lenni0451/spm/utils/PluginUtils.java +++ b/src/main/java/net/lenni0451/spm/utils/PluginUtils.java @@ -382,7 +382,7 @@ public List getPluginsByLoadOrder() { if (dependPos > pluginPos) { plugins.remove(pluginPos); - plugins.add(dependPos + 1, plugin); + plugins.add(Math.min(dependPos + 1, plugins.size()), plugin); i = 0; }