From 222b0b0732c0f15c10533340ea08d386d34a09d9 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Sun, 3 Oct 2021 13:35:48 -0700 Subject: [PATCH] Added a lightning ritual reveals players locations in the overworld with lightning --- .../top/penowl/quidproquo/QuidProQuo.java | 1 + .../quidproquo/rituals/LightningRitual.java | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 8d9ae4e..6f36d45 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -47,6 +47,7 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new HerobrineRitual()); rituals.add(new HitRitual()); rituals.add(new LavaRitual()); + rituals.add(new LightningRitual()); rituals.add(new LightQuicktimeRitual()); rituals.add(new QuicktimeRitual()); rituals.add(new RotateRitual()); diff --git a/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java b/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java new file mode 100644 index 0000000..2a19adc --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/LightningRitual.java @@ -0,0 +1,32 @@ +package top.penowl.quidproquo.rituals; + +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.entity.Player; + +import top.penowl.quidproquo.Ritual; + +public class LightningRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.WHEAT, 64); + addIngredient(Material.GLOWSTONE, 64); + name = "lightning location"; + } + + @Override + public void execute(Player caster, Player target, Location location) { + // Does this actually get the overworld? + World overworld = Bukkit.getWorld("world"); + List players = overworld.getPlayers(); + for(Player player : players) { + overworld.strikeLightningEffect(player.getLocation().clone().add(0, 1, 0)); + } + } + +}