diff --git a/src/main/java/top/penowl/quidproquo/Commands.java b/src/main/java/top/penowl/quidproquo/Commands.java new file mode 100644 index 0000000..15f12d5 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/Commands.java @@ -0,0 +1,32 @@ +package top.penowl.quidproquo; + +import java.util.HashMap; +import java.util.List; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class Commands implements CommandExecutor { + + HashMap recipes = new HashMap(); + + public Commands(List rituals) { + for (Ritual ritual : rituals) { + recipes.put(ritual.name.toUpperCase(), ritual); + } + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (args.length < 1) { + // display help + return true; + } else if (recipes.containsKey(args[0].toUpperCase())) { + // display recipe info + return true; + } + return false; + } + +} diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index 2704bab..778a2e0 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -30,6 +30,9 @@ public class QuidProQuo extends JavaPlugin { getLogger().info("Loading rituals..."); getServer().getPluginManager().registerEvents(new Events(), this); + // register command handler + getCommand("ritual").setExecutor(new Commands(rituals)); + // register all rituals rituals.add(new HealRitual()); rituals.add(new WoolingRitual()); @@ -39,6 +42,7 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new AnvilRitual()); rituals.add(new FillerRitual()); rituals.add(new LavaRitual()); + rituals.add(new HitRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { diff --git a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java index 41f6ac8..92ac00a 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java @@ -7,13 +7,15 @@ import org.bukkit.entity.Player; import top.penowl.quidproquo.Ritual; +@SuppressWarnings("deprecation") public class AnvilRitual extends Ritual { @Override public void setup() { addIngredient(Material.ANVIL, 1); - addIngredient(Material.ENDER_PEARL, 2); - addIngredient(Material.ROTTEN_FLESH, 32); + addIngredient(Material.ENDER_PEARL, 1); + addIngredient(Material.ROTTEN_FLESH, 1); + addIngredient(Material.WHEAT, 32); name = "anviling"; health = 5; backfire = 0.5; diff --git a/src/main/java/top/penowl/quidproquo/rituals/FeedingRitual.java b/src/main/java/top/penowl/quidproquo/rituals/FeedingRitual.java index 08ec3a2..ad4c19f 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/FeedingRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/FeedingRitual.java @@ -2,7 +2,6 @@ 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; @@ -11,8 +10,8 @@ public class FeedingRitual extends Ritual { @Override public void setup() { - addSacrifice(EntityType.PIG, 1); - addIngredient(Material.WOOD_SWORD, 1); + addIngredient(Material.WOOD_HOE, 1); + addIngredient(Material.WHEAT, 16); health = 1; name = "feeding"; } diff --git a/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java b/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java index 0fad70f..5ee1c06 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java @@ -15,8 +15,9 @@ public class FillerRitual extends Ritual { @Override public void setup() { - addIngredient(Material.LOG, 64); + addIngredient(Material.LOG, 1); addSacrifice(EntityType.PIG, 1); + addIngredient(Material.WHEAT, 128); name = "trolling"; health = 2; backfire = 0.2; diff --git a/src/main/java/top/penowl/quidproquo/rituals/GetLuckyRitual.java b/src/main/java/top/penowl/quidproquo/rituals/GetLuckyRitual.java index 9a75979..68ab2f2 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/GetLuckyRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/GetLuckyRitual.java @@ -11,8 +11,9 @@ public class GetLuckyRitual extends Ritual { @Override public void setup() { - addIngredient(Material.GOLD_BLOCK, 3); + addIngredient(Material.GOLD_BLOCK, 1); addIngredient(Material.TNT, 1); + addIngredient(Material.WHEAT, 256); health = 3; lightning = true; name = "daring"; diff --git a/src/main/java/top/penowl/quidproquo/rituals/HealRitual.java b/src/main/java/top/penowl/quidproquo/rituals/HealRitual.java index c280370..a1d44dd 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/HealRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/HealRitual.java @@ -10,13 +10,14 @@ public class HealRitual extends Ritual { @Override public void setup() { - addIngredient(Material.REDSTONE, 9); + addIngredient(Material.REDSTONE, 1); + addIngredient(Material.WHEAT, 16); name = "healing"; } @Override public void execute(Player caster, Player target, Location location) { - caster.setHealth(Math.min(caster.getMaxHealth(), caster.getHealth()+2.0)); + caster.setHealth(Math.min(caster.getMaxHealth(), caster.getHealth()+8.0)); } } diff --git a/src/main/java/top/penowl/quidproquo/rituals/HitRitual.java b/src/main/java/top/penowl/quidproquo/rituals/HitRitual.java index 9e00ae3..2d7200b 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/HitRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/HitRitual.java @@ -11,16 +11,25 @@ public class HitRitual extends Ritual { @Override public void setup() { addIngredient(Material.IRON_SWORD, 1); +<<<<<<< HEAD + addIngredient(Material.IRON_INGOT, 1); +======= +>>>>>>> 7f77c0dac5cb9bbd0ceaf70f710f7fdecac3e9ad addIngredient(Material.WHEAT, 9); name = "shadow hit"; - health = 2; + health = 1; } @Override public void execute(Player caster, Player target, Location location) { +<<<<<<< HEAD + target.playSound(target.getLocation(), Sound.HURT_FLESH, 1, 1); + //target.damage(1.0); +======= for(int i = 0; i < 3; i ++) { target.playSound(target.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1); } +>>>>>>> 7f77c0dac5cb9bbd0ceaf70f710f7fdecac3e9ad } } diff --git a/src/main/java/top/penowl/quidproquo/rituals/LavaRitual.java b/src/main/java/top/penowl/quidproquo/rituals/LavaRitual.java index 9e2c6ef..624c30a 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/LavaRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/LavaRitual.java @@ -12,13 +12,13 @@ public class LavaRitual extends Ritual { addIngredient(Material.LAVA_BUCKET, 1); addIngredient(Material.DIAMOND, 1); addIngredient(Material.WHEAT, 64); - backfire = 0.50; + backfire = 0.10; name = "combustion"; } @Override public void execute(Player caster, Player target, Location location) { - target.setFireTicks(60); + target.setFireTicks(250); } } diff --git a/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java b/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java index 8597cb4..63a41ce 100644 --- a/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java +++ b/src/main/java/top/penowl/quidproquo/rituals/SnowmanRitual.java @@ -12,8 +12,9 @@ public class SnowmanRitual extends Ritual { @Override public void setup() { addIngredient(Material.STICK, 64); - addIngredient(Material.DIAMOND, 2); - addSacrifice(EntityType.SHEEP, 3); + addIngredient(Material.DIAMOND, 1); + addSacrifice(EntityType.SHEEP, 1); + addIngredient(Material.WHEAT, 32); health = 10; name = "snowing"; }