diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index a4df47181..e06342310 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -7,6 +7,7 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.CustomTagFix; import mineplex.core.FoodDupeFix; +import mineplex.core.PacketsInteractionFix; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; import mineplex.core.antihack.AntiHack; @@ -119,6 +120,8 @@ public class Clans extends JavaPlugin new IncognitoManager(this, _clientManager, packetHandler); + new PacketsInteractionFix(this, packetHandler); + StatsManager statsManager = new StatsManager(this, _clientManager); AchievementManager achievementManager = new AchievementManager(statsManager, _clientManager, _donationManager); Chat chat = new Chat(this, _clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName()); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/SiegeWeapon.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/SiegeWeapon.java index 505187567..353c86dc9 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/SiegeWeapon.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/weapon/SiegeWeapon.java @@ -14,6 +14,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; @@ -161,15 +162,15 @@ public abstract class SiegeWeapon implements Listener _infoHologram = new Hologram(ClansManager.getInstance().getHologramManager(), _location.clone().add(.5, 3, .5), _name + " Health", getDisplayHealth()); _infoHologram.start(); - _infoHologram.setInteraction((player, type) -> { - if (player.equals(_rider)) - { - if (type.equals(ClickType.LEFT)) - { - handleLeftClick(player); - } - } - }); +// _infoHologram.setInteraction((player, type) -> { +// if (player.equals(_rider)) +// { +// if (type.equals(ClickType.LEFT)) +// { +// handleLeftClick(player); +// } +// } +// }); UtilServer.RegisterEvents(this); @@ -502,7 +503,7 @@ public abstract class SiegeWeapon implements Listener return; } - if (Recharge.Instance.use(player, "Damage Cannon", 200, false, false)) + if (!player.equals(_rider) && Recharge.Instance.use(player, "Damage Cannon", 200, false, false)) { int health = calculateDamage(player); @@ -713,7 +714,14 @@ public abstract class SiegeWeapon implements Listener public void onDmg(EntityDamageByEntityEvent event) { if (_comprisedOf.contains(event.getEntity()) && event.getDamager() instanceof Player) - handleLeftClick((Player) event.getDamager()); + { + if (!((Player) event.getDamager()).equals(_rider)) + { + handleLeftClick((Player) event.getDamager()); + } + + event.setCancelled(true); + } } @EventHandler @@ -748,11 +756,24 @@ public abstract class SiegeWeapon implements Listener @EventHandler public void onInteract(PlayerInteractEvent event) { - if (event.getPlayer().equals(_rider)) + if (!event.getPlayer().equals(_rider)) + { + System.out.println("NOT RIDER"); + return; + } + + System.out.println(event.getAction()); + + if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { handleRightClick(event.getPlayer()); event.setCancelled(true); } + else if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) + { + handleLeftClick(event.getPlayer()); + event.setCancelled(true); + } } @EventHandler diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java index 79db27ad3..3164f22a3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/AttackEnemyObjective.java @@ -135,6 +135,8 @@ public class AttackEnemyObjective extends OrderedObjective { Arrow arrow = shooter.shootArrow(); + arrow.setVelocity(UtilAlg.getTrajectory(arrow.getLocation(), player.getLocation())); + Recharge.Instance.use(player, "ShotBy" + shooter.getUniqueId().toString(), 500 + UtilMath.r(2000), false, false); } });