2013-01-16 11:33:14 +00:00
|
|
|
package de.jaschastarke.minecraft.limitedcreative;
|
|
|
|
|
|
|
|
import de.jaschastarke.bukkit.lib.CoreModule;
|
2013-02-05 20:04:05 +00:00
|
|
|
import de.jaschastarke.minecraft.limitedcreative.limits.BlockListener;
|
|
|
|
import de.jaschastarke.minecraft.limitedcreative.limits.EntityListener;
|
2013-02-01 21:25:43 +00:00
|
|
|
import de.jaschastarke.minecraft.limitedcreative.limits.LimitConfig;
|
2013-02-05 20:04:05 +00:00
|
|
|
import de.jaschastarke.minecraft.limitedcreative.limits.PlayerListener;
|
2013-01-16 11:33:14 +00:00
|
|
|
import de.jaschastarke.modularize.IModule;
|
|
|
|
import de.jaschastarke.modularize.ModuleEntry;
|
2013-02-05 20:04:05 +00:00
|
|
|
import de.jaschastarke.modularize.ModuleEntry.ModuleState;
|
2013-01-16 11:33:14 +00:00
|
|
|
|
2013-01-18 21:51:08 +00:00
|
|
|
public class ModCreativeLimits extends CoreModule<LimitedCreative> {
|
2013-02-01 21:25:43 +00:00
|
|
|
protected LimitConfig config;
|
|
|
|
|
2013-01-18 21:51:08 +00:00
|
|
|
public ModCreativeLimits(LimitedCreative plugin) {
|
2013-01-16 11:33:14 +00:00
|
|
|
super(plugin);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected FeatureBlockItemSpawn blockDrops = null;
|
2013-02-05 20:04:05 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getName() {
|
|
|
|
return "Limits";
|
|
|
|
}
|
2013-01-16 11:33:14 +00:00
|
|
|
|
|
|
|
@Override
|
2013-02-01 21:25:43 +00:00
|
|
|
public void initialize(ModuleEntry<IModule> entry) {
|
|
|
|
super.initialize(entry);
|
2013-02-05 20:04:05 +00:00
|
|
|
listeners.addListener(new PlayerListener(this));
|
|
|
|
listeners.addListener(new EntityListener(this));
|
|
|
|
listeners.addListener(new BlockListener(this));
|
|
|
|
config = plugin.getPluginConfig().registerSection(new LimitConfig(this, entry));
|
|
|
|
|
|
|
|
/*blockDrops = plugin.getModule(FeatureBlockItemSpawn.class);
|
2013-01-16 11:33:14 +00:00
|
|
|
if (blockDrops == null)
|
|
|
|
blockDrops = plugin.addModule(new FeatureBlockItemSpawn(plugin)).getModule();
|
2013-02-05 20:04:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
if (!config.getEnabled()) {
|
|
|
|
entry.initialState = ModuleState.DISABLED;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnable() {
|
|
|
|
super.onEnable();
|
|
|
|
getLog().info(plugin.getLocale().trans("basic.loaded.module"));
|
|
|
|
}
|
|
|
|
|
|
|
|
public LimitConfig getConfig() {
|
|
|
|
return config;
|
2013-01-16 11:33:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|