Fixing an issue where soft depends were behaving like real depends.
This commit is contained in:
1 parent
b3e7b3b3b2
commit
ef6c2ad5ff
3 files changed
+23
-5
No files matched your search
@@ -6,7 +6,7 @@
|
||||
<groupId>com.programmerdan.minecraft</groupId>
|
||||
<artifactId>SimpleAdminHacks</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.2.1</version>
|
||||
<version>1.2.2</version>
|
||||
<name>SimpleAdminHacks</name>
|
||||
<url>https://github.com/DevotedMC/SimpleAdminHacks</url>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.LinkedList;
|
||||
@@ -129,8 +130,18 @@ public class SimpleAdminHacks extends JavaPlugin {
|
||||
}
|
||||
|
||||
// Boot up the hacks.
|
||||
for (SimpleHack<?> hack : hacks) {
|
||||
hack.enable();
|
||||
List<SimpleHack<?>> iterList = new ArrayList<SimpleHack<?>>(hacks);
|
||||
for (SimpleHack<?> hack : iterList) {
|
||||
try {
|
||||
hack.enable();
|
||||
} catch (NoClassDefFoundError err) {
|
||||
log(Level.WARNING, "Unable to activate hack {0}, missing dependency: {1}", hack.getName(), err.getMessage());
|
||||
unregister(hack);
|
||||
} catch (Exception e) {
|
||||
log(Level.WARNING, "Unable to activate hack {0}, unrecognized error: {1}", hack.getName(), e.getMessage());
|
||||
log(Level.WARNING, "Full stack trace: ", e);
|
||||
unregister(hack);
|
||||
}
|
||||
}
|
||||
|
||||
this.registerCommand("hacks", new CommandListener(this));
|
||||
@@ -142,7 +153,14 @@ public class SimpleAdminHacks extends JavaPlugin {
|
||||
public void onDisable() {
|
||||
if (hacks == null) return;
|
||||
for (SimpleHack<?> hack : hacks) {
|
||||
hack.disable();
|
||||
try {
|
||||
hack.disable();
|
||||
} catch (NoClassDefFoundError err) {
|
||||
log(Level.WARNING, "Unable to cleanly disable hack {0}, missing dependency: {1}", hack.getName(), err.getMessage());
|
||||
} catch (Exception e) {
|
||||
log(Level.WARNING, "Unable to cleanly disable hack {0}, unrecognized error: {1}", hack.getName(), e.getMessage());
|
||||
log(Level.WARNING, "Full stack trace: ", e);
|
||||
}
|
||||
}
|
||||
hacks.clear();
|
||||
hacks = null;
|
||||
|
||||
@@ -3,7 +3,7 @@ main: com.programmerdan.minecraft.simpleadminhacks.SimpleAdminHacks
|
||||
author: ProgrammerDan
|
||||
authors: []
|
||||
version: ${project.version}
|
||||
softdepend: [CombatTagPlus, ProtocolLib, NameLayer, NPCLib, CrazyCrates]
|
||||
softdepend: [CombatTagPlus, Citadel, ProtocolLib, NameLayer, NPCLib, CrazyCrates]
|
||||
commands:
|
||||
hacks:
|
||||
description: Shows the various hacks and fixes supported by this plugin and controls them
|
||||
|
||||
Reference in new issue
Block a user