blob: f7b3ef353cfd615946d6cdeb89b4d4cf0ea2c729 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
package com.essentials.register.payment;
import com.iConomy.iConomy;
import cosine.boseconomy.BOSEconomy;
import com.earth2me.essentials.Essentials;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.PluginDescriptionFile;
public class Methods {
private Method Method = null;
public Plugin method = null;
public boolean setMethod(Plugin method) {
PluginManager loader = method.getServer().getPluginManager();
if(method.isEnabled()) {
PluginDescriptionFile info = method.getDescription();
String name = info.getName();
if(name.equalsIgnoreCase("iconomy")) {
if(method.getClass().getName().equals("com.iConomy.iConomy"))
Method = new MethodiCo5((iConomy)method);
else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); }
} else if(name.equalsIgnoreCase("boseconomy")) {
Method = new MethodBOSEconomy((BOSEconomy)method);
} else if(name.equalsIgnoreCase("essentials")) {
Method = new MethodEEco((Essentials)method);
}
}
if(!hasMethod()) {
if(loader.getPlugin("iConomy") != null) {
method = loader.getPlugin("iConomy");
if(method.getClass().getName().equals("com.iConomy.iConomy"))
Method = new MethodiCo5((iConomy)method);
else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); }
} else if(loader.getPlugin("BOSEconomy") != null) {
method = loader.getPlugin("BOSEconomy");
Method = new MethodBOSEconomy((BOSEconomy)method);
} else if(loader.getPlugin("Essentials") != null) {
method = loader.getPlugin("Essentials");
Method = new MethodEEco((Essentials)method);
}
}
return hasMethod();
}
public boolean checkDisabled(Plugin method) {
PluginDescriptionFile info = method.getDescription();
String name = info.getName();
if(name.equalsIgnoreCase("iconomy")) {
if(method.getClass().getName().equals("com.iConomy.iConomy"))
Method = null;
else { Method = null; }
} else if(name.equalsIgnoreCase("boseconomy")) {
Method = null;
} else if(name.equalsIgnoreCase("essentials")) {
Method = null;
}
return (Method == null);
}
public boolean hasMethod() {
return (Method != null);
}
public Method getMethod() {
return Method;
}
}
|