diff --git a/src/main/java/top/penowl/quidproquo/Commands.java b/src/main/java/top/penowl/quidproquo/Commands.java index 1425cad..227a911 100644 --- a/src/main/java/top/penowl/quidproquo/Commands.java +++ b/src/main/java/top/penowl/quidproquo/Commands.java @@ -1,6 +1,7 @@ package top.penowl.quidproquo; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +31,7 @@ public class Commands implements CommandExecutor { return false; } else if (args[0].toLowerCase().equals("list")) { List ritualNames = new ArrayList(recipes.keySet()); + Collections.sort(ritualNames); int max = ritualNames.size() - 1; int maxPages = max / 9; int page = 0; diff --git a/src/main/java/top/penowl/quidproquo/Events.java b/src/main/java/top/penowl/quidproquo/Events.java index e7ae332..ab4cbf6 100644 --- a/src/main/java/top/penowl/quidproquo/Events.java +++ b/src/main/java/top/penowl/quidproquo/Events.java @@ -93,7 +93,7 @@ public final class Events implements Listener { } } for (LivingEntity sacrifice : sacrifices) { - if (sacrifice.getLocation().distance(location) < 2) { + if (sacrifice.getLocation().distance(location) < 6) { near_sacrifices.add(sacrifice); } } @@ -101,7 +101,7 @@ public final class Events implements Listener { // we check each ritual in order for (Ritual ritual : QuidProQuo.instance.rituals) { - // this is where all the ingredients get collected in + // this is what all the ingredients get collected in ArrayList> possibleItems = new ArrayList>(); ArrayList> possibleSacrifices = new ArrayList>(); Boolean failed = false; diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 8bf3f6e..a2f93ab 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -40,13 +40,14 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new GetLuckyRitual()); rituals.add(new HardPenorRitual()); rituals.add(new HealRitual()); - rituals.add(new HerobrineRitual()); - rituals.add(new HitRitual()); - rituals.add(new LavaRitual()); - rituals.add(new RotateRitual()); - rituals.add(new SnowmanRitual()); + rituals.add(new HardPenorRitual()); rituals.add(new SoftPenorRitual()); - rituals.add(new WoolingRitual()); + rituals.add(new QuicktimeRitual()); + rituals.add(new LightQuicktimeRitual()); + rituals.add(new WitherRitual()); + rituals.add(new DragonRitual()); + rituals.add(new CrystalizationRtiual()); + rituals.add(new BatSpewRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { diff --git a/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java b/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java new file mode 100644 index 0000000..18982d2 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/BatSpewRitual.java @@ -0,0 +1,29 @@ +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 BatSpewRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.WHEAT, 64); + addIngredient(Material.IRON_PICKAXE, 1); + addSacrifice(EntityType.CHICKEN, 1); + health = 4; + name = "bat spew"; + backfire = 0.1; + } + + @Override + public void execute(Player caster, Player target, Location location) { + for (int i = 0; i < 20; i++) { + target.getLocation().getWorld().spawnEntity(target.getLocation(), EntityType.CHICKEN); + } + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/CreeperHissRitual.java b/src/main/java/top/penowl/quidproquo/rituals/CreeperHissRitual.java index 56cd0a7..5441bcb 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/CreeperHissRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/CreeperHissRitual.java @@ -14,6 +14,7 @@ public class CreeperHissRitual extends Ritual { addIngredient(Material.SULPHUR, 1); addIngredient(Material.REDSTONE, 1); addIngredient(Material.WHEAT, 16); + name = "creeper hissing"; health = 1; } diff --git a/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java b/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java new file mode 100644 index 0000000..afbeb08 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/CrystalizationRtiual.java @@ -0,0 +1,29 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.EnderCrystal; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import top.penowl.quidproquo.Ritual; + +public class CrystalizationRtiual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.ENDER_PEARL, 1); + addIngredient(Material.GLASS, 1); + addIngredient(Material.TNT, 1); + addIngredient(Material.WHEAT, 32); + name = "crystalization"; + health = 2; + } + + @Override + public void execute(Player caster, Player target, Location location) { + location.getWorld().spawnEntity(location.clone().add(0, 1, 0), EntityType.ENDER_CRYSTAL); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java b/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java new file mode 100644 index 0000000..bef9218 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/DragonRitual.java @@ -0,0 +1,33 @@ +package top.penowl.quidproquo.rituals; + +import java.util.WeakHashMap; + +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 DragonRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.ENDER_PEARL, 16); + addIngredient(Material.WHEAT, 64*9*2); + addSacrifice(EntityType.CHICKEN, 2); + addSacrifice(EntityType.ENDERMAN, 1); + addIngredient(Material.EGG, 64); + addIngredient(Material.STONE, 64); + addIngredient(Material.BOOK, 4); + addIngredient(Material.DIAMOND_BLOCK, 1); + name = "dragon summoning"; + health = 3; + } + + @Override + public void execute(Player caster, Player target, Location location) { + location.getWorld().spawnEntity(location.clone().add(0, 1, 0), EntityType.ENDER_DRAGON); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java b/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java index 2ecb63b..2ec62b5 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/HardPenorRitual.java @@ -19,7 +19,7 @@ public class HardPenorRitual extends Ritual { @Override public void execute(Player caster, Player target, Location location) { - Block shaft = caster.getLocation().getBlock(); + Block shaft = target.getLocation().getBlock(); Block ball1 = shaft.getRelative(2, -1, 0); Block ball2 = shaft.getRelative(-2,-1,0); //TODO USE ELEGANT MATHEMATICS INSTEAD OF SCUFFED IF STATEMENTS diff --git a/src/main/java/top/penowl/quidproquo/rituals/HerobrineRitual.java b/src/main/java/top/penowl/quidproquo/rituals/HerobrineRitual.java index bfde786..e0433bb 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/HerobrineRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/HerobrineRitual.java @@ -20,7 +20,7 @@ public class HerobrineRitual extends Ritual { @Override public void setup() { - addIngredient(Material.WHEAT, 64*9); + addIngredient(Material.WHEAT, 64*3); addIngredient(Material.DIAMOND, 9); addIngredient(Material.ROTTEN_FLESH, 64); addIngredient(Material.REDSTONE_BLOCK, 9); diff --git a/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java b/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java new file mode 100644 index 0000000..4b1cef1 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/LightQuicktimeRitual.java @@ -0,0 +1,32 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import top.penowl.quidproquo.Ritual; + +public class LightQuicktimeRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.WHEAT, 64+32); + addIngredient(Material.GLASS_BOTTLE, 1); + addIngredient(Material.SPIDER_EYE, 1); + name = "quicktime lite"; + health = 4; + backfire = 0.3; + } + + @Override + public void execute(Player caster, Player target, Location location) { + target.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 60, 1)); + target.getWorld().dropItemNaturally(target.getLocation(), new ItemStack(Material.MILK_BUCKET, 1)); + target.sendMessage("DRINK THE MILK IDIOT"); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/QuicktimeRitual.java b/src/main/java/top/penowl/quidproquo/rituals/QuicktimeRitual.java new file mode 100644 index 0000000..69d8113 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/QuicktimeRitual.java @@ -0,0 +1,33 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import top.penowl.quidproquo.Ritual; + +public class QuicktimeRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.WHEAT, 64*2); + addIngredient(Material.POTION, 1); + addIngredient(Material.SPIDER_EYE, 1); + addSacrifice(EntityType.SPIDER, 1); + name = "quicktime"; + health = 4; + backfire = 0.15; + } + + @Override + public void execute(Player caster, Player target, Location location) { + target.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 60, 2)); + target.getWorld().dropItemNaturally(target.getLocation(), new ItemStack(Material.MILK_BUCKET, 1)); + target.sendMessage("DRINK THE MILK IDIOT"); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/WitherRitual.java b/src/main/java/top/penowl/quidproquo/rituals/WitherRitual.java new file mode 100644 index 0000000..4d63f69 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/WitherRitual.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 WitherRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.BONE, 64); + addIngredient(Material.WHEAT, 64*9); + addSacrifice(EntityType.SKELETON, 1); + addIngredient(Material.FLOWER_POT, 1); + addIngredient(Material.SAND, 1); + name = "wither summoning"; + health = 2; + } + + @Override + public void execute(Player caster, Player target, Location location) { + location.getWorld().spawnEntity(location.clone().add(0, 1, 0), EntityType.WITHER); + } + +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index af8ea84..f35cf59 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -8,5 +8,5 @@ commands: permission: quidproquo.command permission-message: You do not have /<permission> usage: | - §3/ritual list - List all available rituals. + §3/ritual list [page] - List all available rituals. §3/ritual - See the information on a ritual \ No newline at end of file