From f8b724f5a8af7399bea1b7830fea009efd004f00 Mon Sep 17 00:00:00 2001 From: nodyt Date: Mon, 5 Feb 2024 15:56:07 +0100 Subject: [PATCH] Added Kill Effects --- src/main/java/me/funky/praxi/match/Match.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/funky/praxi/match/Match.java b/src/main/java/me/funky/praxi/match/Match.java index 7b4d695..adbe93e 100644 --- a/src/main/java/me/funky/praxi/match/Match.java +++ b/src/main/java/me/funky/praxi/match/Match.java @@ -389,21 +389,18 @@ public void onDeath(Player dead) { Player killer = PlayerUtil.getLastAttacker(dead); if (killer != null) { Profile killerProfile = Profile.getByUuid(killer.getUniqueId()); - + Location location = dead.getLocation(); + World world = location.getWorld(); switch (killerProfile.getOptions().killEffect()) { case LIGHTNING: - Location location = dead.getLocation(); double x = location.getX(); double y = location.getY() + 2.0; double z = location.getZ(); - World world = location.getWorld(); Location lightningLocation = new Location(world, x, y, z); world.strikeLightning(lightningLocation); break; case FIREWORKS: - Location location2 = dead.getLocation(); - World world2 = location2.getWorld(); - Firework firework = world2.spawn(location2, Firework.class); + Firework firework = world.spawn(location, Firework.class); FireworkMeta meta = firework.getFireworkMeta(); FireworkEffect.Builder builder = FireworkEffect.builder() .withColor(Color.RED)