From 97433f7c8a2b0d52890c3eb16275b02e822753b6 Mon Sep 17 00:00:00 2001 From: Edith Boles Date: Mon, 4 Oct 2021 10:22:31 -0700 Subject: [PATCH] New rituals --- .../top/penowl/quidproquo/QuidProQuo.java | 2 ++ .../quidproquo/rituals/KickingRitual.java | 27 +++++++++++++++ .../quidproquo/rituals/RandomItemRitual.java | 34 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/KickingRitual.java create mode 100644 src/main/java/top/penowl/quidproquo/rituals/RandomItemRitual.java diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index b36b170..24a082d 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -60,6 +60,8 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new SummoningRitual()); rituals.add(new WitherRitual()); rituals.add(new WoolingRitual()); + rituals.add(new RandomItemRitual()); + rituals.add(new KickingRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { diff --git a/src/main/java/top/penowl/quidproquo/rituals/KickingRitual.java b/src/main/java/top/penowl/quidproquo/rituals/KickingRitual.java new file mode 100644 index 0000000..892e27f --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/KickingRitual.java @@ -0,0 +1,27 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import top.penowl.quidproquo.Ritual; + +public class KickingRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.WHEAT, 64*2); + addIngredient(Material.FLOWER_POT, 1); + addIngredient(Material.LOG, 1); + addIngredient(Material.IRON_BOOTS, 1); + health = 3; + name = "kicking"; + backfire = 0.4; + } + + @Override + public void execute(Player caster, Player target, Location location) { + target.kickPlayer("You have been banned by " + caster.getName() + "."); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/RandomItemRitual.java b/src/main/java/top/penowl/quidproquo/rituals/RandomItemRitual.java new file mode 100644 index 0000000..b3c0c69 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/RandomItemRitual.java @@ -0,0 +1,34 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import top.penowl.quidproquo.Ritual; + +public class RandomItemRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.DIRT, 6); + addIngredient(Material.STONE, 5); + addIngredient(Material.IRON_INGOT, 4); + addIngredient(Material.GOLD_INGOT, 3; + addIngredient(Material.REDSTONE, 2); + addIngredient(Material.DIAMOND, 1); + addIngredient(Material.WHEAT, 16); + health = 2; + name = "itemization"; + } + + @Override + public void execute(Player caster, Player target, Location location) { + Random r = new Random(); + int i = r.nextInt(440); + while(Material.getValue(i) == null){ + i = r.nextInt(440); + } + location.getWorld().dropItemNaturally(location.clone().add(0, 1, 0), ItemStack(Material.getValue(i)); + } + +}