mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-06 05:51:35 +00:00
Reformat
This commit is contained in:
parent
ad13062117
commit
dde0b20775
380 changed files with 38917 additions and 46821 deletions
|
@ -1,61 +1,50 @@
|
|||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.LightningStrike;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class Commandlightning extends EssentialsLoopCommand
|
||||
{
|
||||
int power = 5;
|
||||
|
||||
public Commandlightning()
|
||||
{
|
||||
super("lightning");
|
||||
}
|
||||
public class Commandlightning extends EssentialsLoopCommand {
|
||||
int power = 5;
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
User user;
|
||||
if (sender.isPlayer())
|
||||
{
|
||||
user = ess.getUser(sender.getPlayer());
|
||||
if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others")))
|
||||
{
|
||||
user.getWorld().strikeLightning(user.getBase().getTargetBlock(null, 600).getLocation());
|
||||
return;
|
||||
}
|
||||
}
|
||||
public Commandlightning() {
|
||||
super("lightning");
|
||||
}
|
||||
|
||||
if (args.length > 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
power = Integer.parseInt(args[1]);
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
loopOnlinePlayers(server, sender, true, true, args[0], null);
|
||||
}
|
||||
@Override
|
||||
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
|
||||
User user;
|
||||
if (sender.isPlayer()) {
|
||||
user = ess.getUser(sender.getPlayer());
|
||||
if ((args.length < 1 || user != null && !user.isAuthorized("essentials.lightning.others"))) {
|
||||
user.getWorld().strikeLightning(user.getBase().getTargetBlock(null, 600).getLocation());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updatePlayer(final Server server, final CommandSource sender, final User matchUser, final String[] args)
|
||||
{
|
||||
sender.sendMessage(tl("lightningUse", matchUser.getDisplayName()));
|
||||
final LightningStrike strike = matchUser.getBase().getWorld().strikeLightningEffect(matchUser.getBase().getLocation());
|
||||
if (args.length > 1) {
|
||||
try {
|
||||
power = Integer.parseInt(args[1]);
|
||||
} catch (NumberFormatException ex) {
|
||||
}
|
||||
}
|
||||
loopOnlinePlayers(server, sender, true, true, args[0], null);
|
||||
}
|
||||
|
||||
if (!matchUser.isGodModeEnabled())
|
||||
{
|
||||
matchUser.getBase().damage(power, strike);
|
||||
}
|
||||
if (ess.getSettings().warnOnSmite())
|
||||
{
|
||||
matchUser.sendMessage(tl("lightningSmited"));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void updatePlayer(final Server server, final CommandSource sender, final User matchUser, final String[] args) {
|
||||
sender.sendMessage(tl("lightningUse", matchUser.getDisplayName()));
|
||||
final LightningStrike strike = matchUser.getBase().getWorld().strikeLightningEffect(matchUser.getBase().getLocation());
|
||||
|
||||
if (!matchUser.isGodModeEnabled()) {
|
||||
matchUser.getBase().damage(power, strike);
|
||||
}
|
||||
if (ess.getSettings().warnOnSmite()) {
|
||||
matchUser.sendMessage(tl("lightningSmited"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue