Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General code quality fix-1 #14

Open
wants to merge 1 commit into
base: Minecraft-1.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/uk/co/jacekk/bukkit/bloodmoon/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import uk.co.jacekk.bukkit.baseplugin.config.PluginConfigKey;

public class Config {

private Config() {}

public static final PluginConfigKey ENABLED = new PluginConfigKey("enabled", false);
public static final PluginConfigKey ALWAYS_ON = new PluginConfigKey("always-on", false);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/uk/co/jacekk/bukkit/bloodmoon/Permission.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public class Permission {

private Permission() {}

public static final String ADMIN_START = "bloodmoon.admin.start";
public static final String ADMIN_STOP = "bloodmoon.admin.stop";
public static final String ADMIN_RELOAD = "bloodmoon.admin.reload";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ public void run() {

plugin.forceWorlds.remove(worldName);
}
} else if (worldTime >= 23000 && worldTime <= 23100) {
if (plugin.isActive(world)) {
plugin.deactivate(world);
}
} else if (worldTime >= 23000 && worldTime <= 23100 && plugin.isActive(world)) {
plugin.deactivate(world);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
if (plugin.isFeatureEnabled(world, Feature.CHAT_MESSAGE)) {
String message = worldConfig.getString(Config.FEATURE_CHAT_MESSAGE_START_MESSAGE);

if (!message.isEmpty()) {
if (plugin.isActive(world)) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
}
if (!message.isEmpty() && plugin.isActive(world)) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@ public void onPistonRetract(BlockPistonRetractEvent event) {
World world = event.getBlock().getWorld();
PluginConfig worldConfig = plugin.getConfig(world);

if (plugin.isEnabled(world) && worldConfig.getBoolean(Config.FEATURE_DUNGEONS_PROTECTED)) {
if (this.isProtected(event.getRetractLocation())) {
event.setCancelled(true);
}
if (plugin.isEnabled(world) && worldConfig.getBoolean(Config.FEATURE_DUNGEONS_PROTECTED) && this.isProtected(event.getRetractLocation())) {
event.setCancelled(true);
}
}

Expand Down