diff --git a/src/main/java/top/penowl/quidproquo/Events.java b/src/main/java/top/penowl/quidproquo/Events.java index c2ab75c..3059079 100644 --- a/src/main/java/top/penowl/quidproquo/Events.java +++ b/src/main/java/top/penowl/quidproquo/Events.java @@ -72,7 +72,6 @@ public final class Events implements Listener { } else { QuidProQuo.instance.targets.put(playerUuid, uuids.get(0)); } - player.sendMessage(ChatColor.YELLOW + "Switched target to " + Bukkit.getPlayer(QuidProQuo.instance.targets.get(playerUuid))); } // friendly message @@ -120,9 +119,11 @@ public final class Events implements Listener { for (Item item : matches) { matchCount += item.getItemStack().getAmount(); } - if (matchCount >= count) { + if (matchCount > count) { possibleItems.add(matches); byproducts.add(new ItemStack(material, matchCount - count)); + } else if (matchCount == count) { + possibleItems.add(matches); } else { failed = true; break; diff --git a/src/main/java/top/penowl/quidproquo/QuidProQuo.java b/src/main/java/top/penowl/quidproquo/QuidProQuo.java index b8ae2eb..49def25 100644 --- a/src/main/java/top/penowl/quidproquo/QuidProQuo.java +++ b/src/main/java/top/penowl/quidproquo/QuidProQuo.java @@ -36,11 +36,14 @@ public class QuidProQuo extends JavaPlugin { rituals.add(new FeedingRitual()); rituals.add(new SnowmanRitual()); rituals.add(new GetLuckyRitual()); + rituals.add(new AnvilRitual()); // run ritual setup scripts for (Ritual ritual : rituals) { getLogger().info("Loading " + ritual.getClass().toString() + "..."); ritual.setup(); + getLogger().info("Ingredients: " + ritual.ingredients.toString()); + getLogger().info("Sacrifices: " + ritual.sacrifices.toString()); getLogger().info("Loaded a " + ritual.name + " ritual."); } diff --git a/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.java new file mode 100644 index 0000000..220c30d --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/AnvilRitual.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.FallingBlock; +import org.bukkit.entity.Player; + +import top.penowl.quidproquo.Ritual; + +public class AnvilRitual extends Ritual { + + @Override + public void setup() { + addIngredient(Material.ANVIL, 1); + addIngredient(Material.ENDER_PEARL, 2); + addIngredient(Material.ROTTEN_FLESH, 32); + name = "anviling"; + health = 5; + backfire = 0.5; + } + + @Override + public void execute(Player caster, Player target, Location location) { + FallingBlock block = target.getLocation().getWorld().spawnFallingBlock(target.getLocation().clone().add(0, 20, 0), Material.ANVIL, (byte) 0); + block.setHurtEntities(true); + } + +} diff --git a/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java b/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java new file mode 100644 index 0000000..f0caef7 --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/FillerRitual.java @@ -0,0 +1,20 @@ +package top.penowl.quidproquo.rituals; + +import org.bukkit.Location; +import org.bukkit.entity.Player; + +import top.penowl.quidproquo.Ritual; + +public class BlankRitual extends Ritual { + + @Override + public void setup() { + + } + + @Override + public void execute(Player caster, Player target, Location location) { + + } + +}