Improved the AbstractMoudule.
This commit is contained in:
parent
8c2c351222
commit
d85624b067
2 changed files with 7 additions and 13 deletions
|
@ -106,8 +106,12 @@ public abstract class AbstractModule {
|
||||||
* @return <code>true</code> or <code>false</code>
|
* @return <code>true</code> or <code>false</code>
|
||||||
*/
|
*/
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
|
if (hasProperties()) {
|
||||||
|
return isValidProperties();
|
||||||
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns <code>true</code> if the module responds to private messages.
|
* Returns <code>true</code> if the module responds to private messages.
|
||||||
|
|
|
@ -44,10 +44,8 @@ import java.security.SecureRandom;
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public final class Dice extends AbstractModule {
|
public final class Dice extends AbstractModule {
|
||||||
/**
|
// The dice command.
|
||||||
* The dice command.
|
private static final String DICE_CMD = "dice";
|
||||||
*/
|
|
||||||
public static final String DICE_CMD = "dice";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default constructor.
|
* The default constructor.
|
||||||
|
@ -100,12 +98,4 @@ public final class Dice extends AbstractModule {
|
||||||
bot.send(sender, "To roll the dice:");
|
bot.send(sender, "To roll the dice:");
|
||||||
bot.send(sender, bot.helpIndent(bot.getNick() + ": " + DICE_CMD));
|
bot.send(sender, bot.helpIndent(bot.getNick() + ": " + DICE_CMD));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean isEnabled() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue