-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Depenizen.java
134 lines (116 loc) · 5.12 KB
/
Depenizen.java
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package net.gnomeffinway.depenizen;
import me.limebyte.battlenight.core.BattleNight;
import me.zford.jobs.bukkit.JobsPlugin;
import net.aufdemrand.denizen.Denizen;
import net.gnomeffinway.depenizen.support.BattleNightSupport;
import net.gnomeffinway.depenizen.support.FactionsSupport;
import net.gnomeffinway.depenizen.support.JobsSupport;
import net.gnomeffinway.depenizen.support.McMMOSupport;
import net.gnomeffinway.depenizen.support.TownySupport;
import net.gnomeffinway.depenizen.support.VotifierSupport;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;
import com.gmail.nossr50.mcMMO;
import com.massivecraft.factions.Factions;
import com.palmergames.bukkit.towny.Towny;
import com.vexsoftware.votifier.Votifier;
public class Depenizen extends JavaPlugin{
public static mcMMO mcmmo;
public static Factions factions;
public static BattleNight battlenight;
public static Denizen denizen;
public static Towny towny;
public static Votifier votifier;
public static JobsPlugin jobs;
public McMMOSupport mcmmoSupport;
public BattleNightSupport battlenightSupport;
public TownySupport townySupport;
public FactionsSupport factionsSupport;
public VotifierSupport votifierSupport;
public JobsSupport jobsSupport;
@Override
public void onEnable() {
checkPlugins();
getLogger().info("Finished loading " + getDescription().getFullName());
}
@Override
public void onDisable() {
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("depenizen")) {
sender.sendMessage(ChatColor.UNDERLINE + "Depenizen");
sender.sendMessage(ChatColor.GRAY + "Developers: " + ChatColor.AQUA + "Morphan1" + ChatColor.GRAY + " and GnomeffinWay");
sender.sendMessage(ChatColor.GRAY + "Current version: "+ ChatColor.GOLD + this.getDescription().getVersion());
return true;
}
return false;
}
public void checkPlugins() {
denizen = (Denizen) getServer().getPluginManager().getPlugin("Denizen");
mcmmo = (mcMMO) getServer().getPluginManager().getPlugin("mcMMO");
factions = (Factions) getServer().getPluginManager().getPlugin("Factions");
towny = (Towny) getServer().getPluginManager().getPlugin("Towny");
battlenight = (BattleNight) getServer().getPluginManager().getPlugin("BattleNight");
votifier = (Votifier) getServer().getPluginManager().getPlugin("Votifier");
jobs = (JobsPlugin) getServer().getPluginManager().getPlugin("Jobs");
if (denizen != null) {
getServer().getLogger().info("[Depenizen] Denizen hooked");
}
else {
getServer().getLogger().severe("[Depenizen] Denizen not found, disabling");
this.getPluginLoader().disablePlugin(this);
return;
}
if (mcmmo != null) {
getServer().getLogger().info("[Depenizen] mcMMO hooked, enabling add-ons.");
mcmmoSupport = new McMMOSupport(this);
mcmmoSupport.register();
}
else {
getServer().getLogger().info("[Depenizen] mcMMO not found, add-ons will not enable.");
}
if (towny != null) {
getServer().getLogger().info("[Depenizen] Towny hooked, enabling add-ons.");
townySupport = new TownySupport(this);
townySupport.register();
}
else {
getServer().getLogger().info("[Depenizen] Towny not found, add-ons. will not add-ons.");
}
if (factions != null) {
getServer().getLogger().info("[Depenizen] Factions hooked, enabling add-ons.");
factionsSupport = new FactionsSupport(this);
factionsSupport.register();
}
else {
getServer().getLogger().info("[Depenizen] Factions not found, add-ons will not enable.");
}
if (battlenight != null) {
getServer().getLogger().info("[Depenizen] BattleNight hooked, enabling add-ons.");
battlenightSupport = new BattleNightSupport(this);
battlenightSupport.register();
}
else {
getServer().getLogger().info("[Depenizen] BattleNight not found, add-ons will not enable.");
}
if (votifier != null) {
getServer().getLogger().info("[Depenizen] Votifier hooked, enabling add-ons.");
votifierSupport = new VotifierSupport(this);
votifierSupport.register();
}
else {
getServer().getLogger().info("[Depenizen] Votifier not found, add-ons will not enable.");
}
if (jobs != null) {
getServer().getLogger().info("[Depenizen] Jobs hooked, enabling add-ons.");
jobsSupport = new JobsSupport(this);
jobsSupport.register();
}
else {
getServer().getLogger().info("[Depenizen] Jobs not found, add-ons will not enable.");
}
}
}