0

Ran formatter, removed unnecessary newline in cmdstring

This commit is contained in:
Pepich 2017-02-18 18:13:00 +01:00
parent 04c4806dad
commit 1f20c06e91

View File

@ -10,42 +10,47 @@ import com.redstoner.annotations.Version;
import com.redstoner.misc.Utils; import com.redstoner.misc.Utils;
import com.redstoner.modules.Module; import com.redstoner.modules.Module;
@Version(major = 1, minor = 0, revision = 0, compatible = 1) @Version(major = 1, minor = 0, revision = 1, compatible = 1)
public class Illumination implements Module{ public class Illumination implements Module
{
boolean enabled = false; boolean enabled = false;
PotionEffect effect = new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false); PotionEffect effect = new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false);
@Command(hook = "illuminate") @Command(hook = "illuminate")
public void illuminate(CommandSender sender) { public void illuminate(CommandSender sender)
{
Player player = (Player) sender; Player player = (Player) sender;
if(player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) { if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION))
{
player.removePotionEffect(PotionEffectType.NIGHT_VISION); player.removePotionEffect(PotionEffectType.NIGHT_VISION);
Utils.sendMessage(sender, null, "Night Vision Disabled."); Utils.sendMessage(sender, null, "Night Vision Disabled.");
} }
else { else
{
player.addPotionEffect(effect, true); player.addPotionEffect(effect, true);
Utils.sendMessage(sender, null, "Night Vision Enabled."); Utils.sendMessage(sender, null, "Night Vision Enabled.");
} }
} }
@Override @Override
public void onEnable() { public void onEnable()
{
enabled = true; enabled = true;
} }
@Override @Override
public void onDisable() { public void onDisable()
{
enabled = false; enabled = false;
} }
@Override @Override
public boolean enabled() { public boolean enabled()
{
return enabled; return enabled;
} }
// @noformat
@Override @Override
public String getCommandString() { public String getCommandString() {
return "command nightvision {\n" + return "command nightvision {\n" +
@ -56,7 +61,7 @@ public class Illumination implements Module{
" perm utils.illuminate;\n" + " perm utils.illuminate;\n" +
" }\n" + " }\n" +
"}\n" + "}\n" +
"\n" +
"}"; "}";
} }
// @format
} }