From 056f7cc93b4c79cd6b203599cc57ac8506a1e2dd Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 14 Oct 2013 11:29:25 -0400 Subject: [PATCH] Nicer handling of some particle effect code. --- .../util/skills/ParticleEffectUtils.java | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java b/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java index b07d03880..d51c6493d 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/ParticleEffectUtils.java @@ -38,15 +38,9 @@ public final class ParticleEffectUtils { Location location = player.getEyeLocation(); World world = player.getWorld(); - world.playEffect(location, Effect.SMOKE, BlockFace.SOUTH_EAST); - world.playEffect(location, Effect.SMOKE, BlockFace.SOUTH); - world.playEffect(location, Effect.SMOKE, BlockFace.SOUTH_WEST); - world.playEffect(location, Effect.SMOKE, BlockFace.EAST); - world.playEffect(location, Effect.SMOKE, BlockFace.SELF); - world.playEffect(location, Effect.SMOKE, BlockFace.WEST); - world.playEffect(location, Effect.SMOKE, BlockFace.NORTH_EAST); - world.playEffect(location, Effect.SMOKE, BlockFace.NORTH); - world.playEffect(location, Effect.SMOKE, BlockFace.NORTH_WEST); + for (BlockFace face : BlockFace.values()) { + world.playEffect(location, Effect.SMOKE, face); + } } public static void playGreaterImpactEffect(LivingEntity livingEntity) { @@ -85,14 +79,7 @@ public final class ParticleEffectUtils { private static void fireworkParticleShower(Player player, Color color) { Location location = player.getLocation(); - - if (player.isInsideVehicle()) { - location.setY(location.getY() + 1.0); - } - else { - location.setY(location.getY() - 1.0); - } - + location.setX(location.getY() + (player.isInsideVehicle() ? 1.0 : -1.0)); location.setPitch(-90); Firework firework = (Firework) player.getWorld().spawnEntity(location, EntityType.FIREWORK);