From 63f96228763ff3dec14143d1cb68f09075187e5b Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Tue, 26 Jan 2016 17:51:29 +0000 Subject: [PATCH] cannon correctly loadded title + fixed rotation being all wrong --- .../game/clans/clans/siege/cannon/Cannon.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/cannon/Cannon.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/cannon/Cannon.java index 552047bad..b7788772d 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/cannon/Cannon.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/cannon/Cannon.java @@ -46,6 +46,8 @@ import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTime; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.updater.UpdateType; @@ -206,10 +208,17 @@ public class Cannon implements Listener return; } - if (canBeFired()) - { + ClansManager.getInstance().runSyncLater(() -> { + if (event.getPlayer().getInventory().equals(_inventory)) + { + return; + } - } + if (canBeFired()) + { + UtilTextMiddle.display("Cannon Ready", "Power Level: " + C.cGreen + UtilText.repeat("▌", getPower()) + C.cRed + UtilText.repeat("▌", 3 - getPower()), 20, 100, 20, _rider); + } + }, 3L); } @EventHandler(priority = EventPriority.HIGHEST) @@ -512,8 +521,8 @@ public class Cannon implements Listener } ArmorStand armorStand = (ArmorStand) UtilMath.getFirst(_entities); - double standYaw = Math.abs(Math.toDegrees(armorStand.getHeadPose().getY()) % 360); - double riderYaw = Math.abs(_rider.getLocation().getYaw() % 360); + double standYaw = Math.toDegrees(armorStand.getHeadPose().getY()) % 360; + double riderYaw = _rider.getLocation().getYaw() % 360; double dif = riderYaw - standYaw;