2013-01-16 11:33:14 +00:00
|
|
|
package de.jaschastarke.minecraft.limitedcreative;
|
|
|
|
|
2013-02-01 21:25:43 +00:00
|
|
|
import de.jaschastarke.I18n;
|
2013-01-16 11:33:14 +00:00
|
|
|
import de.jaschastarke.bukkit.lib.Core;
|
2013-01-20 12:15:34 +00:00
|
|
|
import de.jaschastarke.bukkit.lib.PluginLang;
|
2013-02-05 20:04:05 +00:00
|
|
|
import de.jaschastarke.bukkit.lib.configuration.command.ConfigCommand;
|
2013-10-01 13:57:04 +00:00
|
|
|
import de.jaschastarke.bukkit.lib.modules.AdditionalBlockBreaks;
|
2013-08-12 13:50:05 +00:00
|
|
|
import de.jaschastarke.utils.ClassDescriptorStorage;
|
2013-01-16 11:33:14 +00:00
|
|
|
|
|
|
|
public class LimitedCreative extends Core {
|
2013-01-18 21:51:08 +00:00
|
|
|
protected Config config = null;
|
2013-01-22 17:38:48 +00:00
|
|
|
protected MainCommand command = null;
|
2013-01-18 21:51:08 +00:00
|
|
|
|
2013-01-16 11:33:14 +00:00
|
|
|
@Override
|
2013-02-01 21:25:43 +00:00
|
|
|
public void onInitialize() {
|
|
|
|
super.onInitialize();
|
2013-01-18 21:51:08 +00:00
|
|
|
config = new Config(this);
|
2013-01-20 12:15:34 +00:00
|
|
|
|
2013-01-22 17:38:48 +00:00
|
|
|
setLang(new PluginLang("lang/messages", this));
|
|
|
|
|
|
|
|
command = new MainCommand(this);
|
2013-02-01 21:25:43 +00:00
|
|
|
ConfigCommand cc = new ConfigCommand(config, Permissions.CONFIG);
|
|
|
|
cc.setPackageName(this.getName() + " - " + this.getLocale().trans(cc.getPackageName()));
|
|
|
|
command.registerCommand(cc);
|
2013-01-22 17:38:48 +00:00
|
|
|
commands.registerCommand(command);
|
2013-01-20 12:15:34 +00:00
|
|
|
|
|
|
|
Hooks.inizializeHooks(this);
|
|
|
|
|
2013-10-01 13:57:04 +00:00
|
|
|
modules.addSharedModule(new AdditionalBlockBreaks(this));
|
|
|
|
modules.addSharedModule(new FeatureBlockItemSpawn(this));
|
2013-01-22 17:38:48 +00:00
|
|
|
addModule(new FeatureSwitchGameMode(this));
|
2013-01-16 11:33:14 +00:00
|
|
|
addModule(new ModInventories(this));
|
|
|
|
addModule(new ModCreativeLimits(this));
|
|
|
|
addModule(new ModRegions(this));
|
|
|
|
addModule(new ModCmdBlocker(this));
|
2013-03-24 21:26:53 +00:00
|
|
|
addModule(new ModGameModePerm(this));
|
2013-07-26 22:25:39 +00:00
|
|
|
addModule(new ModBlockStates(this));
|
2013-10-01 14:58:01 +00:00
|
|
|
addModule(new FeatureMetrics(this)).setDefaultEnabled(config.getMetrics());
|
2013-01-18 21:51:08 +00:00
|
|
|
|
2013-03-29 10:14:10 +00:00
|
|
|
listeners.addListener(new DependencyListener(this));
|
|
|
|
|
2013-01-22 17:38:48 +00:00
|
|
|
config.saveDefault();
|
2013-03-29 12:44:53 +00:00
|
|
|
|
2013-08-29 12:19:59 +00:00
|
|
|
try {
|
|
|
|
Class.forName("de.jaschastarke.hooking.CaptainHook");
|
|
|
|
} catch(Exception e) {}
|
2013-01-18 21:51:08 +00:00
|
|
|
}
|
|
|
|
|
2013-08-12 13:50:05 +00:00
|
|
|
@Override
|
|
|
|
public ClassDescriptorStorage getDocCommentStorage() {
|
|
|
|
if (cds == null) {
|
|
|
|
cds = new ClassDescriptorStorage();
|
|
|
|
cds.getResourceBundle().addResourceBundle("lang.doccomments");
|
|
|
|
}
|
|
|
|
return cds;
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:25:43 +00:00
|
|
|
@Override
|
|
|
|
public boolean isDebug() {
|
|
|
|
return config.getDebug();
|
|
|
|
}
|
|
|
|
|
2013-01-18 21:51:08 +00:00
|
|
|
public Config getPluginConfig() {
|
|
|
|
return config;
|
2013-01-16 11:33:14 +00:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:25:43 +00:00
|
|
|
public I18n getLocale() {
|
2013-01-22 17:38:48 +00:00
|
|
|
return getLang();
|
|
|
|
}
|
|
|
|
|
|
|
|
public MainCommand getMainCommand() {
|
|
|
|
return command;
|
2013-01-16 11:33:14 +00:00
|
|
|
}
|
|
|
|
}
|