mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-24 23:25:46 +02:00
Fix /lightning <player> <damage> to actually deal the proper set damage (5 or 25% by default)
This commit is contained in:
@@ -32,7 +32,7 @@ public class Commandlightning extends EssentialsCommand
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
|
||||
int power = 1;
|
||||
int power = 5;
|
||||
if (args.length > 1)
|
||||
{
|
||||
try
|
||||
@@ -47,18 +47,10 @@ public class Commandlightning extends EssentialsCommand
|
||||
for (Player matchPlayer : server.matchPlayer(args[0]))
|
||||
{
|
||||
sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName()));
|
||||
if (power <= 0)
|
||||
{
|
||||
matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
LightningStrike strike = matchPlayer.getWorld().strikeLightning(matchPlayer.getLocation());
|
||||
matchPlayer.damage(power - 1, strike);
|
||||
}
|
||||
final LightningStrike strike = matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
|
||||
if (!ess.getUser(matchPlayer).isGodModeEnabled())
|
||||
{
|
||||
matchPlayer.setHealth(matchPlayer.getHealth() < 5 ? 0 : matchPlayer.getHealth() - 5);
|
||||
matchPlayer.damage(power, strike);
|
||||
}
|
||||
@Cleanup
|
||||
final ISettings settings = ess.getSettings();
|
||||
|
Reference in New Issue
Block a user