Merge pull request #115 from Wilee999/pull1

Strike lightning on /tempban
This commit is contained in:
Jerom van der Sar 2014-01-14 11:28:52 -08:00
commit 7dffea0ba2

View File

@ -10,6 +10,7 @@ import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.Location;
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH) @CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
@CommandParameters(description = "Temporarily ban someone.", usage = "/<command> [playername] [duration] [reason]") @CommandParameters(description = "Temporarily ban someone.", usage = "/<command> [playername] [duration] [reason]")
@ -55,6 +56,18 @@ public class Command_tempban extends TFM_Command
ban_reason = StringUtils.join(ArrayUtils.subarray(args, 2, args.length), " ") + " (" + sender.getName() + ")"; ban_reason = StringUtils.join(ArrayUtils.subarray(args, 2, args.length), " ") + " (" + sender.getName() + ")";
bcast_msg.append(", Reason: \"").append(ban_reason).append("\""); bcast_msg.append(", Reason: \"").append(ban_reason).append("\"");
} }
// strike with lightning effect:
final Location targetPos = player.getLocation();
for (int x = -1; x <= 1; x++)
{
for (int z = -1; z <= 1; z++)
{
final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z);
targetPos.getWorld().strikeLightning(strike_pos);
}
}
TFM_Util.adminAction(sender.getName(), bcast_msg.toString(), true); TFM_Util.adminAction(sender.getName(), bcast_msg.toString(), true);
TFM_ServerInterface.banUsername(player.getName(), ban_reason, sender.getName(), ban_duration); TFM_ServerInterface.banUsername(player.getName(), ban_reason, sender.getName(), ban_duration);