diff options
author | Pepich <benedikt.abel@yahoo.de> | 2017-02-18 18:13:00 +0100 |
---|---|---|
committer | Pepich <benedikt.abel@yahoo.de> | 2017-02-18 18:13:00 +0100 |
commit | 1f20c06e91dc51a1a21b19fefdb1eda713ea5ce1 (patch) | |
tree | fc2f97febd05528b4736fd776a6451ac52c64c7a | |
parent | 04c4806dadd4a1c64c4a5c3ba9b316d3b910c93e (diff) |
Ran formatter, removed unnecessary newline in cmdstring
-rw-r--r-- | src/com/redstoner/modules/illumination/Illumination.java | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/com/redstoner/modules/illumination/Illumination.java b/src/com/redstoner/modules/illumination/Illumination.java index 5404a30..cef40c2 100644 --- a/src/com/redstoner/modules/illumination/Illumination.java +++ b/src/com/redstoner/modules/illumination/Illumination.java @@ -10,42 +10,47 @@ import com.redstoner.annotations.Version; import com.redstoner.misc.Utils; import com.redstoner.modules.Module; -@Version(major = 1, minor = 0, revision = 0, compatible = 1) -public class Illumination implements Module{ - +@Version(major = 1, minor = 0, revision = 1, compatible = 1) +public class Illumination implements Module +{ boolean enabled = false; PotionEffect effect = new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false); @Command(hook = "illuminate") - public void illuminate(CommandSender sender) { + public void illuminate(CommandSender sender) + { Player player = (Player) sender; - if(player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) { + if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) + { player.removePotionEffect(PotionEffectType.NIGHT_VISION); Utils.sendMessage(sender, null, "Night Vision Disabled."); } - else { + else + { player.addPotionEffect(effect, true); Utils.sendMessage(sender, null, "Night Vision Enabled."); } } @Override - public void onEnable() { + public void onEnable() + { enabled = true; - } - + @Override - public void onDisable() { + public void onDisable() + { enabled = false; - } - + @Override - public boolean enabled() { + public boolean enabled() + { return enabled; } - + + // @noformat @Override public String getCommandString() { return "command nightvision {\n" + @@ -56,7 +61,7 @@ public class Illumination implements Module{ " perm utils.illuminate;\n" + " }\n" + "}\n" + - "\n" + "}"; } + // @format } |