From ef1d6ede24dff8f4e64fe6fe66148638ad08e2c9 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 19 Mar 2016 06:31:37 +0000 Subject: [PATCH] many fixes --- .../game/clans/clans/ban/commands/ClansBanCommand.java | 7 +++---- .../mineplex/game/clans/clans/ban/ui/ClansBanPage.java | 10 +++++++++- .../game/clans/items/legendaries/HyperAxe.java | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java index bebb540b7..7dd6578ff 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java @@ -23,13 +23,13 @@ public class ClansBanCommand extends CommandBase { UtilPlayer.message(caller, C.cGold + "/cb - Displays the \"Clans Punish\" GUI, allowing you to ban the player, and "); } - else if (args.length > 2) + else if (args.length > 1) { final String playerName = args[0]; String reason = args[2]; - for (int i = 3; i < args.length; i++) + for (int i = 2; i < args.length; i++) { reason += " " + args[i]; } @@ -62,8 +62,7 @@ public class ClansBanCommand extends CommandBase } else { - UtilPlayer.message(caller, C.cGold + "/cb - Bans the specified player for the specified amount of time"); - UtilPlayer.message(caller, C.cGold + "/cb - Displays the \"Clans Punish\" UI, and will display all of the player's past bans (including current ones)"); + UtilPlayer.message(caller, C.cGold + "/cb - Displays the \"Clans Punish\" GUI, allowing you to ban the player, and "); } } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/ui/ClansBanPage.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/ui/ClansBanPage.java index 6d6c411ff..f7ce1faa5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/ui/ClansBanPage.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/ui/ClansBanPage.java @@ -1,5 +1,6 @@ package mineplex.game.clans.clans.ban.ui; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -116,9 +117,16 @@ public class ClansBanPage extends ShopPageBase .addLore("Reason: " + F.elem(data.getRight())).build(), (player, click) -> { getPlugin().runAsync(() -> { - double time = _days + ((1 / 24) * _hours); + double time = _days + ((1.f / 24.f) * _hours); getPlugin().ban(client, data.getLeft(), getPlayer().getName(), _permanent ? -1 : (long) (time * 24.f * 60.f * 60.f * 1000.f), data.getRight(), c -> { UtilPlayer.message(getPlayer(), F.main("Clans", F.elem(data.getLeft()) + " is now banned " + c.getBanTimeFormatted() + ".")); + + getPlugin().runSync(() -> { + Player target = Bukkit.getPlayer(data.getLeft()); + + if (target != null) + target.kickPlayer(C.cRedB + "You have been banned from Clans " + c.getBanTimeFormatted() + "."); + }); }); }); }); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java index a01774651..085cc7fb4 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/HyperAxe.java @@ -12,7 +12,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class HyperAxe extends LegendaryItem { - public static final long ATTACK_RATE_DURATION = 1000 / 17; + public static final long ATTACK_RATE_DURATION = 1000 / 10; private static ValueDistribution amountGen = generateDistribution(0, 3); // [1, 4] speed amount private static ValueDistribution durationGen = generateDistribution(80, 320); // [4, 16] seconds speed duration