From fc1d9d76393096c01edb15f4a711c9fdfd02b2cf Mon Sep 17 00:00:00 2001 From: night0721 Date: Tue, 12 Jul 2022 22:24:02 +0100 Subject: [PATCH] slight fix on bows so can shoot on left click too --- .../nullvalkyrie/Events/CustomItemEvents.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/night/nullvalkyrie/Events/CustomItemEvents.java b/src/main/java/com/night/nullvalkyrie/Events/CustomItemEvents.java index c8a8ede..e770033 100644 --- a/src/main/java/com/night/nullvalkyrie/Events/CustomItemEvents.java +++ b/src/main/java/com/night/nullvalkyrie/Events/CustomItemEvents.java @@ -105,7 +105,27 @@ public class CustomItemEvents implements Listener { arrow.setVelocity(arrow.getVelocity().multiply(5)); arrow.setDamage(50); e.setCancelled(true); - + } + } else if (e.getAction().equals(Action.LEFT_CLICK_AIR) || e.getAction().equals(Action.LEFT_CLICK_BLOCK)) { + if (name.equalsIgnoreCase(Rarity.MYTHIC.getColor() + "Terminator")) { + Arrow arrow = player.launchProjectile(Arrow.class, player.getEyeLocation().getDirection()); + arrow.setVelocity(arrow.getVelocity().multiply(5)); + arrow.setPickupStatus(Arrow.PickupStatus.DISALLOWED); + arrow.setDamage(50); + Arrow a1 = player.launchProjectile(Arrow.class, player.getEyeLocation().getDirection()); + a1.setVelocity(arrow.getVelocity().rotateAroundY(Math.toRadians(5)).multiply(5)); + a1.setPickupStatus(Arrow.PickupStatus.DISALLOWED); + a1.setDamage(50); + Arrow a2 = player.launchProjectile(Arrow.class, player.getEyeLocation().getDirection()); + a2.setVelocity(arrow.getVelocity().rotateAroundY(Math.toRadians(-5)).multiply(5)); + a2.setPickupStatus(Arrow.PickupStatus.DISALLOWED); + a2.setDamage(50); + e.setCancelled(true); + } else if(name.equalsIgnoreCase(Rarity.LEGENDARY.getColor() + "Explosive Bow")) { + Arrow arrow = player.launchProjectile(Arrow.class, player.getEyeLocation().getDirection()); + arrow.setVelocity(arrow.getVelocity().multiply(5)); + arrow.setDamage(50); + e.setCancelled(true); } } }