From 00a850827f652ab625a5d4be2fe0da25646e7a2d Mon Sep 17 00:00:00 2001 From: Edith Boles Date: Fri, 1 Oct 2021 16:10:10 -0700 Subject: [PATCH] Snowman ritual --- .../java/top/penowl/quidproquo/Events.java | 6 ++-- .../top/penowl/quidproquo/QuidProQuo.java | 2 ++ .../quidproquo/rituals/SnowmanRitual.java | 28 +++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java diff --git a/src/main/java/top/penowl/quidproquo/Events.java b/src/main/java/top/penowl/quidproquo/Events.java index 2904ff7..ab0b43c 100644 --- a/src/main/java/top/penowl/quidproquo/Events.java +++ b/src/main/java/top/penowl/quidproquo/Events.java @@ -52,9 +52,9 @@ public final class Events implements Listener { List players = new ArrayList(Bukkit.getOnlinePlayers()); List uuids = new ArrayList(); for (Player target : players) { - if (target.getUniqueId() != playerUuid) { + //if (target.getUniqueId() != playerUuid) { uuids.add(target.getUniqueId()); - } + //} } Collections.sort(uuids); @@ -70,7 +70,7 @@ public final class Events implements Listener { } // friendly message - player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid))); + player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid)).getName()); } else { diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 9ac15de..df8d260 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -8,6 +8,7 @@ import org.bukkit.plugin.java.JavaPlugin; import top.penowl.quidproquo.rituals.FeedingRitual; import top.penowl.quidproquo.rituals.HealRitual; +import top.penowl.quidproquo.rituals.SnowmanRitual; import top.penowl.quidproquo.rituals.WoolingRitual; public class QuidProQuo extends JavaPlugin { @@ -36,6 +37,7 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new HealRitual()); rituals.add(new WoolingRitual()); rituals.add(new FeedingRitual()); + rituals.add(new SnowmanRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { diff --git a/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java b/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java new file mode 100644 index 0000000..8597cb4 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java @@ -0,0 +1,28 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; + +import top.penowl.quidproquo.Ritual; + +public class SnowmanRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.STICK, 64); + addIngredient(Material.DIAMOND, 2); + addSacrifice(EntityType.SHEEP, 3); + health = 10; + name = "snowing"; + } + + @Override + public void execute(Player caster, Player target, Location location) { + for (int i = 0; i < 10; i++) { + target.getLocation().getWorld().spawnEntity(target.getLocation(), EntityType.SNOWMAN); + } + } + +}