diff --git a/bin/CrunchProjectiles/EntityProjectile.class b/bin/CrunchProjectiles/EntityProjectile.class index 5d12652..f3bce00 100644 Binary files a/bin/CrunchProjectiles/EntityProjectile.class and b/bin/CrunchProjectiles/EntityProjectile.class differ diff --git a/bin/CrunchProjectiles/ExplosiveProjectile.class b/bin/CrunchProjectiles/ExplosiveProjectile.class index 9da3950..edcdedc 100644 Binary files a/bin/CrunchProjectiles/ExplosiveProjectile.class and b/bin/CrunchProjectiles/ExplosiveProjectile.class differ diff --git a/bin/siegeCore/ClickHandler.class b/bin/siegeCore/ClickHandler.class index 809fe07..1a809c1 100644 Binary files a/bin/siegeCore/ClickHandler.class and b/bin/siegeCore/ClickHandler.class differ diff --git a/src/CrunchProjectiles/EntityProjectile.java b/src/CrunchProjectiles/EntityProjectile.java index 446fcc4..81d2d4f 100644 --- a/src/CrunchProjectiles/EntityProjectile.java +++ b/src/CrunchProjectiles/EntityProjectile.java @@ -28,24 +28,26 @@ public class EntityProjectile implements CrunchProjectile{ public Sound SoundType = Sound.ENTITY_GENERIC_EXPLODE; @Override public void Shoot(Player player, Entity entity, Location FireLocation, Float velocity) { + PlaySound = true; int baseDelay = 0; for (int i = 0; i < EntityCount; i++) { if (DelayedFire) { baseDelay += DelayTime; Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(CrunchSiegeCore.plugin, () -> { - - CreateEntity(entity, FireLocation, velocity); + + CreateEntity(entity, FireLocation, velocity, player); }, (long) baseDelay); } else { - CreateEntity(entity, FireLocation, velocity); + CreateEntity(entity, FireLocation, velocity, player); } // } } } - private void CreateEntity(Entity entity, Location loc, Float velocity) { + private boolean PlaySound = true; + private void CreateEntity(Entity entity, Location loc, Float velocity, Player player) { World world = entity.getLocation().getWorld(); LivingEntity living = (LivingEntity) entity; @@ -62,11 +64,16 @@ public class EntityProjectile implements CrunchProjectile{ if (arrow instanceof Arrow) { Arrow arr = (Arrow) arrow; arr.setDamage(8); + arr.setShooter(player); } // MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.DROPPED_ITEM, Material.IRON_NUGGET); // DisguiseAPI.disguiseEntity(arrow, miscDisguise); - world.playSound(loc, this.SoundType, 20, 2); - world.spawnParticle(this.ParticleType, loc.getX(), loc.getY(), loc.getZ(), 0); + if (PlaySound) { + world.playSound(loc, this.SoundType, 20, 2); + world.spawnParticle(this.ParticleType, loc.getX(), loc.getY(), loc.getZ(), 0); + PlaySound = false; + } + } private Vector Randomise() { diff --git a/src/CrunchProjectiles/ExplosiveProjectile.java b/src/CrunchProjectiles/ExplosiveProjectile.java index 0d7b902..554b32d 100644 --- a/src/CrunchProjectiles/ExplosiveProjectile.java +++ b/src/CrunchProjectiles/ExplosiveProjectile.java @@ -63,6 +63,7 @@ public class ExplosiveProjectile implements CrunchProjectile { tnt.setVelocity(loc.getDirection().multiply(velocity)); } + // MiscDisguise miscDisguise = new MiscDisguise(DisguiseType.ARROW); // miscDisguise.setEntity(tnt); // miscDisguise.startDisguise(); diff --git a/src/siegeCore/ClickHandler.java b/src/siegeCore/ClickHandler.java index 65a5931..4beec5f 100644 --- a/src/siegeCore/ClickHandler.java +++ b/src/siegeCore/ClickHandler.java @@ -86,10 +86,12 @@ public class ClickHandler implements Listener { } } } - List Blocks = sphere(loc, proj.ExplodePower); - for (int i = 0; i < proj.BlocksToPlaceAmount; i++) { - Block replace = getRandomElement(Blocks); - replace.setType(Material.COBWEB); + if (event.getHitBlock() != null) { + List Blocks = sphere(event.getHitBlock().getLocation(), proj.ExplodePower); + for (int i = 0; i < proj.BlocksToPlaceAmount; i++) { + Block replace = getRandomElement(Blocks); + replace.setType(Material.COBWEB); + } } } }